From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 7BB3721164C63 for ; Sun, 14 Oct 2018 19:16:31 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2018 19:16:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,383,1534834800"; d="scan'208";a="95205293" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 14 Oct 2018 19:16:28 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 14 Oct 2018 19:16:28 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.48]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0319.002; Mon, 15 Oct 2018 10:16:26 +0800 From: "Gao, Liming" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Wang, Jian J" Thread-Topic: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set Thread-Index: AQHUYhWFXMCeMo/qrk+bHaFFReSaiaUflfWg Date: Mon, 15 Oct 2018 02:16:26 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E339EA0@SHSMSX104.ccr.corp.intel.com> References: <1539339753-37404-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1539339753-37404-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 02:16:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zeng, Star >Sent: Friday, October 12, 2018 6:23 PM >To: edk2-devel@lists.01.org >Cc: Zeng, Star ; Gao, Liming ; >Yao, Jiewen ; Wang, Jian J >Subject: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId >set > >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1245 > >In current implementation and according to the description in >MdeModulePkg.dec, PcdSetNvStoreDefaultId should be set in PEI >phase to take effect. > >This patch ASSERTs PcdSetNvStoreDefaultId set in PcdDxe to alert >the invalid operation. > >Cc: Liming Gao >Cc: Jiewen Yao >Cc: Jian J Wang >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Star Zeng >--- > MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 5 +++++ > MdeModulePkg/Universal/PCD/Dxe/Pcd.inf | 4 +++- > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c >b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c >index bc308af1c5d8..f977c7f18e19 100644 >--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c >+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c >@@ -890,6 +890,11 @@ DxePcdSet16Ex ( > IN UINT16 Value > ) > { >+ // >+ // PcdSetNvStoreDefaultId should be set in PEI phase to take effect. >+ // >+ ASSERT (!(CompareGuid (Guid, &gEfiMdeModulePkgTokenSpaceGuid) && >+ (ExTokenNumber =3D=3D PcdToken(PcdSetNvStoreDefaultId)))); > return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value)); > } > >diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf >b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf >index 066b86aaa5f3..1f41a316bd89 100644 >--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf >+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf >@@ -331,6 +331,7 @@ [LibraryClasses] > [Guids] > gPcdDataBaseHobGuid ## SOMETIMES_CONSUMES ##= HOB > gPcdDataBaseSignatureGuid ## CONSUMES ## GUID # P= CD >database signature GUID. >+ gEfiMdeModulePkgTokenSpaceGuid ## SOMETIMES_CONSUMES >## GUID > > [Protocols] > gPcdProtocolGuid ## PRODUCES >@@ -342,7 +343,8 @@ [Protocols] > gEdkiiVariableLockProtocolGuid > > [Pcd] >- gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## >SOMETIMES_CONSUMES >+ gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## >SOMETIMES_CONSUMES >+ gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ## >SOMETIMES_CONSUMES > > [Depex] > TRUE >-- >2.7.0.windows.1