From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: liming.gao@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Sun, 08 Sep 2019 23:48:08 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Sep 2019 23:48:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,484,1559545200"; d="scan'208";a="199994934" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 08 Sep 2019 23:48:06 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 8 Sep 2019 23:48:06 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 8 Sep 2019 23:48:03 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 8 Sep 2019 23:48:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Mon, 9 Sep 2019 14:48:01 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" Subject: Re: [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override Thread-Topic: [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override Thread-Index: AQHVY86n8XbBFjRhrE+PSyGRs4c7qaci7WqA Date: Mon, 9 Sep 2019 06:48:00 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F48DF@SHSMSX104.ccr.corp.intel.com> References: <20190905094510.19080-1-bob.c.feng@intel.com> In-Reply-To: <20190905094510.19080-1-bob.c.feng@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 Return-Path: liming.gao@intel.com 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: Thursday, September 05, 2019 5:45 PM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Feng, Bob C >Subject: [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2157 > >Hii Pcd links to a efi variable. The Variable >default value is evaluated by related Hii Pcds >setting. If multiple Hii Pcds links to one variable, >and the offset overlap, the later Hii Pcds setting >should be effective. There is a tool bug that is if >the Pcds are in different dsc file which are included >into the platform dsc file, build tool does not get >the Pcds relative position correctly. That means >build tool does not know which Pcd is the later one. As >the result, the variable default value will be incorrect. > >This patch is to fix this bug. > >Cc: Liming Gao >Signed-off-by: Bob Feng >--- > BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index d2b5ccbb7a30..9192077f9064 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -3012,11 +3012,11 @@ class DscBuildData(PlatformBuildClassObject): > PcdList.append((PcdCName, TokenSpaceGuid, SkuName, >DefaultStore, Dummy5)) > PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore= ] =3D >Setting > > > # Remove redundant PCD candidates, per the ARCH and SKU >- for PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4 in >PcdList: >+ for index,(PcdCName, TokenSpaceGuid, SkuName, DefaultStore, >Dummy4) in enumerate(PcdList): > > Setting =3D PcdDict[self._Arch, SkuName, PcdCName, TokenSpace= Guid, >DefaultStore] > if Setting is None: > continue > VariableName, VariableGuid, VariableOffset, DefaultValue, >VarAttribute =3D self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type= , >Dummy4) >@@ -3081,11 +3081,11 @@ class DscBuildData(PlatformBuildClassObject): > IsDsc=3DTrue) > if (PcdCName, TokenSpaceGuid) in UserDefinedDefaultStores= : > PcdClassObj.UserDefinedDefaultStoresFlag =3D True > Pcds[PcdCName, TokenSpaceGuid] =3D PcdClassObj > >- Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPositi= on'] =3D >int(Dummy4) >+ Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPositi= on'] =3D >index > if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue: > Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] =3D {= } > Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = =3D {} > Pcds[PcdCName, >TokenSpaceGuid].DscRawValue[SkuName][DefaultStore] =3D DefaultValue > Pcds[PcdCName, >TokenSpaceGuid].DscRawValueInfo[SkuName][DefaultStore] =3D >(self.MetaFile.File,Dummy4) >-- >2.20.1.windows.1