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.115; helo=mga14.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 D068B21191720 for ; Tue, 11 Dec 2018 05:42:29 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 05:42:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,342,1539673200"; d="scan'208";a="258558719" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 11 Dec 2018 05:42:29 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Dec 2018 05:42:28 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Dec 2018 05:42:28 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0415.000; Tue, 11 Dec 2018 21:42:25 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch V3] BaseTools: Fix PcdNvStoreDefaultValueBuffer Value. Thread-Index: AQHUkTEW+tt6nJA5VEKSjvN6QJIl8KV5jEjg Date: Tue, 11 Dec 2018 13:42:25 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E38A280@SHSMSX104.ccr.corp.intel.com> References: <20181211090402.1000-1-bob.c.feng@intel.com> In-Reply-To: <20181211090402.1000-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmY2ZGE2NjQtMzI5Ny00NDExLWFlMTktYzRhZWI4ODQyZmY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQXZGelZUVno4SVMrbzQyd2tFOGoxcEpueXdnSmdvY0R5MlwvdjdCMkNrQ1Bhckl0Um5mTFJGSkhTSk96cWJuRzcifQ== 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 V3] BaseTools: Fix PcdNvStoreDefaultValueBuffer Value. 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: Tue, 11 Dec 2018 13:42:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Feng, Bob C > Sent: Tuesday, December 11, 2018 5:04 PM > To: edk2-devel@lists.01.org > Cc: Feng, Bob C ; Gao, Liming ; Leif Lindholm > Subject: [Patch V3] BaseTools: Fix PcdNvStoreDefaultValueBuffer Value. >=20 > From: "Feng, Bob C" >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1385 > This patch is going to fix the regression issue that is > introduced by commit e6eae3b4c7b9b756263ecec79694de5f1e85b73a > and commit 0b6c5954e1d9a17e01eee7d5ef840a5b4790e2e8. >=20 > PcdNvStoreDefaultValueBuffer value is update to Vpd Info File, > but it is not update into a internal cache. This patch will > fix this incorrect value in that internal cache. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Leif Lindholm > --- > BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++---- > BaseTools/Source/Python/Common/VpdInfoFile.py | 6 +++--- > 2 files changed, 15 insertions(+), 7 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Sourc= e/Python/AutoGen/AutoGen.py > index 12e53010a5..d646cd50ce 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -1568,10 +1568,16 @@ class PlatformAutoGen(AutoGen): > if VpdFile.GetCount() !=3D 0: >=20 > self.FixVpdOffset(VpdFile) >=20 > self.FixVpdOffset(self.UpdateNVStoreMaxSize(VpdFile)) > + PcdNvStoreDfBuffer =3D [item for item in self._DynamicPc= dList if item.TokenCName =3D=3D > "PcdNvStoreDefaultValueBuffer" and item.TokenSpaceGuidCName =3D=3D "gEfiM= deModulePkgTokenSpaceGuid"] > + if PcdNvStoreDfBuffer: > + PcdName,PcdGuid =3D PcdNvStoreDfBuffer[0].TokenCName= , PcdNvStoreDfBuffer[0].TokenSpaceGuidCName > + if (PcdName,PcdGuid) in VpdSkuMap: > + DefaultSku =3D PcdNvStoreDfBuffer[0].SkuInfoList= .get(TAB_DEFAULT) > + VpdSkuMap[(PcdName,PcdGuid)] =3D {DefaultSku.Def= aultValue:[DefaultSku]} >=20 > # Process VPD map file generated by third party BPDG too= l > if NeedProcessVpdMapFile: > VpdMapFilePath =3D os.path.join(self.BuildDir, TAB_F= V_DIRECTORY, "%s.map" % self.Platform.VpdToolGuid) > if os.path.exists(VpdMapFilePath): > @@ -1885,19 +1891,21 @@ class PlatformAutoGen(AutoGen): > @cached_property > def NonDynamicPcdDict(self): > return {(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):Pcd for Pcd in= self.NonDynamicPcdList} >=20 > ## Get list of non-dynamic PCDs > - @cached_property > + @property > def NonDynamicPcdList(self): > - self.CollectPlatformDynamicPcds() > + if not self._NonDynamicPcdList: > + self.CollectPlatformDynamicPcds() > return self._NonDynamicPcdList >=20 > ## Get list of dynamic PCDs > - @cached_property > + @property > def DynamicPcdList(self): > - self.CollectPlatformDynamicPcds() > + if not self._DynamicPcdList: > + self.CollectPlatformDynamicPcds() > return self._DynamicPcdList >=20 > ## Generate Token Number for all PCD > @cached_property > def PcdTokenNumber(self): > diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/So= urce/Python/Common/VpdInfoFile.py > index 3be0670e36..cebc1f7187 100644 > --- a/BaseTools/Source/Python/Common/VpdInfoFile.py > +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py > @@ -175,12 +175,12 @@ class VpdInfoFile: > EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Fa= il to parse VPD information file %s" % FilePath) >=20 > Found =3D False >=20 > if (TokenSpaceName, PcdTokenName) not in self._VpdInfo: > - self._VpdInfo[(TokenSpaceName, PcdTokenName)] =3D [] > - self._VpdInfo[(TokenSpaceName, PcdTokenName)].append((SkuId,= Offset, Value)) > + self._VpdInfo[(TokenSpaceName, PcdTokenName)] =3D {} > + self._VpdInfo[(TokenSpaceName, PcdTokenName)][(SkuId, Offset= )] =3D Value > for VpdObject in self._VpdArray: > VpdObjectTokenCName =3D VpdObject.TokenCName > for PcdItem in GlobalData.MixedPcd: > if (VpdObject.TokenCName, VpdObject.TokenSpaceGuidCN= ame) in GlobalData.MixedPcd[PcdItem]: > VpdObjectTokenCName =3D PcdItem[0] > @@ -217,11 +217,11 @@ class VpdInfoFile: > return None >=20 > return self._VpdArray[vpd] > def GetVpdInfo(self, arg): > (PcdTokenName, TokenSpaceName) =3D arg > - return self._VpdInfo.get((TokenSpaceName, PcdTokenName)) > + return [(sku,offset,value) for (sku,offset),value in self._VpdIn= fo.get((TokenSpaceName, PcdTokenName)).items()] >=20 > ## Call external BPDG tool to process VPD file > # > # @param ToolPath The string path name for BPDG tool > # @param VpdFileName The string path name for VPD information guid.tx= t > -- > 2.19.1.windows.1