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.120; helo=mga04.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 5E06121D046AB for ; Mon, 25 Sep 2017 01:22:41 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2017 01:25:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,435,1500966000"; d="scan'208";a="1018045547" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 25 Sep 2017 01:25:51 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Sep 2017 01:25:51 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Sep 2017 01:25:51 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Mon, 25 Sep 2017 16:25:48 +0800 From: "Wang, Jian J" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , Laszlo Ersek , "Yao, Jiewen" , "Kinney, Michael D" , "Justen, Jordan L" , "Wolman, Ayellet" , "Gao, Liming" Thread-Topic: [PATCH v2 1/6] MdeModulePkg/MdeModulePkg.dec: Add NULL pointer detection PCD Thread-Index: AQHTMplg7alxpwjopkKN1yhyEIb0Z6LFQ4VwgAAG3zA= Date: Mon, 25 Sep 2017 08:25:48 +0000 Message-ID: References: <20170921052032.13652-1-jian.j.wang@intel.com> <20170921052032.13652-2-jian.j.wang@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B979966@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103B979966@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 1/6] MdeModulePkg/MdeModulePkg.dec: Add NULL pointer detection PCD 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, 25 Sep 2017 08:22:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sure. Thanks for the feedback. > -----Original Message----- > From: Zeng, Star > Sent: Monday, September 25, 2017 4:01 PM > To: Wang, Jian J ; edk2-devel@lists.01.org > Cc: Dong, Eric ; Laszlo Ersek ; Y= ao, > Jiewen ; Kinney, Michael D > ; Justen, Jordan L ; > Wolman, Ayellet ; Zeng, Star > ; Gao, Liming > Subject: RE: [PATCH v2 1/6] MdeModulePkg/MdeModulePkg.dec: Add NULL > pointer detection PCD >=20 > You may need also add PcdNullPointerDetectionPropertyMask prompt and help > into the MdeModulePkg.uni. >=20 >=20 > Thanks, > Star > -----Original Message----- > From: Wang, Jian J > Sent: Thursday, September 21, 2017 1:20 PM > To: edk2-devel@lists.01.org > Cc: Wang, Jian J ; Zeng, Star ; > Dong, Eric ; Laszlo Ersek ; Yao, > Jiewen ; Kinney, Michael D > ; Justen, Jordan L ; > Wolman, Ayellet > Subject: [PATCH v2 1/6] MdeModulePkg/MdeModulePkg.dec: Add NULL pointer > detection PCD >=20 > From: "Wang, Jian J" >=20 > PCD PcdNullPointerDetectionPropertyMask is a bitmask used to control the > NULL address detection functionality in code for different phases. >=20 > If enabled, accessing NULL address in UEFI or SMM code can be caught as a > page fault exception. >=20 > BIT0 - Enable NULL pointer detection for UEFI. > BIT1 - Enable NULL pointer detection for SMM. > BIT2..6 - Reserved for future uses. > BIT7 - Disable NULL pointer detection just after EndOfDxe. This is= a > workaround for those unsolvable NULL access issues in > OptionROM, boot loader, etc. It can also help to avoid > unnecessary exception caused by legacy memory (0-4095) acce= ss > after EndOfDxe, such as Windows 7 boot on Qemu. >=20 > 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 > --- > MdeModulePkg/MdeModulePkg.dec | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec index 403a66a5ad..3f90b8d7e6 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -863,6 +863,19 @@ > # @ValidList 0x80000006 | 0x03058002 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable|0x03058002|UIN > T32|0x30001040 >=20 > + ## Mask to control the NULL address detection in code for different ph= ases. > + # If enabled, accessing NULL address in UEFI or SMM code can be > caught.

> + # BIT0 - Enable NULL pointer detection for UEFI.
> + # BIT1 - Enable NULL pointer detection for SMM.
> + # BIT2..6 - Reserved for future uses.
> + # BIT7 - Disable NULL pointer detection just after EndOfDxe. > + # This is a workaround for those unsolvable NULL access i= ssues in > + # OptionROM, boot loader, etc. It can also help to avoid = unnecessary > + # exception caused by legacy memory (0-4095) access after= EndOfDxe, > + # such as Windows 7 boot on Qemu.
> + # @Prompt Enable NULL address detection. > + > + > gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|0x0 > + |UINT8|0x30001050 > + > [PcdsFixedAtBuild, PcdsPatchableInModule] > ## Dynamic type PCD can be registered callback function for Pcd settin= g action. > # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number > of callback function > -- > 2.14.1.windows.1