From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jordan.l.justen@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0B09C2095E507 for ; Mon, 2 Oct 2017 10:55:19 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 02 Oct 2017 10:58:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,470,1500966000"; d="scan'208";a="158484246" Received: from gapokam-mobl2.amr.corp.intel.com (HELO localhost) ([10.254.35.226]) by fmsmga006.fm.intel.com with ESMTP; 02 Oct 2017 10:58:38 -0700 MIME-Version: 1.0 To: Jian J Wang , edk2-devel@lists.01.org Message-ID: <150696711831.2454.16712170525103415248@jljusten-skl> From: Jordan Justen In-Reply-To: <20170928010353.11968-7-jian.j.wang@intel.com> Cc: Star Zeng , Eric Dong , Laszlo Ersek , Jiewen Yao , Michael Kinney , Ayellet Wolman References: <20170928010353.11968-1-jian.j.wang@intel.com> <20170928010353.11968-7-jian.j.wang@intel.com> User-Agent: alot/0.6 Date: Mon, 02 Oct 2017 10:58:38 -0700 Subject: Re: [PATCH v3 6/6] OvmfPkg/QemuVideoDxe: Bypass NULL pointer detection during VBE SHIM installing X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 17:55:20 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jordan Justen On 2017-09-27 18:03:53, Jian J Wang wrote: > QemuVideoDxe driver will link VBE SHIM into page 0. If NULL pointer > detection is enabled, this driver will fail to load. NULL pointer detecti= on > bypassing code is added to prevent such problem during boot. > = > Please note that Windows 7 will try to access VBE SHIM during boot if it's > installed, and then cause boot failure. This can be fixed by setting BIT7 > of PcdNullPointerDetectionPropertyMask to disable NULL pointer detection > after EndOfDxe. As far as we know, there's no other OSs has such issue. > = > > According to Laszlo, remove the code disabling/enabling the NULL pointer > > detection but just ignore the installing if it's enabled > = > Cc: Star Zeng > Cc: Eric Dong > Cc: Laszlo Ersek > Cc: Jiewen Yao > Cc: Michael Kinney > Cc: Jordan Justen > Cc: Ayellet Wolman > Suggested-by: Ayellet Wolman > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jian J Wang > --- > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 1 + > OvmfPkg/QemuVideoDxe/VbeShim.c | 14 ++++++++++++++ > 2 files changed, 15 insertions(+) > = > diff --git a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf b/OvmfPkg/QemuVideoDxe= /QemuVideoDxe.inf > index 577e07b0a8..ff68c99e96 100644 > --- a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf > +++ b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf > @@ -77,3 +77,4 @@ > [Pcd] > gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId > + gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask > diff --git a/OvmfPkg/QemuVideoDxe/VbeShim.c b/OvmfPkg/QemuVideoDxe/VbeShi= m.c > index e45a08e887..8ba5522cde 100644 > --- a/OvmfPkg/QemuVideoDxe/VbeShim.c > +++ b/OvmfPkg/QemuVideoDxe/VbeShim.c > @@ -75,6 +75,20 @@ InstallVbeShim ( > UINTN Printed; > VBE_MODE_INFO *VbeModeInfo; > = > + if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & (BIT0|BIT7)) =3D= =3D BIT0) { > + DEBUG (( > + DEBUG_WARN, > + "%a: page 0 protected, not installing VBE shim\n", > + __FUNCTION__ > + )); > + DEBUG (( > + DEBUG_WARN, > + "%a: page 0 protection prevents Windows 7 from booting anyway\n", > + __FUNCTION__ > + )); > + return; > + } > + > Segment0 =3D 0x00000; > SegmentC =3D 0xC0000; > SegmentF =3D 0xF0000; > -- = > 2.14.1.windows.1 >=20