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=jian.j.wang@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 035B021163DEA for ; Sun, 14 Oct 2018 19:43:18 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2018 19:43:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,383,1534834800"; d="scan'208";a="82589362" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 14 Oct 2018 19:43:18 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) 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:43:17 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.111]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Mon, 15 Oct 2018 10:43:13 +0800 From: "Wang, Jian J" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Yao, Jiewen" Thread-Topic: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set Thread-Index: AQHUYhWFOcUSQGJHRkWxW9MKSLaO56UfnWlQ Date: Mon, 15 Oct 2018 02:43:12 +0000 Message-ID: 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-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWVmZThkOTYtNTIxYS00ZGM0LTg3ZTItOTJlNTJmZTI5ZGVkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRE9hK1lkRmx4WkE3Vmh5R3MyVW56NzgycVNLRHVvckJna08yT1RuYk43ZG5cL0xcLzRTV0U1ZGk3ZlYzUnN5eTJ5In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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:43:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang > -----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 >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1245 >=20 > In current implementation and according to the description in > MdeModulePkg.dec, PcdSetNvStoreDefaultId should be set in PEI > phase to take effect. >=20 > This patch ASSERTs PcdSetNvStoreDefaultId set in PcdDxe to alert > the invalid operation. >=20 > 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(-) >=20 > 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))= ; > } >=20 > 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 # = PCD > database signature GUID. > + gEfiMdeModulePkgTokenSpaceGuid ## SOMETIMES_CONSUMES #= # > GUID >=20 > [Protocols] > gPcdProtocolGuid ## PRODUCES > @@ -342,7 +343,8 @@ [Protocols] > gEdkiiVariableLockProtocolGuid >=20 > [Pcd] > - gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## > SOMETIMES_CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## > SOMETIMES_CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ## > SOMETIMES_CONSUMES >=20 > [Depex] > TRUE > -- > 2.7.0.windows.1