public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override
@ 2019-09-05  9:45 Bob Feng
  2019-09-09  6:48 ` Liming Gao
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2019-09-05  9:45 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2157

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 <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 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] = 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 = PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore]
             if Setting is None:
                 continue
             VariableName, VariableGuid, VariableOffset, DefaultValue, VarAttribute = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
@@ -3081,11 +3081,11 @@ class DscBuildData(PlatformBuildClassObject):
                                                 IsDsc=True)
                 if (PcdCName, TokenSpaceGuid) in UserDefinedDefaultStores:
                     PcdClassObj.UserDefinedDefaultStoresFlag = True
                 Pcds[PcdCName, TokenSpaceGuid] = PcdClassObj
 
-                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = int(Dummy4)
+                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = index
             if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
                 Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
                 Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = {}
             Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][DefaultStore] = DefaultValue
             Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][DefaultStore] = (self.MetaFile.File,Dummy4)
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override
  2019-09-05  9:45 [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override Bob Feng
@ 2019-09-09  6:48 ` Liming Gao
  0 siblings, 0 replies; 2+ messages in thread
From: Liming Gao @ 2019-09-09  6:48 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Feng, Bob C
>Sent: Thursday, September 05, 2019 5:45 PM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
>Subject: [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2157
>
>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 <liming.gao@intel.com>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>---
> 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] =
>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 = PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceGuid,
>DefaultStore]
>             if Setting is None:
>                 continue
>             VariableName, VariableGuid, VariableOffset, DefaultValue,
>VarAttribute = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type,
>Dummy4)
>@@ -3081,11 +3081,11 @@ class DscBuildData(PlatformBuildClassObject):
>                                                 IsDsc=True)
>                 if (PcdCName, TokenSpaceGuid) in UserDefinedDefaultStores:
>                     PcdClassObj.UserDefinedDefaultStoresFlag = True
>                 Pcds[PcdCName, TokenSpaceGuid] = PcdClassObj
>
>-                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] =
>int(Dummy4)
>+                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] =
>index
>             if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
>                 Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
>                 Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = {}
>             Pcds[PcdCName,
>TokenSpaceGuid].DscRawValue[SkuName][DefaultStore] = DefaultValue
>             Pcds[PcdCName,
>TokenSpaceGuid].DscRawValueInfo[SkuName][DefaultStore] =
>(self.MetaFile.File,Dummy4)
>--
>2.20.1.windows.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-09  6:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-05  9:45 [Patch 1/1] BaseTools: Fix a bug for Hii Pcd override Bob Feng
2019-09-09  6:48 ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox