[edk2] [PATCH] UefiCpuPkg: Fix comment typo for MtrrLibApplyFixedMtrrs function

2017-12-26 Thread Song, BinX
Fix comment typo for MtrrLibApplyFixedMtrrs function

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c 
b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index 619b500..f37b740 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -1683,7 +1683,7 @@ MtrrLibCalculateMtrrs (
 
 
 /**
-  Apply the variable MTRR settings to memory range array.
+  Apply the fixed MTRR settings to memory range array.
 
   @param Fixed The fixed MTRR settings.
   @param RangesReturn the memory range array holding memory type
-- 
2.10.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory

2017-12-26 Thread Udit Kumar
Hi Vladimir
How re-allocation or say drivers are dispatched on your system. 
Could you check addresses, where FV is kept and where this is getting 
dispatched 

Thx 
Udit

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Vladimir Olovyannikov
> Sent: Wednesday, December 27, 2017 3:22 AM
> To: Ard Biesheuvel ; edk2-devel@lists.01.org
> Cc: leif.lindh...@linaro.org
> Subject: Re: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't
> reserve primary FV in memory
> 
> Hi Ard, Meenakshi,
> 
> I am having a problem I cannot explain the reason for, with this commit on
> an ARM64 platform.
> 
>ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory
> 
> Now that PrePi no longer exposes its internal code via special HOBs,
> we can remove the special handling of the primary FV, which needed to
> be reserved so that DXE core could call into the PE/COFF and LZMA
> libraries in the PrePi module.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Udit Kumar 
> Signed-off-by: Meenakshi Aggarwal 
> [ardb: updated commit log]
> Signed-off-by: Ard Biesheuvel 
> Reviewed-by: Leif Lindholm 
> 
> If a Shell is built "as is" from the source tree, there are no issues.
> However, if I slightly modify Shell.c like in the following patch:
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index 577e17311bea..bbbdde8ced96 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -339,6 +339,11 @@ UefiMain (
>EFI_HANDLE  ConInHandle;
>EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *OldConIn;
>SPLIT_LIST  *Split;
> +  CHAR16  *DelayStr;
> +  CHAR16  *NoMapStr;
> +  UINTN   DelayVarSize;
> +  UINTN   NoMapVarSize;
> +  BOOLEAN SilentStart;
> 
>if (PcdGet8(PcdShellSupportLevel) > 3) {
>  return (EFI_UNSUPPORTED);
> @@ -360,6 +365,7 @@ UefiMain (
>ShellInfoObject.PageBreakEnabled=
> PcdGetBool(PcdShellPageBreakDefault);
>ShellInfoObject.ViewingSettings.InsertMode  =
> PcdGetBool(PcdShellInsertModeDefault);
>ShellInfoObject.LogScreenCount  = PcdGet8
> (PcdShellScreenLogCount  );
> +  SilentStart = FALSE;
> 
>//
>// verify we dont allow for spec violation @@ -452,6 +458,21 @@ UefiMain
> (
>goto FreeResources;
>  }
> 
> +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay) {
> +  // Command line has priority over the variable
> +  Status = ShellFindEnvVarInList(L"startupdelay", ,
> , NULL);
> +  if (!EFI_ERROR (Status)) {
> +ShellInfoObject.ShellInitSettings.Delay = ShellStrToUintn
> (DelayStr);
> +  }
> +}
> +
> +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
> +  Status = ShellFindEnvVarInList(L"silentstart", ,
> , NULL);
> +  if (!EFI_ERROR (Status)) {
> +SilentStart = (BOOLEAN)ShellStrToUintn (NoMapStr);
> +  }
> +}
> +
>  //
>  // If shell support level is >= 1 create the mappings and paths
>  //
> @@ -492,7 +513,7 @@ UefiMain (
>  //
>  // Display the version
>  //
> -if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion) {
> +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion &&
> !SilentStart) {
>  ShellPrintHiiEx (
>0,
>gST->ConOut->Mode->CursorRow, @@ -529,7 +550,7 @@ UefiMain (
>  //
>  // Display the mapping
>  //
> -if (PcdGet8(PcdShellSupportLevel) >= 2 &&
> !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
> +if (PcdGet8(PcdShellSupportLevel) >= 2 &&
> !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap && !SilentStart) {
>Status = RunCommand(L"map");
>ASSERT_EFI_ERROR(Status);
>  }
> 
> Shell fails to load.
> Here is an excerpt from the debug log:
> 
> add-symbol-file
> /uefi/Build/StingrayPkg/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/
> Shel
> l/DEBUG/Shell.dll 0x8848
> Loading driver at 0x0008847F000 EntryPoint=0x0008848 Shell.efi
> InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 8D095118
> ProtectUefiImageCommon - 0x8D08ED40
>   - 0x8847F000 - 0x00152000
> SetUefiImageMemoryAttributes - 0x8847F000 -
> 0x1000
> (0x4008)
> SetUefiImageMemoryAttributes - 0x8848 -
> 0x000E6000
> (0x00020008)
> SetUefiImageMemoryAttributes - 0x88566000 -
> 0x0006B000
> (0x4008)
> InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8D088920
> InstallProtocolInterface: 

Re: [edk2] [PATCH] UefiCpuPkg: Update AESNI support checking logic

2017-12-26 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: Song, BinX 
Sent: Monday, December 25, 2017 11:11 AM
To: edk2-devel@lists.01.org
Cc: Dong, Eric ; ler...@redhat.com
Subject: [PATCH] UefiCpuPkg: Update AESNI support checking logic

With correct model CPU, current checking logic will always execute AsmReadMsr64 
operation and then check ECX.AESNI[bit 25] = 1. Update checking logic to check 
ECX.AESNI[bit 25] = 1 first and then do AsmReadMsr64 operation.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
index 880f092..56b1b55 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
@@ -62,15 +62,17 @@ AesniSupport (
 {
   MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER   *MsrFeatureConfig;
 
-  if (IS_SANDY_BRIDGE_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
-  IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) 
||
-  IS_XEON_5600_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-  IS_XEON_E7_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-  IS_XEON_PHI_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {
-MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) ConfigData;
-ASSERT (MsrFeatureConfig != NULL);
-MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 
(MSR_SANDY_BRIDGE_FEATURE_CONFIG);
-return (CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI == 1);
+  if (CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI == 1) {
+if (IS_SANDY_BRIDGE_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
+IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
+IS_XEON_5600_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) 
||
+IS_XEON_E7_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
+IS_XEON_PHI_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) 
{
+  MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) 
ConfigData;
+  ASSERT (MsrFeatureConfig != NULL);
+  MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 
(MSR_SANDY_BRIDGE_FEATURE_CONFIG);
+}
+return TRUE;
   }
   return FALSE;
 }
--
2.10.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] UefiCpuPkg: Delete redundant PcdGetSize PcdCpuFeaturesSupport

2017-12-26 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: Song, BinX 
Sent: Thursday, December 21, 2017 8:01 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric ; ler...@redhat.com
Subject: [PATCH] UefiCpuPkg: Delete redundant PcdGetSize PcdCpuFeaturesSupport

When CpuCommonFeaturesLib use RegisterCpuFeaturesLib to register CPU features, 
the CpuFeaturesData->BitMaskSize has already been initialized. So delete 
redundant PcdGetSize PcdCpuFeaturesSupport in CpuInitDataInitialize.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index b8f76f1..2fbde34 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -149,7 +149,6 @@ CpuInitDataInitialize (
   CpuFeaturesData = GetCpuFeaturesData ();
   CpuFeaturesData->InitOrder = AllocateZeroPool (sizeof 
(CPU_FEATURES_INIT_ORDER) * NumberOfCpus);
   ASSERT (CpuFeaturesData->InitOrder != NULL);
-  CpuFeaturesData->BitMaskSize = (UINT32) PcdGetSize (PcdCpuFeaturesSupport);
 
   //
   // Collect CPU Features information
--
2.10.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Fix Sku inherit issue.

2017-12-26 Thread BobCF
The final Pcd value should only be override by its parents.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C 
Reviewed-by: Liming Gao 
---
 BaseTools/Source/Python/Common/Misc.py| 2 ++
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 0374be0631..dc214dbfa8 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -2198,10 +2198,12 @@ class SkuClass():
 for item in self.SkuData.values():
 self.__SkuInherit[item[1]]=item[2] if item[2] else "DEFAULT"
 return self.__SkuInherit.get(skuname,"DEFAULT")
 
 def GetSkuChain(self,sku):
+if sku == "DEFAULT":
+return ["DEFAULT"]
 skulist = [sku]
 nextsku = sku
 while 1:
 nextsku = self.GetNextSkuId(nextsku)
 skulist.append(nextsku)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 929c317957..5e052eca7c 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1319,11 +1319,11 @@ class DscBuildData(PlatformBuildClassObject):
 FieldName = FieldName.split(']', 1)[1]
 FieldName = NewFieldName + FieldName
 while '[' in FieldName:
 FieldName = FieldName.rsplit('[', 1)[0]
 CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, 
%d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
-for skuname in self.SkuIdMgr.SkuOverrideOrder():
+for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
 for FieldList in 
[inherit_OverrideValues.get(DefaultStoreName)]:
 if not FieldList:
 continue
 for FieldName in FieldList:
@@ -1383,11 +1383,11 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 if ValueSize > 4:
 CApp = CApp + '  Pcd->%s = %dULL; // From %s Line 
%d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], 
FieldList[FieldName][2], FieldList[FieldName][0])
 else:
 CApp = CApp + '  Pcd->%s = %d; // From %s Line %d 
Value %s\n' % (FieldName, Value, FieldList[FieldName][1], 
FieldList[FieldName][2], FieldList[FieldName][0])
-for skuname in self.SkuIdMgr.SkuOverrideOrder():
+for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
 for FieldList in 
[Pcd.DefaultFromDSC,inherit_OverrideValues.get(DefaultStoreName)]:
 if not FieldList:
 continue
 if Pcd.DefaultFromDSC and FieldList == Pcd.DefaultFromDSC:
-- 
2.14.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList

2017-12-26 Thread BobCF
'COMMON' is an alias of 'DEFAULT' for internal code, 
it should be removed before generating Pcd DataBase.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index e4f3586654..929c317957 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1706,12 +1706,11 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 return False
 def CompletePcdValues(self,PcdSet):
 Pcds = {}
 DefaultStoreObj = DefaultStore(self._GetDefaultStores())
-SkuIds = set([(skuid,skuobj.SkuId) for pcdobj in PcdSet.values() for 
skuid,skuobj in pcdobj.SkuInfoList.items()])
-SkuIds = self.SkuIdMgr.AvailableSkuIdSet
+SkuIds = {skuname:skuid for skuname,skuid in 
self.SkuIdMgr.AvailableSkuIdSet.items() if skuname !='COMMON'}
 DefaultStores = set([storename for pcdobj in PcdSet.values() for 
skuobj in pcdobj.SkuInfoList.values() for storename in 
skuobj.DefaultStoreDict.keys()])
 for PcdCName, TokenSpaceGuid in PcdSet:
 PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
 if PcdObj.Type not in 
[self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_DEFAULT],
 self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
-- 
2.14.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Support PCD flexible values format

2017-12-26 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Wednesday, December 27, 2017 1:24 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, YunhuaX 
>Subject: [edk2] [Patch] BaseTools: Support PCD flexible values format
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=541
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yunhua Feng 
>Signed-off-by: Yonghong Zhu 
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py |  39 
> BaseTools/Source/Python/AutoGen/GenC.py|   2 +
> BaseTools/Source/Python/Common/Expression.py   | 246
>-
> BaseTools/Source/Python/Common/Misc.py | 203 +
> BaseTools/Source/Python/Workspace/DscBuildData.py  |  16 +-
> BaseTools/Source/Python/Workspace/InfBuildData.py  |   7 +
> .../Source/Python/Workspace/MetaFileParser.py  |  17 +-
> .../Source/Python/Workspace/WorkspaceCommon.py |   8 +-
> BaseTools/Source/Python/build/BuildReport.py   |   6 +
> 9 files changed, 430 insertions(+), 114 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index cacd009..8be5bfc 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -269,10 +269,11 @@ class WorkspaceAutoGen(AutoGen):
> self.AutoGenObjectList = []
> self._BuildDir  = None
> self._FvDir = None
> self._MakeFileDir   = None
> self._BuildCommand  = None
>+self._GuidDict = {}
>
> # there's many relative directory operations, so ...
> os.chdir(self.WorkspaceDir)
>
> #
>@@ -417,24 +418,42 @@ class WorkspaceAutoGen(AutoGen):
> TokenSpaceGuidCNameList = []
> FoundFlag = False
> PcdDatumType = ''
> NewValue = ''
> for package in PGen.PackageList:
>+Guids = package.Guids
>+self._GuidDict.update(Guids)
>+for package in PGen.PackageList:
> for key in package.Pcds:
> PcdItem = package.Pcds[key]
> if HasTokenSpace:
> if (PcdItem.TokenCName, 
> PcdItem.TokenSpaceGuidCName)
>== (TokenCName, TokenSpaceGuidCName):
> PcdDatumType = PcdItem.DatumType
>+if pcdvalue.startswith('H'):
>+try:
>+pcdvalue = 
>ValueExpressionEx(pcdvalue[1:],
>PcdDatumType, self._GuidDict)(True)
>+except BadExpression, Value:
>+if Value.result > 1:
>+EdkLogger.error('Parser', 
>FORMAT_INVALID, 'PCD
>[%s.%s] Value "%s",  %s' %
>+
>(TokenSpaceGuidCName, TokenCName,
>pcdvalue, Value))
>+pcdvalue = 'H' + pcdvalue
> NewValue =
>BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName,
>PcdDatumType, pcdvalue)
> FoundFlag = True
> else:
> if PcdItem.TokenCName == TokenCName:
> if not PcdItem.TokenSpaceGuidCName in
>TokenSpaceGuidCNameList:
> if len (TokenSpaceGuidCNameList) < 1:
>
>TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName)
> PcdDatumType = PcdItem.DatumType
> TokenSpaceGuidCName =
>PcdItem.TokenSpaceGuidCName
>+if pcdvalue.startswith('H'):
>+try:
>+pcdvalue = 
>ValueExpressionEx(pcdvalue[1:],
>PcdDatumType, self._GuidDict)(True)
>+except BadExpression, Value:
>+EdkLogger.error('Parser', 
>FORMAT_INVALID, 'PCD
>[%s.%s] Value "%s", %s' %
>+
>(TokenSpaceGuidCName, TokenCName,
>pcdvalue, Value))
>+pcdvalue = 'H' + pcdvalue
> NewValue =
>BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName,
>PcdDatumType, pcdvalue)
> FoundFlag = True
> else:
>

[edk2] [Patch] BaseTools: Support PCD flexible values format

2017-12-26 Thread Yonghong Zhu
https://bugzilla.tianocore.org/show_bug.cgi?id=541

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py |  39 
 BaseTools/Source/Python/AutoGen/GenC.py|   2 +
 BaseTools/Source/Python/Common/Expression.py   | 246 -
 BaseTools/Source/Python/Common/Misc.py | 203 +
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  16 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py  |   7 +
 .../Source/Python/Workspace/MetaFileParser.py  |  17 +-
 .../Source/Python/Workspace/WorkspaceCommon.py |   8 +-
 BaseTools/Source/Python/build/BuildReport.py   |   6 +
 9 files changed, 430 insertions(+), 114 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index cacd009..8be5bfc 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -269,10 +269,11 @@ class WorkspaceAutoGen(AutoGen):
 self.AutoGenObjectList = []
 self._BuildDir  = None
 self._FvDir = None
 self._MakeFileDir   = None
 self._BuildCommand  = None
+self._GuidDict = {}
 
 # there's many relative directory operations, so ...
 os.chdir(self.WorkspaceDir)
 
 #
@@ -417,24 +418,42 @@ class WorkspaceAutoGen(AutoGen):
 TokenSpaceGuidCNameList = []
 FoundFlag = False
 PcdDatumType = ''
 NewValue = ''
 for package in PGen.PackageList:
+Guids = package.Guids
+self._GuidDict.update(Guids)
+for package in PGen.PackageList:
 for key in package.Pcds:
 PcdItem = package.Pcds[key]
 if HasTokenSpace:
 if (PcdItem.TokenCName, 
PcdItem.TokenSpaceGuidCName) == (TokenCName, TokenSpaceGuidCName):
 PcdDatumType = PcdItem.DatumType
+if pcdvalue.startswith('H'):
+try:
+pcdvalue = 
ValueExpressionEx(pcdvalue[1:], PcdDatumType, self._GuidDict)(True)
+except BadExpression, Value:
+if Value.result > 1:
+EdkLogger.error('Parser', 
FORMAT_INVALID, 'PCD [%s.%s] Value "%s",  %s' %
+
(TokenSpaceGuidCName, TokenCName, pcdvalue, Value))
+pcdvalue = 'H' + pcdvalue
 NewValue = 
BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, 
pcdvalue)
 FoundFlag = True
 else:
 if PcdItem.TokenCName == TokenCName:
 if not PcdItem.TokenSpaceGuidCName in 
TokenSpaceGuidCNameList:
 if len (TokenSpaceGuidCNameList) < 1:
 
TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName)
 PcdDatumType = PcdItem.DatumType
 TokenSpaceGuidCName = 
PcdItem.TokenSpaceGuidCName
+if pcdvalue.startswith('H'):
+try:
+pcdvalue = 
ValueExpressionEx(pcdvalue[1:], PcdDatumType, self._GuidDict)(True)
+except BadExpression, Value:
+EdkLogger.error('Parser', 
FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %
+
(TokenSpaceGuidCName, TokenCName, pcdvalue, Value))
+pcdvalue = 'H' + pcdvalue
 NewValue = 
BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, 
pcdvalue)
 FoundFlag = True
 else:
 EdkLogger.error(
 'build',
@@ -2444,10 +2463,30 @@ class PlatformAutoGen(AutoGen):
 ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
 if FromPcd.DatumType not in [None, '']:
 ToPcd.DatumType = FromPcd.DatumType
 if FromPcd.SkuInfoList not in [None, '', []]:
 

Re: [edk2] [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer reference

2017-12-26 Thread Zeng, Star
Could you add more information about this patch between 
14b351e2ed8586f144dd3cd2e0a25082c1a32837?

With that, Reviewed-by: Star Zeng 


Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Wednesday, December 27, 2017 10:31 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer 
reference

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index c10134b8e6..e062094f79 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -845,7 +845,7 @@ UpdateDefaultSettingInFormPackage (
 //
 EfiVarStoreList   = ReallocatePool (EfiVarStoreMaxNum * sizeof 
(UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
 if (EfiVarStoreList == NULL) {
-  break;
+  goto Done;
 }
 EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
   }
@@ -874,7 +874,7 @@ UpdateDefaultSettingInFormPackage (
 //
 DefaultIdList   = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), 
(DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
 if (DefaultIdList == NULL) {
-  break;
+  goto Done;
 }
 DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
   }
@@ -1046,8 +1046,10 @@ UpdateDefaultSettingInFormPackage (
   }
 
 Done:
-  for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
-FreePool (EfiVarStoreList [Index]);
+  if (EfiVarStoreList != NULL) { 
+for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
+  FreePool (EfiVarStoreList [Index]);
+}
   }
   return;
 }
-- 
2.11.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg Variable: Update expression to directly use boolean type value

2017-12-26 Thread Zeng, Star
The title seems too long.
How about updating the title to be "MdeModulePkg Variable: Use boolean type 
value instead of expression"

With the update, Reviewed-by: Star Zeng 


Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Wednesday, December 27, 2017 12:54 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch] MdeModulePkg Variable: Update expression to directly 
use boolean type value

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 2632211..c11842b 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4210,7 +4210,7 @@ VariableCommonInitialize (
 VariableStoreHeader = GET_GUID_HOB_DATA (GuidHob);
 VariableStoreLength = GuidHob->Header.HobLength - sizeof 
(EFI_HOB_GUID_TYPE);
 if (GetVariableStoreStatus (VariableStoreHeader) == EfiValid) {
-  if (IsNormalVariableHob == FALSE) {
+  if (!IsNormalVariableHob) {
 mVariableModuleGlobal->VariableGlobal.HobVariableBase = 
(EFI_PHYSICAL_ADDRESS) (UINTN) AllocateRuntimeCopyPool ((UINTN) 
VariableStoreLength, (VOID *) VariableStoreHeader);
   } else {
 mVariableModuleGlobal->VariableGlobal.HobVariableBase = 
(EFI_PHYSICAL_ADDRESS) (UINTN) ConvertNormalVarStorageToAuthVarStorage ((VOID 
*) VariableStoreHeader);
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg Variable: Update expression to directly use boolean type value

2017-12-26 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 2632211..c11842b 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4210,7 +4210,7 @@ VariableCommonInitialize (
 VariableStoreHeader = GET_GUID_HOB_DATA (GuidHob);
 VariableStoreLength = GuidHob->Header.HobLength - sizeof 
(EFI_HOB_GUID_TYPE);
 if (GetVariableStoreStatus (VariableStoreHeader) == EfiValid) {
-  if (IsNormalVariableHob == FALSE) {
+  if (!IsNormalVariableHob) {
 mVariableModuleGlobal->VariableGlobal.HobVariableBase = 
(EFI_PHYSICAL_ADDRESS) (UINTN) AllocateRuntimeCopyPool ((UINTN) 
VariableStoreLength, (VOID *) VariableStoreHeader);
   } else {
 mVariableModuleGlobal->VariableGlobal.HobVariableBase = 
(EFI_PHYSICAL_ADDRESS) (UINTN) ConvertNormalVarStorageToAuthVarStorage ((VOID 
*) VariableStoreHeader);
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/IScsiDxe: Correct the DnsMode value according the target info.

2017-12-26 Thread Ye, Ting
Reviewed-by: Ye Ting  

-Original Message-
From: Wu, Jiaxin 
Sent: Monday, December 25, 2017 1:30 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Karunakar P 
; Wu, Jiaxin 
Subject: [Patch] NetworkPkg/IScsiDxe: Correct the DnsMode value according the 
target info.

This patch is to resolve the issue recorded @ 
https://bugzilla.tianocore.org/show_bug.cgi?id=823.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Karunakar P 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
Tested-by: Karunakar P 
---
 NetworkPkg/IScsiDxe/IScsiDhcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c b/NetworkPkg/IScsiDxe/IScsiDhcp.c 
index e6f6972..e343523 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp.c
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c
@@ -132,10 +132,11 @@ IScsiDhcpExtractRootPath (
   return EFI_INVALID_PARAMETER;
 }
 CopyMem (>TargetUrl, Field->Str, Field->Len);
 ConfigNvData->TargetUrl[Field->Len + 1] = '\0';
   } else {
+ConfigNvData->DnsMode = FALSE;
 ZeroMem(ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl));
 Status = IScsiAsciiStrToIp (Field->Str, IpMode, );
 CopyMem (>TargetIp, , sizeof (EFI_IP_ADDRESS));
 
 if (EFI_ERROR (Status)) {
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release version.

2017-12-26 Thread Ye, Ting

Reviewed-by: Ye Ting  

-Original Message-
From: Wu, Jiaxin 
Sent: Tuesday, December 26, 2017 2:50 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wang, Fan 
; Wu, Jiaxin 
Subject: [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release version.

TCP payload check is implemented by TcpVerifySegment(), but all the function 
calls of TcpVerifySegment() are placed in ASSERT(), which is only valid for 
debug version:
  ASSERT (TcpVerifySegment (Nbuf) != 0);

This patch is to enable the check for release version.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Wang Fan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/TcpDxe/TcpInput.c  | 125 +-
 NetworkPkg/TcpDxe/TcpOutput.c |  29 +++---
 2 files changed, 122 insertions(+), 32 deletions(-)

diff --git a/NetworkPkg/TcpDxe/TcpInput.c b/NetworkPkg/TcpDxe/TcpInput.c index 
f8845dc..92a0ab8 100644
--- a/NetworkPkg/TcpDxe/TcpInput.c
+++ b/NetworkPkg/TcpDxe/TcpInput.c
@@ -279,12 +279,15 @@ TcpComputeRtt (
 
   @param[in]  Nbuf The buffer that contains a received TCP segment without 
an IP header.
   @param[in]  Left The sequence number of the window's left edge.
   @param[in]  RightThe sequence number of the window's right edge.
 
+  @retval 0The segment is broken.
+  @retval 1The segment is in good shape.
+
 **/
-VOID
+INTN
 TcpTrimSegment (
   IN NET_BUF   *Nbuf,
   IN TCP_SEQNO Left,
   IN TCP_SEQNO Right
   )
@@ -304,11 +307,11 @@ TcpTrimSegment (
 TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_SYN);
 TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_FIN);
 
 Seg->Seq = Seg->End;
 NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);
-return;
+return 1;
   }
 
   //
   // Adjust the buffer header
   //
@@ -357,27 +360,30 @@ TcpTrimSegment (
 if (Drop != 0) {
   NetbufTrim (Nbuf, Drop, NET_BUF_TAIL);
 }
   }
 
-  ASSERT (TcpVerifySegment (Nbuf) != 0);
+  return TcpVerifySegment (Nbuf);
 }
 
 /**
   Trim off the data outside the tcb's receive window.
 
   @param[in]  Tcb  Pointer to the TCP_CB of this TCP instance.
   @param[in]  Nbuf Pointer to the NET_BUF containing the received tcp 
segment.
 
+  @retval 0The segment is broken.
+  @retval 1The segment is in good shape.
+
 **/
-VOID
+INTN
 TcpTrimInWnd (
   IN TCP_CB  *Tcb,
   IN NET_BUF *Nbuf
   )
 {
-  TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
+  return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
 }
 
 /**
   Process the data and FIN flag, and check whether to deliver
   data to the socket layer.
@@ -419,11 +425,20 @@ TcpDeliverData (
 
   while (Entry != >RcvQue) {
 Nbuf  = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
 Seg   = TCPSEG_NETBUF (Nbuf);
 
-ASSERT (TcpVerifySegment (Nbuf) != 0);
+if (TcpVerifySegment (Nbuf) == 0) {
+  DEBUG (
+(EFI_D_ERROR,
+"TcpToSendData: discard a broken segment for TCB %p\n",
+Tcb)
+);
+  NetbufFree (Nbuf);
+  return -1;
+}
+
 ASSERT (Nbuf->Tcp == NULL);
 
 if (TCP_SEQ_GT (Seg->Seq, Seq)) {
   break;
 }
@@ -559,12 +574,15 @@ TcpDeliverData (
   Store the data into the reassemble queue.
 
   @param[in, out]  Tcb   Pointer to the TCP_CB of this TCP instance.
   @param[in]   Nbuf  Pointer to the buffer containing the data to be 
queued.
 
+  @retval  0 An error condition occurred.
+  @retval  1 No error occurred to queue data.
+
 **/
-VOID
+INTN
 TcpQueueData (
   IN OUT TCP_CB  *Tcb,
   IN NET_BUF *Nbuf
   )
 {
@@ -586,11 +604,11 @@ TcpQueueData (
   // no out-of-order segments are received.
   //
   if (IsListEmpty (Head)) {
 
 InsertTailList (Head, >List);
-return;
+return 1;
   }
 
   //
   // Find the point to insert the buffer
   //
@@ -613,16 +631,16 @@ TcpQueueData (
 Node = NET_LIST_USER_STRUCT (Prev, NET_BUF, List);
 
 if (TCP_SEQ_LT (Seg->Seq, TCPSEG_NETBUF (Node)->End)) {
 
   if (TCP_SEQ_LEQ (Seg->End, TCPSEG_NETBUF (Node)->End)) {
-
-NetbufFree (Nbuf);
-return;
+return 1;
   }
 
-  TcpTrimSegment (Nbuf, TCPSEG_NETBUF (Node)->End, Seg->End);
+  if (TcpTrimSegment (Nbuf, TCPSEG_NETBUF (Node)->End, Seg->End) == 0) {
+return 0;
+  }
 }
   }
 
   InsertHeadList (Prev, >List);
 
@@ -646,31 +664,38 @@ TcpQueueData (
 if (TCP_SEQ_LT (TCPSEG_NETBUF (Node)->Seq, Seg->End)) {
 
   if (TCP_SEQ_LEQ (TCPSEG_NETBUF (Node)->Seq, Seg->Seq)) {
 
 RemoveEntryList (>List);
-NetbufFree (Nbuf);
-return;
+return 1;
   }
 
-  TcpTrimSegment (Nbuf, Seg->Seq, TCPSEG_NETBUF (Node)->Seq);
+  if (TcpTrimSegment (Nbuf, Seg->Seq, TCPSEG_NETBUF (Node)->Seq) == 0) {
+  

Re: [edk2] [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release version.

2017-12-26 Thread Fu, Siyuan
Hi, Jiaxin

I think it's better to return a Boolean type than int 0-1 value in 
TcpTrimSegment().
Other part of good to me.


Reviewed-by: Fu Siyuan 



> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, December 26, 2017 2:50 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wang,
> Fan ; Wu, Jiaxin 
> Subject: [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release
> version.
> 
> TCP payload check is implemented by TcpVerifySegment(), but all the
> function
> calls of TcpVerifySegment() are placed in ASSERT(), which is only valid
> for
> debug version:
>   ASSERT (TcpVerifySegment (Nbuf) != 0);
> 
> This patch is to enable the check for release version.
> 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Cc: Wang Fan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/TcpDxe/TcpInput.c  | 125 +
> -
>  NetworkPkg/TcpDxe/TcpOutput.c |  29 +++---
>  2 files changed, 122 insertions(+), 32 deletions(-)
> 
> diff --git a/NetworkPkg/TcpDxe/TcpInput.c b/NetworkPkg/TcpDxe/TcpInput.c
> index f8845dc..92a0ab8 100644
> --- a/NetworkPkg/TcpDxe/TcpInput.c
> +++ b/NetworkPkg/TcpDxe/TcpInput.c
> @@ -279,12 +279,15 @@ TcpComputeRtt (
> 
>@param[in]  Nbuf The buffer that contains a received TCP segment
> without an IP header.
>@param[in]  Left The sequence number of the window's left edge.
>@param[in]  RightThe sequence number of the window's right edge.
> 
> +  @retval 0The segment is broken.
> +  @retval 1The segment is in good shape.
> +
>  **/
> -VOID
> +INTN
>  TcpTrimSegment (
>IN NET_BUF   *Nbuf,
>IN TCP_SEQNO Left,
>IN TCP_SEQNO Right
>)
> @@ -304,11 +307,11 @@ TcpTrimSegment (
>  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_SYN);
>  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_FIN);
> 
>  Seg->Seq = Seg->End;
>  NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);
> -return;
> +return 1;
>}
> 
>//
>// Adjust the buffer header
>//
> @@ -357,27 +360,30 @@ TcpTrimSegment (
>  if (Drop != 0) {
>NetbufTrim (Nbuf, Drop, NET_BUF_TAIL);
>  }
>}
> 
> -  ASSERT (TcpVerifySegment (Nbuf) != 0);
> +  return TcpVerifySegment (Nbuf);
>  }
> 
>  /**
>Trim off the data outside the tcb's receive window.
> 
>@param[in]  Tcb  Pointer to the TCP_CB of this TCP instance.
>@param[in]  Nbuf Pointer to the NET_BUF containing the received tcp
> segment.
> 
> +  @retval 0The segment is broken.
> +  @retval 1The segment is in good shape.
> +
>  **/
> -VOID
> +INTN
>  TcpTrimInWnd (
>IN TCP_CB  *Tcb,
>IN NET_BUF *Nbuf
>)
>  {
> -  TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
> +  return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
>  }
> 
>  /**
>Process the data and FIN flag, and check whether to deliver
>data to the socket layer.
> @@ -419,11 +425,20 @@ TcpDeliverData (
> 
>while (Entry != >RcvQue) {
>  Nbuf  = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
>  Seg   = TCPSEG_NETBUF (Nbuf);
> 
> -ASSERT (TcpVerifySegment (Nbuf) != 0);
> +if (TcpVerifySegment (Nbuf) == 0) {
> +  DEBUG (
> +(EFI_D_ERROR,
> +"TcpToSendData: discard a broken segment for TCB %p\n",
> +Tcb)
> +);
> +  NetbufFree (Nbuf);
> +  return -1;
> +}
> +
>  ASSERT (Nbuf->Tcp == NULL);
> 
>  if (TCP_SEQ_GT (Seg->Seq, Seq)) {
>break;
>  }
> @@ -559,12 +574,15 @@ TcpDeliverData (
>Store the data into the reassemble queue.
> 
>@param[in, out]  Tcb   Pointer to the TCP_CB of this TCP instance.
>@param[in]   Nbuf  Pointer to the buffer containing the data to be
> queued.
> 
> +  @retval  0 An error condition occurred.
> +  @retval  1 No error occurred to queue data.
> +
>  **/
> -VOID
> +INTN
>  TcpQueueData (
>IN OUT TCP_CB  *Tcb,
>IN NET_BUF *Nbuf
>)
>  {
> @@ -586,11 +604,11 @@ TcpQueueData (
>// no out-of-order segments are received.
>//
>if (IsListEmpty (Head)) {
> 
>  InsertTailList (Head, >List);
> -return;
> +return 1;
>}
> 
>//
>// Find the point to insert the buffer
>//
> @@ -613,16 +631,16 @@ TcpQueueData (
>  Node = NET_LIST_USER_STRUCT (Prev, NET_BUF, List);
> 
>  if (TCP_SEQ_LT (Seg->Seq, TCPSEG_NETBUF (Node)->End)) {
> 
>if (TCP_SEQ_LEQ (Seg->End, TCPSEG_NETBUF (Node)->End)) {
> -
> -NetbufFree (Nbuf);
> -return;
> +return 1;
>}
> 
> -  TcpTrimSegment (Nbuf, TCPSEG_NETBUF (Node)->End, Seg->End);
> +  if (TcpTrimSegment (Nbuf, TCPSEG_NETBUF (Node)->End, Seg->End) == 0)
> {
> +return 0;
> +  }
>  }
>}
> 
>

Re: [edk2] [Patch] NetworkPkg/IScsiDxe: Correct the DnsMode value according the target info.

2017-12-26 Thread Wu, Jiaxin
Thanks, Siyuan I will refine the commit log before apply the patch.

> -Original Message-
> From: Fu, Siyuan
> Sent: Wednesday, December 27, 2017 11:01 AM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Ye, Ting ; Karunakar P 
> Subject: RE: [Patch] NetworkPkg/IScsiDxe: Correct the DnsMode value
> according the target info.
> 
> Reviewed-by: Fu Siyuan 
> Please provide more information in the commit log.
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Monday, December 25, 2017 1:30 PM
> > To: edk2-devel@lists.01.org
> > Cc: Ye, Ting ; Fu, Siyuan ;
> > Karunakar P ; Wu, Jiaxin
> 
> > Subject: [Patch] NetworkPkg/IScsiDxe: Correct the DnsMode value
> according
> > the target info.
> >
> > This patch is to resolve the issue recorded @
> > https://bugzilla.tianocore.org/show_bug.cgi?id=823.
> >
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Cc: Karunakar P 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Wu Jiaxin 
> > Tested-by: Karunakar P 
> > ---
> >  NetworkPkg/IScsiDxe/IScsiDhcp.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> > b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> > index e6f6972..e343523 100644
> > --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> > +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> > @@ -132,10 +132,11 @@ IScsiDhcpExtractRootPath (
> >return EFI_INVALID_PARAMETER;
> >  }
> >  CopyMem (>TargetUrl, Field->Str, Field->Len);
> >  ConfigNvData->TargetUrl[Field->Len + 1] = '\0';
> >} else {
> > +ConfigNvData->DnsMode = FALSE;
> >  ZeroMem(ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl));
> >  Status = IScsiAsciiStrToIp (Field->Str, IpMode, );
> >  CopyMem (>TargetIp, , sizeof (EFI_IP_ADDRESS));
> >
> >  if (EFI_ERROR (Status)) {
> > --
> > 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Add Platform Override Build Options for PcdValueInit

2017-12-26 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Tuesday, December 26, 2017 4:53 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Add Platform Override Build Options for
>PcdValueInit
>
>Add Platform's CC_FLAGS /D option for PcdValueInit generation.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu 
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 77
>+--
> 1 file changed, 73 insertions(+), 4 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 135b608..9262650 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -21,11 +21,12 @@ from Common.String import *
> from Common.DataType import *
> from Common.Misc import *
> from types import *
>
> from CommonDataClass.CommonClass import SkuInfoClass
>-
>+from Common.TargetTxtClassObject import *
>+from Common.ToolDefClassObject import *
> from MetaDataTable import *
> from MetaFileTable import *
> from MetaFileParser import *
>
> from WorkspaceCommon import GetDeclaredPcd
>@@ -75,15 +76,15 @@ PcdMakefileHeader = '''
> # This file is auto-generated by build utility
> #
>
> '''
>
>+WindowsCFLAGS = 'CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101 '
>+LinuxCFLAGS = 'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-
>variable '
> PcdMakefileEnd = '''
> !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common
>
>-CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101
>-
> LIBS = $(LIB_PATH)\Common.lib
>
> !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app
> '''
>
>@@ -150,10 +151,11 @@ class DscBuildData(PlatformBuildClassObject):
> self._RawData = RawData
> self._Bdb = BuildDataBase
> self._Arch = Arch
> self._Target = Target
> self._Toolchain = Toolchain
>+self._ToolChainFamily = None
> self._Clear()
> self._HandleOverridePath()
> if os.getenv("WORKSPACE"):
> self.OutputPath = os.path.join(os.getenv("WORKSPACE"), 'Build',
>PcdValueInitName)
> else:
>@@ -1456,11 +1458,11 @@ class DscBuildData(PlatformBuildClassObject):
> if sys.platform == "win32":
> MakeApp = MakeApp + 'ARCH = IA32\nAPPNAME = %s\n' %
>(PcdValueInitName) + 'OBJECTS = %s\%s.obj\n' % (self.OutputPath,
>PcdValueInitName) + 'INC = '
> else:
> MakeApp = MakeApp + PcdGccMakefile
> MakeApp = MakeApp + 'APPNAME = %s\n' % (PcdValueInitName) +
>'OBJECTS = %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \
>-  'include $(MAKEROOT)/Makefiles/app.makefile\n' +
>'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable\n' +
>'INCLUDE +='
>+  'include $(MAKEROOT)/Makefiles/app.makefile\n' + 
>'INCLUDE +='
>
> PlatformInc = {}
> for Cache in self._Bdb._CACHE_.values():
> if Cache.MetaFile.Ext.lower() != '.dec':
> continue
>@@ -1481,10 +1483,54 @@ class DscBuildData(PlatformBuildClassObject):
> for pkg in PcdDependDEC:
> if pkg in PlatformInc:
> for inc in PlatformInc[pkg]:
> MakeApp += '-I'  + str(inc) + ' '
> MakeApp = MakeApp + '\n'
>+
>+CC_FLAGS = LinuxCFLAGS
>+if sys.platform == "win32":
>+CC_FLAGS = WindowsCFLAGS
>+BuildOptions = {}
>+for Options in self.BuildOptions:
>+if Options[2] != EDKII_NAME:
>+continue
>+Family = Options[0]
>+if Family and Family != self.ToolChainFamily:
>+continue
>+Target, Tag, Arch, Tool, Attr = Options[1].split("_")
>+if Tool != 'CC':
>+continue
>+
>+if Target == "*" or Target == self._Target:
>+if Tag == "*" or Tag == self._Toolchain:
>+if Arch == "*" or Arch == self.Arch:
>+if Tool not in BuildOptions:
>+BuildOptions[Tool] = {}
>+if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
>or
>self.BuildOptions[Options].startswith('='):
>+BuildOptions[Tool][Attr] = 
>self.BuildOptions[Options]
>+else:
>+# append options for the same tool except PATH
>+if Attr != 'PATH':
>+BuildOptions[Tool][Attr] += " " + 
>self.BuildOptions[Options]
>+else:
>+BuildOptions[Tool][Attr] = 
>self.BuildOptions[Options]
>+if BuildOptions:
>+for Tool in BuildOptions:
>+for Attr in BuildOptions[Tool]:
>+if 

[edk2] [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer reference

2017-12-26 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index c10134b8e6..e062094f79 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -845,7 +845,7 @@ UpdateDefaultSettingInFormPackage (
 //
 EfiVarStoreList   = ReallocatePool (EfiVarStoreMaxNum * sizeof 
(UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
 if (EfiVarStoreList == NULL) {
-  break;
+  goto Done;
 }
 EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
   }
@@ -874,7 +874,7 @@ UpdateDefaultSettingInFormPackage (
 //
 DefaultIdList   = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), 
(DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
 if (DefaultIdList == NULL) {
-  break;
+  goto Done;
 }
 DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
   }
@@ -1046,8 +1046,10 @@ UpdateDefaultSettingInFormPackage (
   }
 
 Done:
-  for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
-FreePool (EfiVarStoreList [Index]);
+  if (EfiVarStoreList != NULL) { 
+for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
+  FreePool (EfiVarStoreList [Index]);
+}
   }
   return;
 }
-- 
2.11.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe

2017-12-26 Thread Wang, Fan
Series reviewed by Wang, Fan .

Best Regards
Fan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Tuesday, December 26, 2017 2:35 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Wang, Fan ; Fu, Siyuan 
; Wu, Jiaxin 
Subject: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe

Cc: Wang Fan 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 

Jiaxin Wu (2):
  NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest().
  NetworkPkg/HttpDxe: Remove the unnecessary ASSERT.

 NetworkPkg/HttpDxe/HttpImpl.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory

2017-12-26 Thread Vladimir Olovyannikov
> -Original Message-
> From: Vladimir Olovyannikov [mailto:vladimir.olovyanni...@broadcom.com]
> Sent: Tuesday, December 26, 2017 5:59 PM
> To: 'Ard Biesheuvel'
> Cc: 'edk2-devel@lists.01.org'; 'Leif Lindholm'
> Subject: RE: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't
> reserve primary FV in memory
>
> > -Original Message-
> > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> > Sent: Tuesday, December 26, 2017 3:07 PM
> > To: Vladimir Olovyannikov
> > Cc: edk2-devel@lists.01.org; Leif Lindholm
> > Subject: Re: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't
> > reserve primary FV in memory
> >
> > On 26 December 2017 at 21:52, Vladimir Olovyannikov
> >  wrote:
> > > Hi Ard, Meenakshi,
> > >
> > > I am having a problem I cannot explain the reason for, with this
> > > commit on an ARM64 platform.
> > >
> > >ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in
> > > memory
> > >
> > > Now that PrePi no longer exposes its internal code via special
> > > HOBs,
> > > we can remove the special handling of the primary FV, which needed
> > > to
> > > be reserved so that DXE core could call into the PE/COFF and LZMA
> > > libraries in the PrePi module.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Udit Kumar 
> > > Signed-off-by: Meenakshi Aggarwal 
> > > [ardb: updated commit log]
> > > Signed-off-by: Ard Biesheuvel 
> > > Reviewed-by: Leif Lindholm 
> > >
> > > If a Shell is built "as is" from the source tree, there are no issues.
> > > However, if I slightly modify Shell.c like in the following patch:
> > >
> > > diff --git a/ShellPkg/Application/Shell/Shell.c
> > > b/ShellPkg/Application/Shell/Shell.c
> > > index 577e17311bea..bbbdde8ced96 100644
> > > --- a/ShellPkg/Application/Shell/Shell.c
> > > +++ b/ShellPkg/Application/Shell/Shell.c
> > > @@ -339,6 +339,11 @@ UefiMain (
> > >EFI_HANDLE  ConInHandle;
> > >EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *OldConIn;
> > >SPLIT_LIST  *Split;
> > > +  CHAR16  *DelayStr;
> > > +  CHAR16  *NoMapStr;
> > > +  UINTN   DelayVarSize;
> > > +  UINTN   NoMapVarSize;
> > > +  BOOLEAN SilentStart;
> > >
> > >if (PcdGet8(PcdShellSupportLevel) > 3) {
> > >  return (EFI_UNSUPPORTED);
> > > @@ -360,6 +365,7 @@ UefiMain (
> > >ShellInfoObject.PageBreakEnabled=
> > > PcdGetBool(PcdShellPageBreakDefault);
> > >ShellInfoObject.ViewingSettings.InsertMode  =
> > > PcdGetBool(PcdShellInsertModeDefault);
> > >ShellInfoObject.LogScreenCount  = PcdGet8
> > > (PcdShellScreenLogCount  );
> > > +  SilentStart = FALSE;
> > >
> > >//
> > >// verify we dont allow for spec violation @@ -452,6 +458,21 @@
> > > UefiMain (
> > >goto FreeResources;
> > >  }
> > >
> > > +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay) {
> > > +  // Command line has priority over the variable
> > > +  Status = ShellFindEnvVarInList(L"startupdelay", ,
> > > , NULL);
> > > +  if (!EFI_ERROR (Status)) {
> > > +ShellInfoObject.ShellInitSettings.Delay = ShellStrToUintn
> > > (DelayStr);
> > > +  }
> > > +}
> > > +
> > > +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
> > > +  Status = ShellFindEnvVarInList(L"silentstart", ,
> > > , NULL);
> > > +  if (!EFI_ERROR (Status)) {
> > > +SilentStart = (BOOLEAN)ShellStrToUintn (NoMapStr);
> > > +  }
> > > +}
> > > +
> > >  //
> > >  // If shell support level is >= 1 create the mappings and paths
> > >  //
> > > @@ -492,7 +513,7 @@ UefiMain (
> > >  //
> > >  // Display the version
> > >  //
> > > -if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion) {
> > > +if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion
> > > + &&
> > > !SilentStart) {
> > >  ShellPrintHiiEx (
> > >0,
> > >gST->ConOut->Mode->CursorRow, @@ -529,7 +550,7 @@
> > > UefiMain (
> > >  //
> > >  // Display the mapping
> > >  //
> > > -if (PcdGet8(PcdShellSupportLevel) >= 2 &&
> > > !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
> > > +if (PcdGet8(PcdShellSupportLevel) >= 2 &&
> > > !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap &&
> > > !SilentStart) {
> > >Status = RunCommand(L"map");
> > >ASSERT_EFI_ERROR(Status);
> > >  }
> > >
> > > Shell fails to load.
> > > Here is an excerpt from the debug log:
> > >
> > > add-symbol-file
> > >
> >
> /uefi/Build/StingrayPkg/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/
> > > Shel
> > > l/DEBUG/Shell.dll 0x8848
> > > 

Re: [edk2] [PATCH] CryptoPkg/OpensslLib: Update OpenSSL version to 1.1.0g

2017-12-26 Thread Long, Qin
Hi, Ard,

Could you kindly help to produce one extra patch to fix and validate this ARM & 
AARCH64 build?  Thanks.


Best Regards & Thanks,
LONG, Qin

From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
Sent: Wednesday, December 27, 2017 3:25 AM
To: Ye, Ting 
Cc: Long, Qin ; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] CryptoPkg/OpensslLib: Update OpenSSL version to 
1.1.0g

On 25 December 2017 at 07:14, Ye, Ting 
> wrote:
> Reviewed-by: Ye Ting >
>
>
> -Original Message-
> From: Long, Qin
> Sent: Friday, December 22, 2017 2:28 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting >
> Subject: [PATCH] CryptoPkg/OpensslLib: Update OpenSSL version to 1.1.0g
>
> Update the supported OpenSSL version to the latest 1.1.0g (02-Nov-2017).
> The changes includes:
>  - Re-generate the OpensslLib[crypto].inf using process_files.pl script
>to reflect the openssl source changes.
>  - Update OpenSSL-HOWTO.txt
>  - On Visual Studio Build: adding "/wd4819" to disable one addition build
>warning issue, which was already fixed in OpenSSL-HEAD
>https://github.com/openssl/openssl/pull/4691.
>  - On GCC Build: openssl-1.1.0g introduced one additional build warning:
> ...\openssl\crypto\asn1\x_int64.c:105:32: error: format '%ld' expects
> argument of type 'long int', but argument 3 has type 'int64_t
> {aka long long int}' [-Werror=format=]
> return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
> ^
> Adding "-Wno-error=format" to GCC build flag to suppress this warning,
> since we have no real printf usage in BaseCryptLib, and BIO_printf()
> was already wrappered as the dummy implementation in CryptoPkg.
>

This patch does not add this flag to GCC for ARM or AARCH64, so the
build is now broken.

Please fix.

> Cc: Ye Ting >
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Long Qin >
> ---
>  CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt| 10 +-
>  CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 14 +-
>  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 14 +-
>  CryptoPkg/Library/OpensslLib/buildinf.h   |  2 +-
>  4 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt 
> b/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt
> index e8b0bab010..d152138129 100644
> --- a/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt
> +++ b/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt
> @@ -18,7 +18,7 @@ on the cryptography.
>   OpenSSL-Version  
> =
>EDKII supports building with the latest release of OpenSSL.
> -  The latest official release is OpenSSL-1.1.0e (Released at 2017-Feb-16).
> +  The latest official release is OpenSSL-1.1.0g (Released at 2017-Nov-02).
>NOTE: Only latest release version was fully validated.
>  And no guarantees on build & functionality if using other versions.
>
> @@ -28,13 +28,13 @@ on the cryptography.
>  1. Clone the latest official OpenSSL release into the directory
>   CryptoPkg/Library/OpensslLib/openssl/
>
> -   Use OpenSSL-1.1.0e release as one example:
> - (OpenSSL_1_1_0e below is the tag name for the OpenSSL-1.1.0e release)
> +   Use OpenSSL-1.1.0g release as one example:
> + (OpenSSL_1_1_0g below is the tag name for the OpenSSL-1.1.0g
> + release)
>   > cd CryptoPkg/Library/OpensslLib
> - > git clone -b OpenSSL_1_1_0e https://github.com/openssl/openssl openssl
> + > git clone -b OpenSSL_1_1_0g https://github.com/openssl/openssl
> + openssl
>   or
>   > git clone https://github.com/openssl/openssl openssl
> - > git checkout OpenSSL_1_1_0e
> + > git checkout OpenSSL_1_1_0g
>  Or
>  2. Download the latest OpenSSL release package from the official website:
>   https://www.openssl.org/source/
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> index 1d15da6660..5302ad7fb5 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> @@ -95,6 +95,7 @@
>$(OPENSSL_PATH)/crypto/asn1/x_algor.c
>$(OPENSSL_PATH)/crypto/asn1/x_bignum.c
>$(OPENSSL_PATH)/crypto/asn1/x_info.c
> +  $(OPENSSL_PATH)/crypto/asn1/x_int64.c
>$(OPENSSL_PATH)/crypto/asn1/x_long.c
>$(OPENSSL_PATH)/crypto/asn1/x_pkey.c
>$(OPENSSL_PATH)/crypto/asn1/x_sig.c
> @@ -539,10 +540,11 @@
>#   C4389: 'operator' : signed/unsigned mismatch ()
>#   C4702: unreachable code
>#   C4706: assignment within conditional expression
> +  #   

Re: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe

2017-12-26 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Tuesday, December 26, 2017 2:35 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Wang, Fan ; Fu,
> Siyuan ; Wu, Jiaxin 
> Subject: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe
> 
> Cc: Wang Fan 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> 
> Jiaxin Wu (2):
>   NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest().
>   NetworkPkg/HttpDxe: Remove the unnecessary ASSERT.
> 
>  NetworkPkg/HttpDxe/HttpImpl.c | 17 -
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-26 Thread Wang, Jian J
Hi Mike,

Since this patch has been checked in trunk, do you think it should be reverted?
In addition, instead of using exception list for the ECC tool, I think it'd be 
better
to update ECC tool to use keyword match to check if a field name is public spec
defined one. Otherwise, if there's new structure type using those field names,
the tool will still report errors.

Regards,
Jian

> -Original Message-
> From: Kinney, Michael D
> Sent: Wednesday, December 27, 2017 12:48 AM
> To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> 
> Jian,
> 
> I do not think this change should be made.
> 
> One of the exceptions for not following the
> EDK II code style is if the field names are
> defined in a public specification.  In this case
> these fields are all listed in a structure in
> the Intel 64 and IA-32 Architectures Software
> Development Manual, Section 7.2.1, Figure 7-2
> using upper case register names.
> 
> Thanks,
> 
> Mike
> 
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org]
> > On Behalf Of Jian J Wang
> > Sent: Sunday, December 24, 2017 5:07 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] [PATCH 0/4] Coding style clean-up
> >
> > This patch series are meant for cleaning up code
> > according to coding style
> > requirements.
> >
> > Jian J Wang (4):
> >   MdePkg/BaseLib.h: Coding style clean-up
> >   MdeModulePkg/Core: Coding style clean-up
> >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
> > definition for new PCDs
> >   UefiCpuPkg: Update code to use new structure field
> > names
> >
> >  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |  5
> > ++
> >  MdePkg/Include/Library/BaseLib.h   | 72
> > +++---
> >  .../Ia32/ArchExceptionHandler.c| 24
> > 
> >  .../X64/ArchExceptionHandler.c |  6
> > +-
> >  UefiCpuPkg/Library/MpInitLib/MpLib.c   |  2
> > +-
> >  UefiCpuPkg/UefiCpuPkg.uni  | 16
> > -
> >  6 files changed, 71 insertions(+), 54 deletions(-)
> >
> > --
> > 2.15.1.windows.2
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory

2017-12-26 Thread Vladimir Olovyannikov
Hi Ard, Meenakshi,

I am having a problem I cannot explain the reason for, with this commit on
an ARM64 platform.

   ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory

Now that PrePi no longer exposes its internal code via special HOBs,
we can remove the special handling of the primary FV, which needed to
be reserved so that DXE core could call into the PE/COFF and LZMA
libraries in the PrePi module.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Udit Kumar 
Signed-off-by: Meenakshi Aggarwal 
[ardb: updated commit log]
Signed-off-by: Ard Biesheuvel 
Reviewed-by: Leif Lindholm 

If a Shell is built "as is" from the source tree, there are no issues.
However, if I slightly modify Shell.c like in the following patch:

diff --git a/ShellPkg/Application/Shell/Shell.c
b/ShellPkg/Application/Shell/Shell.c
index 577e17311bea..bbbdde8ced96 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -339,6 +339,11 @@ UefiMain (
   EFI_HANDLE  ConInHandle;
   EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *OldConIn;
   SPLIT_LIST  *Split;
+  CHAR16  *DelayStr;
+  CHAR16  *NoMapStr;
+  UINTN   DelayVarSize;
+  UINTN   NoMapVarSize;
+  BOOLEAN SilentStart;

   if (PcdGet8(PcdShellSupportLevel) > 3) {
 return (EFI_UNSUPPORTED);
@@ -360,6 +365,7 @@ UefiMain (
   ShellInfoObject.PageBreakEnabled=
PcdGetBool(PcdShellPageBreakDefault);
   ShellInfoObject.ViewingSettings.InsertMode  =
PcdGetBool(PcdShellInsertModeDefault);
   ShellInfoObject.LogScreenCount  = PcdGet8
(PcdShellScreenLogCount  );
+  SilentStart = FALSE;

   //
   // verify we dont allow for spec violation
@@ -452,6 +458,21 @@ UefiMain (
   goto FreeResources;
 }

+if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay) {
+  // Command line has priority over the variable
+  Status = ShellFindEnvVarInList(L"startupdelay", ,
, NULL);
+  if (!EFI_ERROR (Status)) {
+ShellInfoObject.ShellInitSettings.Delay = ShellStrToUintn
(DelayStr);
+  }
+}
+
+if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
+  Status = ShellFindEnvVarInList(L"silentstart", ,
, NULL);
+  if (!EFI_ERROR (Status)) {
+SilentStart = (BOOLEAN)ShellStrToUintn (NoMapStr);
+  }
+}
+
 //
 // If shell support level is >= 1 create the mappings and paths
 //
@@ -492,7 +513,7 @@ UefiMain (
 //
 // Display the version
 //
-if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion) {
+if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion &&
!SilentStart) {
 ShellPrintHiiEx (
   0,
   gST->ConOut->Mode->CursorRow,
@@ -529,7 +550,7 @@ UefiMain (
 //
 // Display the mapping
 //
-if (PcdGet8(PcdShellSupportLevel) >= 2 &&
!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
+if (PcdGet8(PcdShellSupportLevel) >= 2 &&
!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap && !SilentStart) {
   Status = RunCommand(L"map");
   ASSERT_EFI_ERROR(Status);
 }

Shell fails to load.
Here is an excerpt from the debug log:

add-symbol-file
/uefi/Build/StingrayPkg/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/Shel
l/DEBUG/Shell.dll 0x8848
Loading driver at 0x0008847F000 EntryPoint=0x0008848 Shell.efi
InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 8D095118
ProtectUefiImageCommon - 0x8D08ED40
  - 0x8847F000 - 0x00152000
SetUefiImageMemoryAttributes - 0x8847F000 - 0x1000
(0x4008)
SetUefiImageMemoryAttributes - 0x8848 - 0x000E6000
(0x00020008)
SetUefiImageMemoryAttributes - 0x88566000 - 0x0006B000
(0x4008)
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8D088920
InstallProtocolInterface: 752F3136-4E16-4FDC-A22A-E5F46812F4CA 8C71AF98
InstallProtocolInterface: 6302D008-7F9B-4F30-87AC-60C9FEF5DA4E 88566710
--- Blank lines -
3h
--- Blank lines -

InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8C0A1B18
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B A3ABE6B398
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8C0A1B18
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B A3ABE6B398
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8C0A1B18
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B A3ABE6B398
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 8C0A1B18
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B A3ABE6B398
InstallProtocolInterface: 387477C2-69C7-11D2-8E39-00A0C969723B 

Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute

2017-12-26 Thread Michael Zimmermann
Liming:
I've never used VS to compile edk2 but to me it looks like it doesn't like
what NORETURN is expanding to ('__declspec(noreturn)').

If that is the case it's a generic bug because this patch set did not add
the NORETURN macro.


On Tue, Dec 26, 2017 at 5:51 PM, Gao, Liming  wrote:

> Michael:
>
>   I suggest to add comments for each definition although there is
> redundant.
>
>
>
>   Besides, after I apply these three patches, and build MdePkg.dsc with
> VS2015x86. It will report below error. Could you help look it?
>
>
>
> "C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\Vc\bin\cl.exe" /Foc:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\
> IA32\MdePkg\Library\BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\OUTPUT\.\X86Cache.obj
> /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL
> /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw -D 
> DISABLE_NEW_DEPRECATED_INTERFACES
> /Ic:\r9tips\allpkg\edk2\MdePkg\Library\BaseCacheMaintenanceLib
> /Ic:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\IA32\MdePkg\Library\
> BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\DEBUG
> /Ic:\r9tips\allpkg\edk2\MdePkg  /Ic:\r9tips\allpkg\edk2\MdePkg\Include
> /Ic:\r9tips\allpkg\edk2\MdePkg\Include\Ia32 c:\r9tips\allpkg\edk2\MdePkg\
> Library\BaseCacheMaintenanceLib\X86Cache.c
>
> X86Cache.c
>
> c:\r9tips\allpkg\edk2\MdePkg\Include\Library/BaseLib.h(4933): error
> C2059: syntax error: 'type'
>
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 14.0\Vc\bin\cl.exe"' : return code '0x2'
>
> Stop.
>
>
>
> Thanks
>
> Liming
>
> *From:* Michael Zimmermann [mailto:sigmaepsilo...@gmail.com]
> *Sent:* Monday, December 25, 2017 11:50 PM
> *To:* Gao, Liming 
> *Cc:* Ard Biesheuvel ; edk2-devel@lists.01.org;
> Kinney, Michael D 
>
> *Subject:* Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
>
>
>
> Liming:
> The other macros have comments both before the compiler directives and
> before each define for each compiler.
>
> To me it looks like these are slightly differently formulated only and
> kinda redundant too.
>
> Is there a rule or do you have suggestions for writing comments for this
> kind of macro?
>
>
>
> On Mon, Dec 25, 2017 at 4:11 AM, Gao, Liming  wrote:
>
> Micha:
>Could you add comments for new macro RETURNS_TWICE like others, such as
> ANALYZER_NORETURN?
>
>
> >-Original Message-
> >From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> >Sent: Friday, December 22, 2017 11:24 PM
> >To: M1cha 
> >Cc: edk2-devel@lists.01.org; Kinney, Michael D
> >; Gao, Liming 
> >Subject: Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
> >
> >On 22 December 2017 at 07:23, M1cha  wrote:
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Michael Zimmermann 
> >> ---
> >>  MdePkg/Include/Base.h | 10 ++
> >>  1 file changed, 10 insertions(+)
> >>
> >> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> >> index 22ab5d3715fb..c863de407418 100644
> >> --- a/MdePkg/Include/Base.h
> >> +++ b/MdePkg/Include/Base.h
> >> @@ -218,6 +218,16 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE,
> >4);
> >>#endif
> >>  #endif
> >>
> >> +#ifndef RETURNS_TWICE
> >> +  #if defined (__GNUC__) || defined (__clang__)
> >> +#define RETURNS_TWICE  __attribute__((returns_twice))
> >> +  #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
> >> +#define RETURNS_TWICE
> >> +  #else
> >> +#define RETURNS_TWICE
> >
> >What is the point of having two versions that are #defined to nothing?
> >
> >> +  #endif
> >> +#endif
> >> +
> >>  //
> >>  // For symbol name in assembly code, an extra "_" is sometimes
> necessary
> >>  //
> >> --
> >> 2.15.1
> >>
>
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute

2017-12-26 Thread Gao, Liming
Michael:
  I suggest to add comments for each definition although there is redundant.

  Besides, after I apply these three patches, and build MdePkg.dsc with 
VS2015x86. It will report below error. Could you help look it?

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\cl.exe" 
/Foc:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\IA32\MdePkg\Library\BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\OUTPUT\.\X86Cache.obj
 /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h 
/EHs-c- /GR- /GF /Gy /Zi /Gm /Gw -D DISABLE_NEW_DEPRECATED_INTERFACES 
/Ic:\r9tips\allpkg\edk2\MdePkg\Library\BaseCacheMaintenanceLib  
/Ic:\r9tips\allpkg\edk2\Build\Mde\DEBUG_VS2015x86\IA32\MdePkg\Library\BaseCacheMaintenanceLib\BaseCacheMaintenanceLib\DEBUG
  /Ic:\r9tips\allpkg\edk2\MdePkg  /Ic:\r9tips\allpkg\edk2\MdePkg\Include  
/Ic:\r9tips\allpkg\edk2\MdePkg\Include\Ia32 
c:\r9tips\allpkg\edk2\MdePkg\Library\BaseCacheMaintenanceLib\X86Cache.c
X86Cache.c
c:\r9tips\allpkg\edk2\MdePkg\Include\Library/BaseLib.h(4933): error C2059: 
syntax error: 'type'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
14.0\Vc\bin\cl.exe"' : return code '0x2'
Stop.

Thanks
Liming
From: Michael Zimmermann [mailto:sigmaepsilo...@gmail.com]
Sent: Monday, December 25, 2017 11:50 PM
To: Gao, Liming 
Cc: Ard Biesheuvel ; edk2-devel@lists.01.org; 
Kinney, Michael D 
Subject: Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute

Liming:
The other macros have comments both before the compiler directives and before 
each define for each compiler.
To me it looks like these are slightly differently formulated only and kinda 
redundant too.
Is there a rule or do you have suggestions for writing comments for this kind 
of macro?

On Mon, Dec 25, 2017 at 4:11 AM, Gao, Liming 
> wrote:
Micha:
   Could you add comments for new macro RETURNS_TWICE like others, such as 
ANALYZER_NORETURN?

>-Original Message-
>From: Ard Biesheuvel 
>[mailto:ard.biesheu...@linaro.org]
>Sent: Friday, December 22, 2017 11:24 PM
>To: M1cha >
>Cc: edk2-devel@lists.01.org; Kinney, Michael D
>>; Gao, Liming 
>>
>Subject: Re: [edk2] [PATCH 1/3] MdePkg: add RETURNS_TWICE attribute
>
>On 22 December 2017 at 07:23, M1cha 
>> wrote:
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Michael Zimmermann 
>> >
>> ---
>>  MdePkg/Include/Base.h | 10 ++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
>> index 22ab5d3715fb..c863de407418 100644
>> --- a/MdePkg/Include/Base.h
>> +++ b/MdePkg/Include/Base.h
>> @@ -218,6 +218,16 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE,
>4);
>>#endif
>>  #endif
>>
>> +#ifndef RETURNS_TWICE
>> +  #if defined (__GNUC__) || defined (__clang__)
>> +#define RETURNS_TWICE  __attribute__((returns_twice))
>> +  #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
>> +#define RETURNS_TWICE
>> +  #else
>> +#define RETURNS_TWICE
>
>What is the point of having two versions that are #defined to nothing?
>
>> +  #endif
>> +#endif
>> +
>>  //
>>  // For symbol name in assembly code, an extra "_" is sometimes necessary
>>  //
>> --
>> 2.15.1
>>

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 0/2] BaseTools: Add Flexible PCD Value support

2017-12-26 Thread Yonghong Zhu
https://bugzilla.tianocore.org/show_bug.cgi?id=541

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
Signed-off-by: Yonghong Zhu 

Yonghong Zhu (2):
  BaseTools: Support PCD flexible values format
  BaseTools: Add DevicePath support for PCD values

 BaseTools/Source/BinaryFiles.txt   |3 +-
 BaseTools/Source/C/DevicePath/DevicePath.c |  188 ++
 BaseTools/Source/C/DevicePath/DevicePath.h | 1380 
 BaseTools/Source/C/DevicePath/DevicePathFromText.c | 3503 
 BaseTools/Source/C/DevicePath/DevicePathFromText.h |   72 +
 .../Source/C/DevicePath/DevicePathUtilities.c  | 2352 +
 .../Source/C/DevicePath/DevicePathUtilities.h  |  555 
 BaseTools/Source/C/DevicePath/GNUmakefile  |   30 +
 BaseTools/Source/C/DevicePath/Makefile |   24 +
 BaseTools/Source/C/DevicePath/UefiDevicePathLib.c  |  298 ++
 BaseTools/Source/C/DevicePath/UefiDevicePathLib.h  |  473 +++
 BaseTools/Source/C/GNUmakefile |3 +-
 BaseTools/Source/C/Makefile|5 +-
 BaseTools/Source/Python/AutoGen/AutoGen.py |   39 +
 BaseTools/Source/Python/AutoGen/GenC.py|2 +
 BaseTools/Source/Python/Common/Expression.py   |  241 +-
 BaseTools/Source/Python/Common/Misc.py |  236 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py  |   14 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py  |7 +
 .../Source/Python/Workspace/MetaFileParser.py  |   17 +-
 .../Source/Python/Workspace/WorkspaceCommon.py |6 +-
 BaseTools/Source/Python/build/BuildReport.py   |6 +
 22 files changed, 9338 insertions(+), 116 deletions(-)
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePath.c
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePath.h
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePathFromText.c
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePathFromText.h
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePathUtilities.c
 create mode 100644 BaseTools/Source/C/DevicePath/DevicePathUtilities.h
 create mode 100644 BaseTools/Source/C/DevicePath/GNUmakefile
 create mode 100644 BaseTools/Source/C/DevicePath/Makefile
 create mode 100644 BaseTools/Source/C/DevicePath/UefiDevicePathLib.c
 create mode 100644 BaseTools/Source/C/DevicePath/UefiDevicePathLib.h

-- 
2.6.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 1/2] BaseTools: Support PCD flexible values format

2017-12-26 Thread Yonghong Zhu
https://bugzilla.tianocore.org/show_bug.cgi?id=541

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py |  39 
 BaseTools/Source/Python/AutoGen/GenC.py|   2 +
 BaseTools/Source/Python/Common/Expression.py   | 246 -
 BaseTools/Source/Python/Common/Misc.py | 203 +
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  14 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py  |   7 +
 .../Source/Python/Workspace/MetaFileParser.py  |  17 +-
 .../Source/Python/Workspace/WorkspaceCommon.py |   8 +-
 BaseTools/Source/Python/build/BuildReport.py   |   6 +
 9 files changed, 429 insertions(+), 113 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index cacd009..8be5bfc 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -269,10 +269,11 @@ class WorkspaceAutoGen(AutoGen):
 self.AutoGenObjectList = []
 self._BuildDir  = None
 self._FvDir = None
 self._MakeFileDir   = None
 self._BuildCommand  = None
+self._GuidDict = {}
 
 # there's many relative directory operations, so ...
 os.chdir(self.WorkspaceDir)
 
 #
@@ -417,24 +418,42 @@ class WorkspaceAutoGen(AutoGen):
 TokenSpaceGuidCNameList = []
 FoundFlag = False
 PcdDatumType = ''
 NewValue = ''
 for package in PGen.PackageList:
+Guids = package.Guids
+self._GuidDict.update(Guids)
+for package in PGen.PackageList:
 for key in package.Pcds:
 PcdItem = package.Pcds[key]
 if HasTokenSpace:
 if (PcdItem.TokenCName, 
PcdItem.TokenSpaceGuidCName) == (TokenCName, TokenSpaceGuidCName):
 PcdDatumType = PcdItem.DatumType
+if pcdvalue.startswith('H'):
+try:
+pcdvalue = 
ValueExpressionEx(pcdvalue[1:], PcdDatumType, self._GuidDict)(True)
+except BadExpression, Value:
+if Value.result > 1:
+EdkLogger.error('Parser', 
FORMAT_INVALID, 'PCD [%s.%s] Value "%s",  %s' %
+
(TokenSpaceGuidCName, TokenCName, pcdvalue, Value))
+pcdvalue = 'H' + pcdvalue
 NewValue = 
BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, 
pcdvalue)
 FoundFlag = True
 else:
 if PcdItem.TokenCName == TokenCName:
 if not PcdItem.TokenSpaceGuidCName in 
TokenSpaceGuidCNameList:
 if len (TokenSpaceGuidCNameList) < 1:
 
TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName)
 PcdDatumType = PcdItem.DatumType
 TokenSpaceGuidCName = 
PcdItem.TokenSpaceGuidCName
+if pcdvalue.startswith('H'):
+try:
+pcdvalue = 
ValueExpressionEx(pcdvalue[1:], PcdDatumType, self._GuidDict)(True)
+except BadExpression, Value:
+EdkLogger.error('Parser', 
FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %
+
(TokenSpaceGuidCName, TokenCName, pcdvalue, Value))
+pcdvalue = 'H' + pcdvalue
 NewValue = 
BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, 
pcdvalue)
 FoundFlag = True
 else:
 EdkLogger.error(
 'build',
@@ -2444,10 +2463,30 @@ class PlatformAutoGen(AutoGen):
 ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
 if FromPcd.DatumType not in [None, '']:
 ToPcd.DatumType = FromPcd.DatumType
 if FromPcd.SkuInfoList not in [None, '', []]:
 

Re: [edk2] [Patch] BaseTools: Update Python Makefile to include the new added python files

2017-12-26 Thread Feng, Bob C
Reviewed-by: Bob Feng 

-Original Message-
From: Gao, Liming 
Sent: Tuesday, December 26, 2017 11:14 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Feng, Bob C 
Subject: [Patch] BaseTools: Update Python Makefile to include the new added 
python files

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
Cc: Bob Feng 
---
 BaseTools/Source/Python/Makefile | 4 
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Source/Python/Makefile b/BaseTools/Source/Python/Makefile
index 7ffe211..ce5541b 100644
--- a/BaseTools/Source/Python/Makefile
+++ b/BaseTools/Source/Python/Makefile
@@ -88,6 +88,9 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileTable.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceCommon.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceDatabase.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DecBuildData.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DscBuildData.py \
+  
+ $(BASE_TOOLS_PATH)\Source\Python\Workspace\InfBuildData.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\AutoGen.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\BuildEngine.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenC.py \ @@ -98,6 
+101,7 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\StrGather.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\UniClassObject.py \
   
$(BASE_TOOLS_PATH)\Source\Python\AutoGen\ValidCheckingInfoObject.py \
+  $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenVar.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\RangeExpression.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\VariableAttributes.py
 
--
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Update Python Makefile to include the new added python files

2017-12-26 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: Gao, Liming 
Sent: Tuesday, December 26, 2017 11:14 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Feng, Bob C 
Subject: [Patch] BaseTools: Update Python Makefile to include the new added 
python files

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
Cc: Bob Feng 
---
 BaseTools/Source/Python/Makefile | 4 
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Source/Python/Makefile b/BaseTools/Source/Python/Makefile
index 7ffe211..ce5541b 100644
--- a/BaseTools/Source/Python/Makefile
+++ b/BaseTools/Source/Python/Makefile
@@ -88,6 +88,9 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileTable.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceCommon.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceDatabase.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DecBuildData.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DscBuildData.py \
+  
+ $(BASE_TOOLS_PATH)\Source\Python\Workspace\InfBuildData.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\AutoGen.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\BuildEngine.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenC.py \ @@ -98,6 
+101,7 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\StrGather.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\UniClassObject.py \
   
$(BASE_TOOLS_PATH)\Source\Python\AutoGen\ValidCheckingInfoObject.py \
+  $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenVar.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\RangeExpression.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\VariableAttributes.py
 
--
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Update Python Makefile to include the new added python files

2017-12-26 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
Cc: Bob Feng 
---
 BaseTools/Source/Python/Makefile | 4 
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Source/Python/Makefile b/BaseTools/Source/Python/Makefile
index 7ffe211..ce5541b 100644
--- a/BaseTools/Source/Python/Makefile
+++ b/BaseTools/Source/Python/Makefile
@@ -88,6 +88,9 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileTable.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceCommon.py \
   $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceDatabase.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DecBuildData.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\DscBuildData.py \
+  $(BASE_TOOLS_PATH)\Source\Python\Workspace\InfBuildData.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\AutoGen.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\BuildEngine.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenC.py \
@@ -98,6 +101,7 @@ 
COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\StrGather.py \
   $(BASE_TOOLS_PATH)\Source\Python\AutoGen\UniClassObject.py \
   
$(BASE_TOOLS_PATH)\Source\Python\AutoGen\ValidCheckingInfoObject.py \
+  $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenVar.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\RangeExpression.py \
   $(BASE_TOOLS_PATH)\Source\Python\Common\VariableAttributes.py
 
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Fix Pcd value override issue caused by SKU inherit

2017-12-26 Thread BobCF
Pcd default value in DEC should only be assigned once.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 46 ++-
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 054ad2c254..e4f3586654 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1300,13 +1300,32 @@ class DscBuildData(PlatformBuildClassObject):
 # the flexible array member.  The flexible array member must be 
the last field
 # in a structure.  The size formula for this case is:
 # OFFSET_OF(FlexbleArrayField) + sizeof(FlexibleArray[0]) * 
(HighestIndex + 1)
 #
 CApp = CApp + '  Size = sizeof(%s);\n' % (Pcd.DatumType)
+for FieldList in [Pcd.DefaultValues]:
+if not FieldList:
+continue
+for FieldName in FieldList:
+FieldName = "." + FieldName
+IsArray = 
self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
+if IsArray:
+Value, ValueSize = ParseFieldValue 
(FieldList[FieldName.strip(".")][0])
+CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d / 
__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 
0));\n' % (Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, 
FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."));
+else:
+NewFieldName = ''
+while '[' in  FieldName:
+NewFieldName = NewFieldName + FieldName.split('[', 
1)[0] + '[0]'
+ArrayIndex = int(FieldName.split('[', 
1)[1].split(']', 1)[0])
+FieldName = FieldName.split(']', 1)[1]
+FieldName = NewFieldName + FieldName
+while '[' in FieldName:
+FieldName = FieldName.rsplit('[', 1)[0]
+CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, 
%d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
 for skuname in self.SkuIdMgr.SkuOverrideOrder():
 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
-for FieldList in [Pcd.DefaultValues, 
inherit_OverrideValues.get(DefaultStoreName)]:
+for FieldList in 
[inherit_OverrideValues.get(DefaultStoreName)]:
 if not FieldList:
 continue
 for FieldName in FieldList:
 FieldName = "." + FieldName
 IsArray = 
self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
@@ -1341,13 +1360,36 @@ class DscBuildData(PlatformBuildClassObject):
 CApp = CApp + '  memcpy (Pcd, OriginalPcd, OriginalSize);\n'
 
 #
 # Assign field values in PCD
 #
+for FieldList in [Pcd.DefaultValues]:
+if not FieldList:
+continue
+for FieldName in FieldList:
+IsArray = self.IsFieldValueAnArray(FieldList[FieldName][0])
+try:
+Value, ValueSize = ParseFieldValue 
(FieldList[FieldName][0])
+except Exception:
+print FieldList[FieldName][0]
+if isinstance(Value, str):
+CApp = CApp + '  Pcd->%s = %s; // From %s Line %d 
Value %s\n' % (FieldName, Value, FieldList[FieldName][1], 
FieldList[FieldName][2], FieldList[FieldName][0])
+elif IsArray:
+#
+# Use memcpy() to copy value into field
+#
+CApp = CApp + '  FieldSize = __FIELD_SIZE(%s, %s);\n' 
% (Pcd.DatumType, FieldName)
+CApp = CApp + '  Value = %s; // From %s Line %d 
Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList[FieldName][1], 
FieldList[FieldName][2], FieldList[FieldName][0])
+CApp = CApp + '  memcpy (>%s[0], Value, 
(FieldSize > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, 
ValueSize, ValueSize)
+else:
+if ValueSize > 4:
+CApp = CApp + '  Pcd->%s = %dULL; // From %s Line 
%d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], 
FieldList[FieldName][2], FieldList[FieldName][0])
+else:
+CApp = CApp + '  Pcd->%s = %d; // From %s Line %d 
Value %s\n' % (FieldName, Value, FieldList[FieldName][1], 
FieldList[FieldName][2], 

Re: [edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation return

2017-12-26 Thread Zeng, Star
Reviewed-by: Star Zeng 

Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Tuesday, December 26, 2017 4:36 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg HiiDataBaseDxe: Add the check for the memory 
allocation return

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 7441c19..c10134b 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -844,6 +844,9 @@ UpdateDefaultSettingInFormPackage (
 // Reallocate EFI VarStore Buffer
 //
 EfiVarStoreList   = ReallocatePool (EfiVarStoreMaxNum * sizeof 
(UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
+if (EfiVarStoreList == NULL) {
+  break;
+}
 EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
   }
   IfrEfiVarStore = (EFI_IFR_VARSTORE_EFI *) IfrOpHdr; @@ -851,6 +854,9 @@ 
UpdateDefaultSettingInFormPackage (
   // Convert VarStore Name from ASCII string to Unicode string.
   //
   EfiVarStoreList [EfiVarStoreNumber] = AllocatePool 
(IfrEfiVarStore->Header.Length + AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name));
+  if (EfiVarStoreList [EfiVarStoreNumber] == NULL) {
+break;
+  }
   CopyMem (EfiVarStoreList [EfiVarStoreNumber], IfrEfiVarStore, 
IfrEfiVarStore->Header.Length);
   AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 *) 
&(EfiVarStoreList [EfiVarStoreNumber]->Name[0]), AsciiStrSize ((CHAR8 
*)IfrEfiVarStore->Name) * sizeof (CHAR16));
   Status = FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_STANDARD, 
EfiVarStoreList[EfiVarStoreNumber], , NULL, 
IfrEfiVarStore->Size, FALSE); @@ -867,6 +873,9 @@ 
UpdateDefaultSettingInFormPackage (
 // Reallocate DefaultIdNumber
 //
 DefaultIdList   = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), 
(DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
+if (DefaultIdList == NULL) {
+  break;
+}
 DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
   }
   DefaultIdList[DefaultIdNumber ++] = ((EFI_IFR_DEFAULTSTORE *) 
IfrOpHdr)->DefaultId;
--
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Ard Biesheuvel
On 26 December 2017 at 09:00, Zeng, Star  wrote:
> Reviewed-by: Star Zeng 
>
>
> Thanks,
> Star
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
> Gao
> Sent: Tuesday, December 26, 2017 4:59 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with 
> UINTN type
>
> In V2, reduce unnecessary () in the expression.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Star Zeng 

Reviewed-by: Ard Biesheuvel 

> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 77905a0..2632211 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
>//
>AuthVarStorage->Format = NormalVarStorage->Format;
>AuthVarStorage->State  = NormalVarStorage->State;
> -  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 
> *) AuthVarStorage);
> +  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - 
> (UINTN)AuthVarStorage);
>CopyGuid (>Signature, );
>ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
>
> --
> 2.8.0.windows.1
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Zeng, Star
Reviewed-by: Star Zeng 


Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Tuesday, December 26, 2017 4:59 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with 
UINTN type

In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 77905a0..2632211 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
   //
   AuthVarStorage->Format = NormalVarStorage->Format;
   AuthVarStorage->State  = NormalVarStorage->State;
-  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) 
AuthVarStorage);
+  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - (UINTN)AuthVarStorage);
   CopyGuid (>Signature, );
   ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
 
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Liming Gao
In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 77905a0..2632211 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
   //
   AuthVarStorage->Format = NormalVarStorage->Format;
   AuthVarStorage->State  = NormalVarStorage->State;
-  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) 
AuthVarStorage);
+  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - (UINTN)AuthVarStorage);
   CopyGuid (>Signature, );
   ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
 
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Add Platform Override Build Options for PcdValueInit

2017-12-26 Thread Yonghong Zhu
Add Platform's CC_FLAGS /D option for PcdValueInit generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 77 +--
 1 file changed, 73 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 135b608..9262650 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -21,11 +21,12 @@ from Common.String import *
 from Common.DataType import *
 from Common.Misc import *
 from types import *
 
 from CommonDataClass.CommonClass import SkuInfoClass
-
+from Common.TargetTxtClassObject import *
+from Common.ToolDefClassObject import *
 from MetaDataTable import *
 from MetaFileTable import *
 from MetaFileParser import *
 
 from WorkspaceCommon import GetDeclaredPcd
@@ -75,15 +76,15 @@ PcdMakefileHeader = '''
 # This file is auto-generated by build utility
 #
 
 '''
 
+WindowsCFLAGS = 'CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101 '
+LinuxCFLAGS = 'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable '
 PcdMakefileEnd = '''
 !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common
 
-CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101
-
 LIBS = $(LIB_PATH)\Common.lib
 
 !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app
 '''
 
@@ -150,10 +151,11 @@ class DscBuildData(PlatformBuildClassObject):
 self._RawData = RawData
 self._Bdb = BuildDataBase
 self._Arch = Arch
 self._Target = Target
 self._Toolchain = Toolchain
+self._ToolChainFamily = None
 self._Clear()
 self._HandleOverridePath()
 if os.getenv("WORKSPACE"):
 self.OutputPath = os.path.join(os.getenv("WORKSPACE"), 'Build', 
PcdValueInitName)
 else:
@@ -1456,11 +1458,11 @@ class DscBuildData(PlatformBuildClassObject):
 if sys.platform == "win32":
 MakeApp = MakeApp + 'ARCH = IA32\nAPPNAME = %s\n' % 
(PcdValueInitName) + 'OBJECTS = %s\%s.obj\n' % (self.OutputPath, 
PcdValueInitName) + 'INC = '
 else:
 MakeApp = MakeApp + PcdGccMakefile
 MakeApp = MakeApp + 'APPNAME = %s\n' % (PcdValueInitName) + 
'OBJECTS = %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \
-  'include $(MAKEROOT)/Makefiles/app.makefile\n' + 
'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable\n' + 'INCLUDE +='
+  'include $(MAKEROOT)/Makefiles/app.makefile\n' + 
'INCLUDE +='
 
 PlatformInc = {}
 for Cache in self._Bdb._CACHE_.values():
 if Cache.MetaFile.Ext.lower() != '.dec':
 continue
@@ -1481,10 +1483,54 @@ class DscBuildData(PlatformBuildClassObject):
 for pkg in PcdDependDEC:
 if pkg in PlatformInc:
 for inc in PlatformInc[pkg]:
 MakeApp += '-I'  + str(inc) + ' '
 MakeApp = MakeApp + '\n'
+
+CC_FLAGS = LinuxCFLAGS
+if sys.platform == "win32":
+CC_FLAGS = WindowsCFLAGS
+BuildOptions = {}
+for Options in self.BuildOptions:
+if Options[2] != EDKII_NAME:
+continue
+Family = Options[0]
+if Family and Family != self.ToolChainFamily:
+continue
+Target, Tag, Arch, Tool, Attr = Options[1].split("_")
+if Tool != 'CC':
+continue
+
+if Target == "*" or Target == self._Target:
+if Tag == "*" or Tag == self._Toolchain:
+if Arch == "*" or Arch == self.Arch:
+if Tool not in BuildOptions:
+BuildOptions[Tool] = {}
+if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
or self.BuildOptions[Options].startswith('='):
+BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
+else:
+# append options for the same tool except PATH
+if Attr != 'PATH':
+BuildOptions[Tool][Attr] += " " + 
self.BuildOptions[Options]
+else:
+BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
+if BuildOptions:
+for Tool in BuildOptions:
+for Attr in BuildOptions[Tool]:
+if Attr == "FLAGS":
+Value = BuildOptions[Tool][Attr]
+ValueList = Value.split()
+if ValueList:
+for Id, Item in enumerate(ValueList):
+if Item == '-D' or Item == '/D':
+CC_FLAGS += ' ' + Item
+if Id + 1 < len(ValueList):
+

Re: [edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Ard Biesheuvel
On 26 December 2017 at 08:46, Gao, Liming  wrote:
> Ard:
>   Here is the simpler version. Convert pointer to UINTN, then subtract them 
> to get the size, last convert it to UINT32.
>
> AuthVarStorage->Size = (UINT32)((UINTN) AuthStartPtr - (UINTN) 
> AuthVarStorage);
>

That looks much better, thanks (although I prefer no space after the cast)


>>-Original Message-
>>From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>>Sent: Tuesday, December 26, 2017 4:39 PM
>>To: Gao, Liming 
>>Cc: edk2-devel@lists.01.org; Zeng, Star 
>>Subject: Re: [edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus
>>with UINTN type
>>
>>On 26 December 2017 at 08:36, Liming Gao  wrote:
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Liming Gao 
>>> Cc: Star Zeng 
>>
>>Could you please add an explanation why this is necessary? Do we
>>really need 5 (!) casts to perform a simple subtraction?
>>
>>> ---
>>>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>>b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>>> index 77905a0..a47270a 100644
>>> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>>> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>>> @@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
>>>//
>>>AuthVarStorage->Format = NormalVarStorage->Format;
>>>AuthVarStorage->State  = NormalVarStorage->State;
>>> -  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr -
>>(UINT8 *) AuthVarStorage);
>>> +  AuthVarStorage->Size = (UINT32)((UINTN) (UINT8 *) AuthStartPtr -
>>(UINTN) (UINT8 *) AuthVarStorage);
>>>CopyGuid (>Signature,
>>);
>>>ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
>>>
>>> --
>>> 2.8.0.windows.1
>>>
>>> ___
>>> edk2-devel mailing list
>>> edk2-devel@lists.01.org
>>> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Gao, Liming
Ard:
  Here is the simpler version. Convert pointer to UINTN, then subtract them to 
get the size, last convert it to UINT32. 

AuthVarStorage->Size = (UINT32)((UINTN) AuthStartPtr - (UINTN) AuthVarStorage); 

Thanks
Liming
>-Original Message-
>From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>Sent: Tuesday, December 26, 2017 4:39 PM
>To: Gao, Liming 
>Cc: edk2-devel@lists.01.org; Zeng, Star 
>Subject: Re: [edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus
>with UINTN type
>
>On 26 December 2017 at 08:36, Liming Gao  wrote:
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Liming Gao 
>> Cc: Star Zeng 
>
>Could you please add an explanation why this is necessary? Do we
>really need 5 (!) casts to perform a simple subtraction?
>
>> ---
>>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>> index 77905a0..a47270a 100644
>> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
>> @@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
>>//
>>AuthVarStorage->Format = NormalVarStorage->Format;
>>AuthVarStorage->State  = NormalVarStorage->State;
>> -  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr -
>(UINT8 *) AuthVarStorage);
>> +  AuthVarStorage->Size = (UINT32)((UINTN) (UINT8 *) AuthStartPtr -
>(UINTN) (UINT8 *) AuthVarStorage);
>>CopyGuid (>Signature,
>);
>>ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
>>
>> --
>> 2.8.0.windows.1
>>
>> ___
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Ard Biesheuvel
On 26 December 2017 at 08:36, Liming Gao  wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Star Zeng 

Could you please add an explanation why this is necessary? Do we
really need 5 (!) casts to perform a simple subtraction?

> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 77905a0..a47270a 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
>//
>AuthVarStorage->Format = NormalVarStorage->Format;
>AuthVarStorage->State  = NormalVarStorage->State;
> -  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 
> *) AuthVarStorage);
> +  AuthVarStorage->Size = (UINT32)((UINTN) (UINT8 *) AuthStartPtr - (UINTN) 
> (UINT8 *) AuthVarStorage);
>CopyGuid (>Signature, );
>ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
>
> --
> 2.8.0.windows.1
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg Variable: Update Pointer Minus with UINTN type

2017-12-26 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 77905a0..a47270a 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
   //
   AuthVarStorage->Format = NormalVarStorage->Format;
   AuthVarStorage->State  = NormalVarStorage->State;
-  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) 
AuthVarStorage);
+  AuthVarStorage->Size = (UINT32)((UINTN) (UINT8 *) AuthStartPtr - (UINTN) 
(UINT8 *) AuthVarStorage);
   CopyGuid (>Signature, );
   ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
 
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation return

2017-12-26 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 7441c19..c10134b 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -844,6 +844,9 @@ UpdateDefaultSettingInFormPackage (
 // Reallocate EFI VarStore Buffer
 //
 EfiVarStoreList   = ReallocatePool (EfiVarStoreMaxNum * sizeof 
(UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
+if (EfiVarStoreList == NULL) {
+  break;
+}
 EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
   }
   IfrEfiVarStore = (EFI_IFR_VARSTORE_EFI *) IfrOpHdr;
@@ -851,6 +854,9 @@ UpdateDefaultSettingInFormPackage (
   // Convert VarStore Name from ASCII string to Unicode string.
   //
   EfiVarStoreList [EfiVarStoreNumber] = AllocatePool 
(IfrEfiVarStore->Header.Length + AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name));
+  if (EfiVarStoreList [EfiVarStoreNumber] == NULL) {
+break;
+  }
   CopyMem (EfiVarStoreList [EfiVarStoreNumber], IfrEfiVarStore, 
IfrEfiVarStore->Header.Length);
   AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 *) 
&(EfiVarStoreList [EfiVarStoreNumber]->Name[0]), AsciiStrSize ((CHAR8 
*)IfrEfiVarStore->Name) * sizeof (CHAR16));
   Status = FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_STANDARD, 
EfiVarStoreList[EfiVarStoreNumber], , NULL, 
IfrEfiVarStore->Size, FALSE);
@@ -867,6 +873,9 @@ UpdateDefaultSettingInFormPackage (
 // Reallocate DefaultIdNumber
 //
 DefaultIdList   = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), 
(DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
+if (DefaultIdList == NULL) {
+  break;
+}
 DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
   }
   DefaultIdList[DefaultIdNumber ++] = ((EFI_IFR_DEFAULTSTORE *) 
IfrOpHdr)->DefaultId;
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Update SkuId checker to make sure it be valid UINT64 value

2017-12-26 Thread Gao, Liming
Sorry. I will remove it. 

>-Original Message-
>From: Zhu, Yonghong
>Sent: Tuesday, December 26, 2017 4:04 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Zhu, Yonghong
>
>Subject: RE: [Patch] BaseTools: Update SkuId checker to make sure it be valid
>UINT64 value
>
>Please remove the " Signed-off-by" info in Cc.
>
>Reviewed-by: Yonghong Zhu 
>
>Best Regards,
>Zhu Yonghong
>
>
>-Original Message-
>From: Gao, Liming
>Sent: Tuesday, December 26, 2017 3:59 PM
>To: edk2-devel@lists.01.org
>Cc: Zhu, Yonghong ; Feng, Bob C
>
>Subject: [Patch] BaseTools: Update SkuId checker to make sure it be valid
>UINT64 value
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao 
>Cc: Yonghong Zhu 
>Cc: Signed-off-by: Bob Feng 
>---
> BaseTools/Source/Python/Common/Misc.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Common/Misc.py
>b/BaseTools/Source/Python/Common/Misc.py
>index 0374be0..f440008 100644
>--- a/BaseTools/Source/Python/Common/Misc.py
>+++ b/BaseTools/Source/Python/Common/Misc.py
>@@ -2149,10 +2149,10 @@ class SkuClass():
> for SkuName in SkuIds:
> SkuId = SkuIds[SkuName][0]
> skuid_num = int(SkuId,16) if SkuId.upper().startswith("0X") else
>int(SkuId)
>-if skuid_num > 0x:
>+if skuid_num > 0x:
> EdkLogger.error("build", PARAMETER_INVALID,
>-ExtraData = "SKU-ID [%s] must less than 65535"
>-  % (SkuName))
>+ExtraData = "SKU-ID [%s] value %s exceeds the max 
>value of
>UINT64"
>+  % (SkuName, SkuId))
>
> self.AvailableSkuIds = sdict()
> self.SkuIdSet = []
>--
>2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Update SkuId checker to make sure it be valid UINT64 value

2017-12-26 Thread Zhu, Yonghong
Please remove the " Signed-off-by" info in Cc.

Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: Gao, Liming 
Sent: Tuesday, December 26, 2017 3:59 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Feng, Bob C 
Subject: [Patch] BaseTools: Update SkuId checker to make sure it be valid 
UINT64 value

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
Cc: Signed-off-by: Bob Feng 
---
 BaseTools/Source/Python/Common/Misc.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 0374be0..f440008 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -2149,10 +2149,10 @@ class SkuClass():
 for SkuName in SkuIds:
 SkuId = SkuIds[SkuName][0]
 skuid_num = int(SkuId,16) if SkuId.upper().startswith("0X") else 
int(SkuId)
-if skuid_num > 0x:
+if skuid_num > 0x:
 EdkLogger.error("build", PARAMETER_INVALID,
-ExtraData = "SKU-ID [%s] must less than 65535"
-  % (SkuName))
+ExtraData = "SKU-ID [%s] value %s exceeds the max 
value of UINT64"
+  % (SkuName, SkuId))
 
 self.AvailableSkuIds = sdict()
 self.SkuIdSet = []
-- 
2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel