Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

2023-09-15 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Srinivasan, ManickamX  
Sent: Wednesday, September 13, 2023 4:56 PM
To: devel@edk2.groups.io
Cc: Srinivasan, ManickamX ; Feng, Bob C 
; Gao, Liming ; Chen, Christine 
; T V, Krishnamoorthy 
Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

The length of the Board ID is being updated based on the BOARD_ID string. If 
the PCH_TYPE is empty space/single quotes(''), removing the empty space/single 
quotes('') and concatenating the TARGET_PLATFORM_SHORT and BUILD flag strings.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: T V Krishnamoorthy 
Signed-off-by: ManickamX Srinivasan 
---
 Platform/Intel/Tools/GenBiosId/GenBiosId.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py 
b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
index fa3689867..54503fdfc 100644
--- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
+++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
@@ -141,14 +141,16 @@ def ParserInputFile(InputDict, NoTimestamp):
 if Item not in _ConfigItem:
 EdkLogger("GenBiosId", FORMAT_INVALID, 
ExtraData=_ConfigItemInvalid % Item)
 _ConfigItem[Item]['Value'] = InputDict[Item]
-if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']:
+if ((len(_ConfigItem[Item]['Value']) != 
_ConfigItem[Item]['Length'])|(_ConfigItem["BOARD_ID"]['Value'][3:4] == " ")):
 # The length of the Board ID is being updated based on the 
BOARD_ID string
 #If the PCH_TYPE is empty space/single quotes(''), removing the 
empty space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT and 
BUILD flag strings
 if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"):
 
_ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])]
-
_ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value'])
+elif (_ConfigItem["BOARD_ID"]['Value'][3:4] == " "):
+
+ _ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]
+ +_ConfigItem["BOARD_ID"]['Value'][4:len(_ConfigItem["BOARD_ID"]['Value
+ '])]
 else:
 EdkLogger("GenBiosId", FORMAT_INVALID, 
ExtraData=_ConfigLenInvalid % Item)
+
+ _ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value']
+ )
 for Item in _ConfigItem:
 if not _ConfigItem[Item]['Value']:
 EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR, ExtraData="Item %s is 
missing" % Item)
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108697): https://edk2.groups.io/g/devel/message/108697
Mute This Topic: https://groups.io/mt/10112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

2023-08-29 Thread Bob Feng
Reviewed-by: Bob Feng  

-Original Message-
From: Srinivasan, ManickamX  
Sent: Wednesday, August 23, 2023 3:29 PM
To: devel@edk2.groups.io
Cc: Srinivasan, ManickamX ; Feng, Bob C 
; Gao, Liming ; Chen, Christine 
; T V, Krishnamoorthy 
Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

The length of the Board ID is being updated based on the BOARD_ID string. If 
the PCH_TYPE is empty space/single quotes(''), removing the empty space/single 
quotes('') and concatenating the TARGET_PLATFORM_SHORT and BUILD flag strings.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: T V Krishnamoorthy 
Signed-off-by: ManickamX Srinivasan 
---
 Platform/Intel/Tools/GenBiosId/GenBiosId.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py 
b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
index f823fdcad..fa3689867 100644
--- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
+++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
@@ -142,7 +142,13 @@ def ParserInputFile(InputDict, NoTimestamp):
 EdkLogger("GenBiosId", FORMAT_INVALID, 
ExtraData=_ConfigItemInvalid % Item)
 _ConfigItem[Item]['Value'] = InputDict[Item]
 if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']:
-EdkLogger("GenBiosId", FORMAT_INVALID, ExtraData=_ConfigLenInvalid 
% Item)
+# The length of the Board ID is being updated based on the 
BOARD_ID string
+#If the PCH_TYPE is empty space/single quotes(''), removing the 
empty space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT and 
BUILD flag strings
+if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"):
+
_ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])]
+
_ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value'])
+else:
+EdkLogger("GenBiosId", FORMAT_INVALID, 
+ ExtraData=_ConfigLenInvalid % Item)
 for Item in _ConfigItem:
 if not _ConfigItem[Item]['Value']:
 EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR, ExtraData="Item %s is 
missing" % Item)
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108085): https://edk2.groups.io/g/devel/message/108085
Mute This Topic: https://groups.io/mt/100916084/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 4/4] BaseTools: FMMT replace new free space fixing in replace

2023-06-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, June 29, 2023 11:35 AM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Gao, Liming ; 
Feng, Bob C 
Subject: [Patch V2 4/4] BaseTools: FMMT replace new free space fixing in replace

In FMMT replace function, when newffs size <= targetffs size, the new free 
space is calculated wrong as loss the pad data delta size.
That will cause invalid binary generated.
This patch fixes this issue.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/core/FvHandler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index 49bbc35baa4d..7a6076033681 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -456,7 +456,7 @@ class FvHandler:
 # Start free space calculating and moving process.
 self.ModifyTest(TargetFv.Parent, Needed_Space)
 else:
-New_Free_Space = self.TargetFfs.Data.Size - self.NewFfs.Data.Size
+New_Free_Space = self.TargetFfs.Data.Size + 
+ len(self.TargetFfs.Data.PadData) - self.NewFfs.Data.Size - 
+ len(self.NewFfs.Data.PadData)
 # If TargetFv already have free space, move the new free space 
into it.
 if TargetFv.Data.Free_Space:
 TargetFv.Child[-1].Data.Data += b'\xff' * New_Free_Space
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106500): https://edk2.groups.io/g/devel/message/106500
Mute This Topic: https://groups.io/mt/99845068/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 3/4] BaseTools: FMMT support ELF UPLD parser

2023-06-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, June 29, 2023 11:35 AM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Feng, Bob C ; Gao, 
Liming 
Subject: [Patch V2 3/4] BaseTools: FMMT support ELF UPLD parser

FMMT add new function to support the .elf file parsing.
Using '-v' option, the UPLD info will be printed out.

'''
- UNIVERSAL_PAYLOAD_INFO
  - 4 bytes align (BOOLEAN)
- Identifier
- SpecRevision
- Attribute
- Revision
- Capability
- ProducerId
- ImageId
UPLD Buffer
'''

Cc: Rebecca Cran 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/FMMT.py   |   2 ++
 BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py  |  36 
+++-
 BaseTools/Source/Python/FMMT/core/BiosTree.py  |  48 
++--
 BaseTools/Source/Python/FMMT/core/BiosTreeNode.py  |  56 
+++-
 BaseTools/Source/Python/FMMT/core/FMMTParser.py|   2 +-
 BaseTools/Source/Python/FirmwareStorageFormat/UPLHeader.py | 244 

 6 files changed, 383 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/FMMT.py 
b/BaseTools/Source/Python/FMMT/FMMT.py
index bf580b3843a8..26fc4c5792c4 100644
--- a/BaseTools/Source/Python/FMMT/FMMT.py
+++ b/BaseTools/Source/Python/FMMT/FMMT.py
@@ -84,6 +84,8 @@ class FMMT():
 ROOT_TYPE = ROOT_FFS_TREE
 elif filetype == '.sec':
 ROOT_TYPE = ROOT_SECTION_TREE
+elif filetype == '.elf':
+ROOT_TYPE = ROOT_ELF_TREE
 else:
 ROOT_TYPE = ROOT_TREE
 ViewFile(inputfile, ROOT_TYPE, layoutfilename, outputfile) diff --git 
a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py 
b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
index 2d4e6d9276d7..de174f26ab23 100644
--- a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
+++ b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
@@ -15,10 +15,13 @@ from core.GuidTools import GUIDTools  from utils.FmmtLogger 
import FmmtLogger as logger
 
 ROOT_TREE = 'ROOT'
+ROOT_ELF_TREE = 'ROOT_ELF_TREE'
 ROOT_FV_TREE = 'ROOT_FV_TREE'
 ROOT_FFS_TREE = 'ROOT_FFS_TREE'
 ROOT_SECTION_TREE = 'ROOT_SECTION_TREE'
 
+ELF_TREE = 'ELF'
+ELF_SECTION_TREE = 'ELF_SECTION_TREE'
 FV_TREE = 'FV'
 DATA_FV_TREE = 'DATA_FV'
 FFS_TREE = 'FFS'
@@ -49,6 +52,12 @@ class BinaryProduct():
 def ParserData():
 pass
 
+class ElfFactory(BinaryFactory):
+type = [ROOT_ELF_TREE, ELF_TREE]
+
+def Create_Product():
+return ElfProduct()
+
 class SectionFactory(BinaryFactory):
 type = [SECTION_TREE]
 
@@ -354,6 +363,30 @@ class FdProduct(BinaryProduct):
 tmp_index += 1
 return Fd_Struct
 
+class ElfSectionProduct(BinaryProduct):
+## Decompress the compressed section.
+def ParserData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset: 
int=0) -> None:
+pass
+def ParserSectionData(self, Section_Tree, whole_Data: bytes, 
Rel_Whole_Offset: int=0) -> None:
+pass
+def ParserProgramData(self, Section_Tree, whole_Data: bytes, 
Rel_Whole_Offset: int=0) -> None:
+pass
+
+class ElfProduct(BinaryProduct):
+
+def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int=0) 
-> None:
+Elf_Info = ElfNode(Whole_Data)
+if Elf_Info.Header.ELF_PHOff != 0:
+Elf_Info.GetProgramList(Whole_Data[Elf_Info.Header.ELF_PHOff:])
+if Elf_Info.Header.ELF_SHOff != 0:
+Elf_Info.GetSectionList(Whole_Data[Elf_Info.Header.ELF_SHOff:])
+Elf_Info.FindUPLDSection(Whole_Data)
+Elf_Tree = BIOSTREE(Elf_Info.Name)
+Elf_Tree.type = ELF_TREE
+Elf_Info.Data = Whole_Data[Elf_Info.HeaderLength:]
+Elf_Tree.Data = Elf_Info
+ParTree.insertChild(Elf_Tree)
+
 class ParserEntry():
 FactoryTable:dict = {
 SECTION_TREE: SectionFactory,
@@ -364,6 +397,7 @@ class ParserEntry():
 SEC_FV_TREE: FvFactory,
 ROOT_FV_TREE: FdFactory,
 ROOT_TREE: FdFactory,
+ROOT_ELF_TREE: ElfFactory,
 }
 
 def GetTargetFactory(self, Tree_type: str) -> BinaryFactory:
@@ -377,4 +411,4 @@ class ParserEntry():
 def DataParser(self, Tree, Data: bytes, Offset: int) -> None:
 TargetFactory = self.GetTargetFactory(Tree.type)
 if TargetFactory:
-self.Generate_Product(TargetFactory, Tree, Data, Offset)
\ No newline at end of file
+self.Generate_Product(TargetFactory, Tree, Data, Offset)
diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py 
b/BaseTools/

Re: [edk2-devel] [Patch V2 2/4] BaseTools: FMMT replace output file is not generated successfully

2023-06-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, June 29, 2023 11:35 AM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Feng, Bob C ; Gao, 
Liming 
Subject: [Patch V2 2/4] BaseTools: FMMT replace output file is not generated 
successfully

For replace function, when target Ffs and new ffs are with same size, the 
output file can not be generated successfully.
This patch fixes this issue.

Cc: Rebecca Cran 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/core/BiosTree.py  |  4 ++--  
BaseTools/Source/Python/FMMT/core/FvHandler.py | 19 ---
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py 
b/BaseTools/Source/Python/FMMT/core/BiosTree.py
index d8fa4743354a..137f49748b09 100644
--- a/BaseTools/Source/Python/FMMT/core/BiosTree.py
+++ b/BaseTools/Source/Python/FMMT/core/BiosTree.py
@@ -56,7 +56,7 @@ class BIOSTREE:
 if len(self.Child) == 0:
 self.Child.append(newNode)
 else:
-if not pos:
+if not pos or pos == len(self.Child):
 LastTree = self.Child[-1]
 self.Child.append(newNode)
 LastTree.NextRel = newNode @@ -195,4 +195,4 @@ class BIOSTREE:
 for item in self.Child:
 TreeInfo[key].setdefault('Files',[]).append( item.ExportTree())
 
-return TreeInfo
\ No newline at end of file
+return TreeInfo
diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index b0cc1951a1c6..49bbc35baa4d 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -387,7 +387,21 @@ class FvHandler:
 if self.NewFfs.Data.Size >= self.TargetFfs.Data.Size:
 Needed_Space = self.NewFfs.Data.Size + 
len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size - 
len(self.TargetFfs.Data.PadData)
 # If TargetFv have enough free space, just move part of the free 
space to NewFfs.
-if TargetFv.Data.Free_Space >= Needed_Space:
+if Needed_Space == 0:
+Target_index = TargetFv.Child.index(self.TargetFfs)
+TargetFv.Child.remove(self.TargetFfs)
+TargetFv.insertChild(self.NewFfs, Target_index)
+# Modify TargetFv Header and ExtHeader info.
+TargetFv.Data.ModFvExt()
+TargetFv.Data.ModFvSize()
+TargetFv.Data.ModExtHeaderData()
+ModifyFvExtData(TargetFv)
+TargetFv.Data.ModCheckSum()
+# Recompress from the Fv node to update all the related node 
data.
+self.CompressData(TargetFv)
+# return the Status
+self.Status = True
+elif TargetFv.Data.Free_Space >= Needed_Space:
 # Modify TargetFv Child info and BiosTree.
 TargetFv.Child[-1].Data.Data = b'\xff' * 
(TargetFv.Data.Free_Space - Needed_Space)
 TargetFv.Data.Free_Space -= Needed_Space @@ -450,7 +464,6 @@ 
class FvHandler:
 Target_index = TargetFv.Child.index(self.TargetFfs)
 TargetFv.Child.remove(self.TargetFfs)
 TargetFv.insertChild(self.NewFfs, Target_index)
-self.Status = True
 # If TargetFv do not have free space, create free space for Fv.
 else:
 New_Free_Space_Tree = BIOSTREE('FREE_SPACE') @@ -461,7 +474,6 
@@ class FvHandler:
 Target_index = TargetFv.Child.index(self.TargetFfs)
 TargetFv.Child.remove(self.TargetFfs)
 TargetFv.insertChild(self.NewFfs, Target_index)
-self.Status = True
 # Modify TargetFv Header and ExtHeader info.
 TargetFv.Data.ModFvExt()
 TargetFv.Data.ModFvSize()
@@ -470,6 +482,7 @@ class FvHandler:
 TargetFv.Data.ModCheckSum()
 # Recompress from the Fv node to update all the related node data.
 self.CompressData(TargetFv)
+self.Status = True
 logger.debug('Done!')
 return self.Status
 
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106498): https://edk2.groups.io/g/devel/message/106498
Mute This Topic: https://groups.io/mt/99845058/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue

2023-06-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, June 29, 2023 11:34 AM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Gao, Liming ; 
Feng, Bob C 
Subject: [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue

1. FvLength not change issue;
2. FileSystemGuid align with File Size;

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/core/FMMTOperation.py |  2 +-
 BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py 
b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
index a86f8dda9a1a..d4aa3397036d 100644
--- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
+++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
@@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: 
str, Fv_name: str=None
 
FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist[index])
 if FmmtParser.WholeFvTree.Findlist != []:
 TargetNode = FmmtParser.WholeFvTree.Findlist[0]
-if TargetNode.type == FV_TREE or SEC_FV_TREE or DATA_FV_TREE:
+if TargetNode.type == FV_TREE or TargetNode.type == SEC_FV_TREE or 
TargetNode.type == DATA_FV_TREE:
 FinalData = struct2stream(TargetNode.Data.Header) + 
TargetNode.Data.Data
 with open(outputfile, "wb") as f:
 f.write(FinalData)
diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index ff3d637623f8..b0cc1951a1c6 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -279,7 +279,7 @@ class FvHandler:
 ParTree.Child.remove(ParTree.Child[-1])
 ParTree.Data.Free_Space = 0
 ParTree.Data.Size += Needed_Space
-ParTree.Data.Header.Fvlength = ParTree.Data.Size
+ParTree.Data.Header.FvLength = ParTree.Data.Size
 ModifyFvSystemGuid(ParTree)
 for item in ParTree.Child:
 if item.type == FFS_FREE_SPACE:
@@ -650,8 +650,12 @@ class FvHandler:
 Removed_Space = TargetFv.Data.Free_Space - New_Free_Space
 TargetFv.Child[-1].Data.Data = b'\xff' * New_Free_Space
 TargetFv.Data.Size -= Removed_Space
-TargetFv.Data.Header.Fvlength = TargetFv.Data.Size
-ModifyFvSystemGuid(TargetFv)
+TargetFv.Data.Header.FvLength = TargetFv.Data.Size
+if struct2stream(TargetFv.Data.Header.FileSystemGuid) == 
EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE:
+if TargetFv.Data.Size <= 0xFF:
+TargetFv.Data.Header.FileSystemGuid = ModifyGuidFormat(
+"8c8ce578-8a3d-4f1c-9935-896185c32dd3")
+
 for item in TargetFv.Child:
 if item.type == FFS_FREE_SPACE:
 TargetFv.Data.Data += item.Data.Data + item.Data.PadData
-- 
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106497): https://edk2.groups.io/g/devel/message/106497
Mute This Topic: https://groups.io/mt/99845056/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V1 3/3] BaseTools: FMMT support ELF UPLD parser

2023-06-05 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Tuesday, April 18, 2023 5:55 PM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Feng, Bob C ; Gao, 
Liming 
Subject: [Patch V1 3/3] BaseTools: FMMT support ELF UPLD parser

FMMT add new function to support the .elf file parsing.
Using '-v' option, the UPLD info will be printed out.

'''
- UNIVERSAL_PAYLOAD_INFO
  - 4 bytes align (BOOLEAN)
- Identifier
- SpecRevision
- Attribute
- Revision
- Capability
- ProducerId
- ImageId
UPLD Buffer
'''

Cc: Rebecca Cran 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/FMMT.py   |   2 ++
 BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py  |  36 
+++-
 BaseTools/Source/Python/FMMT/core/BiosTree.py  |  48 
++--
 BaseTools/Source/Python/FMMT/core/BiosTreeNode.py  |  56 
+++-
 BaseTools/Source/Python/FMMT/core/FMMTParser.py|   2 +-
 BaseTools/Source/Python/FirmwareStorageFormat/UPLHeader.py | 244 

 6 files changed, 383 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/FMMT.py 
b/BaseTools/Source/Python/FMMT/FMMT.py
index bf580b3843..26fc4c5792 100644
--- a/BaseTools/Source/Python/FMMT/FMMT.py
+++ b/BaseTools/Source/Python/FMMT/FMMT.py
@@ -84,6 +84,8 @@ class FMMT():
 ROOT_TYPE = ROOT_FFS_TREE
 elif filetype == '.sec':
 ROOT_TYPE = ROOT_SECTION_TREE
+elif filetype == '.elf':
+ROOT_TYPE = ROOT_ELF_TREE
 else:
 ROOT_TYPE = ROOT_TREE
 ViewFile(inputfile, ROOT_TYPE, layoutfilename, outputfile) diff --git 
a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py 
b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
index 2d4e6d9276..de174f26ab 100644
--- a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
+++ b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
@@ -15,10 +15,13 @@ from core.GuidTools import GUIDTools  from utils.FmmtLogger 
import FmmtLogger as logger
 
 ROOT_TREE = 'ROOT'
+ROOT_ELF_TREE = 'ROOT_ELF_TREE'
 ROOT_FV_TREE = 'ROOT_FV_TREE'
 ROOT_FFS_TREE = 'ROOT_FFS_TREE'
 ROOT_SECTION_TREE = 'ROOT_SECTION_TREE'
 
+ELF_TREE = 'ELF'
+ELF_SECTION_TREE = 'ELF_SECTION_TREE'
 FV_TREE = 'FV'
 DATA_FV_TREE = 'DATA_FV'
 FFS_TREE = 'FFS'
@@ -49,6 +52,12 @@ class BinaryProduct():
 def ParserData():
 pass
 
+class ElfFactory(BinaryFactory):
+type = [ROOT_ELF_TREE, ELF_TREE]
+
+def Create_Product():
+return ElfProduct()
+
 class SectionFactory(BinaryFactory):
 type = [SECTION_TREE]
 
@@ -354,6 +363,30 @@ class FdProduct(BinaryProduct):
 tmp_index += 1
 return Fd_Struct
 
+class ElfSectionProduct(BinaryProduct):
+## Decompress the compressed section.
+def ParserData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset: 
int=0) -> None:
+pass
+def ParserSectionData(self, Section_Tree, whole_Data: bytes, 
Rel_Whole_Offset: int=0) -> None:
+pass
+def ParserProgramData(self, Section_Tree, whole_Data: bytes, 
Rel_Whole_Offset: int=0) -> None:
+pass
+
+class ElfProduct(BinaryProduct):
+
+def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int=0) 
-> None:
+Elf_Info = ElfNode(Whole_Data)
+if Elf_Info.Header.ELF_PHOff != 0:
+Elf_Info.GetProgramList(Whole_Data[Elf_Info.Header.ELF_PHOff:])
+if Elf_Info.Header.ELF_SHOff != 0:
+Elf_Info.GetSectionList(Whole_Data[Elf_Info.Header.ELF_SHOff:])
+Elf_Info.FindUPLDSection(Whole_Data)
+Elf_Tree = BIOSTREE(Elf_Info.Name)
+Elf_Tree.type = ELF_TREE
+Elf_Info.Data = Whole_Data[Elf_Info.HeaderLength:]
+Elf_Tree.Data = Elf_Info
+ParTree.insertChild(Elf_Tree)
+
 class ParserEntry():
 FactoryTable:dict = {
 SECTION_TREE: SectionFactory,
@@ -364,6 +397,7 @@ class ParserEntry():
 SEC_FV_TREE: FvFactory,
 ROOT_FV_TREE: FdFactory,
 ROOT_TREE: FdFactory,
+ROOT_ELF_TREE: ElfFactory,
 }
 
 def GetTargetFactory(self, Tree_type: str) -> BinaryFactory:
@@ -377,4 +411,4 @@ class ParserEntry():
 def DataParser(self, Tree, Data: bytes, Offset: int) -> None:
 TargetFactory = self.GetTargetFactory(Tree.type)
 if TargetFactory:
-self.Generate_Product(TargetFactory, Tree, Data, Offset)
\ No newline at end of file
+self.Generate_Product(TargetFactory, Tree, Data, Offset)
diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py 
b/BaseTools/Sourc

Re: [edk2-devel] [Patch V1 2/3] BaseTools: FMMT replace output file is not generated successfully

2023-06-05 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Tuesday, April 18, 2023 5:53 PM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Feng, Bob C ; Gao, 
Liming 
Subject: [Patch V1 2/3] BaseTools: FMMT replace output file is not generated 
successfully

For replace function, when target Ffs and new ffs are with same size, the 
output file can not be generated successfully.
This patch fixes this issue.

Cc: Rebecca Cran 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/core/BiosTree.py  |  4 ++--  
BaseTools/Source/Python/FMMT/core/FvHandler.py | 19 ---
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py 
b/BaseTools/Source/Python/FMMT/core/BiosTree.py
index d8fa474335..137f49748b 100644
--- a/BaseTools/Source/Python/FMMT/core/BiosTree.py
+++ b/BaseTools/Source/Python/FMMT/core/BiosTree.py
@@ -56,7 +56,7 @@ class BIOSTREE:
 if len(self.Child) == 0:
 self.Child.append(newNode)
 else:
-if not pos:
+if not pos or pos == len(self.Child):
 LastTree = self.Child[-1]
 self.Child.append(newNode)
 LastTree.NextRel = newNode @@ -195,4 +195,4 @@ class BIOSTREE:
 for item in self.Child:
 TreeInfo[key].setdefault('Files',[]).append( item.ExportTree())
 
-return TreeInfo
\ No newline at end of file
+return TreeInfo
diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index b0cc1951a1..49bbc35baa 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -387,7 +387,21 @@ class FvHandler:
 if self.NewFfs.Data.Size >= self.TargetFfs.Data.Size:
 Needed_Space = self.NewFfs.Data.Size + 
len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size - 
len(self.TargetFfs.Data.PadData)
 # If TargetFv have enough free space, just move part of the free 
space to NewFfs.
-if TargetFv.Data.Free_Space >= Needed_Space:
+if Needed_Space == 0:
+Target_index = TargetFv.Child.index(self.TargetFfs)
+TargetFv.Child.remove(self.TargetFfs)
+TargetFv.insertChild(self.NewFfs, Target_index)
+# Modify TargetFv Header and ExtHeader info.
+TargetFv.Data.ModFvExt()
+TargetFv.Data.ModFvSize()
+TargetFv.Data.ModExtHeaderData()
+ModifyFvExtData(TargetFv)
+TargetFv.Data.ModCheckSum()
+# Recompress from the Fv node to update all the related node 
data.
+self.CompressData(TargetFv)
+# return the Status
+self.Status = True
+elif TargetFv.Data.Free_Space >= Needed_Space:
 # Modify TargetFv Child info and BiosTree.
 TargetFv.Child[-1].Data.Data = b'\xff' * 
(TargetFv.Data.Free_Space - Needed_Space)
 TargetFv.Data.Free_Space -= Needed_Space @@ -450,7 +464,6 @@ 
class FvHandler:
 Target_index = TargetFv.Child.index(self.TargetFfs)
 TargetFv.Child.remove(self.TargetFfs)
 TargetFv.insertChild(self.NewFfs, Target_index)
-self.Status = True
 # If TargetFv do not have free space, create free space for Fv.
 else:
 New_Free_Space_Tree = BIOSTREE('FREE_SPACE') @@ -461,7 +474,6 
@@ class FvHandler:
 Target_index = TargetFv.Child.index(self.TargetFfs)
 TargetFv.Child.remove(self.TargetFfs)
 TargetFv.insertChild(self.NewFfs, Target_index)
-self.Status = True
 # Modify TargetFv Header and ExtHeader info.
 TargetFv.Data.ModFvExt()
 TargetFv.Data.ModFvSize()
@@ -470,6 +482,7 @@ class FvHandler:
 TargetFv.Data.ModCheckSum()
 # Recompress from the Fv node to update all the related node data.
 self.CompressData(TargetFv)
+self.Status = True
 logger.debug('Done!')
 return self.Status
 
--
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105707): https://edk2.groups.io/g/devel/message/105707
Mute This Topic: https://groups.io/mt/98340349/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V1 1/3] BaseTools: fixing FMMT ShrinkFv issue

2023-06-05 Thread Bob Feng
This patch is good to me.
Reviewed-by: Bob Feng 

Thanks,
Bob

-Original Message-
From: Chen, Christine  
Sent: Tuesday, April 18, 2023 5:53 PM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Gao, Liming ; 
Feng, Bob C 
Subject: [Patch V1 1/3] BaseTools: fixing FMMT ShrinkFv issue

1. FvLength not change issue;
2. FileSystemGuid align with File Size;

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/core/FMMTOperation.py |  2 +-
 BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py 
b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
index a86f8dda9a..d4aa339703 100644
--- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
+++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
@@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: 
str, Fv_name: str=None
 
FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist[index])
 if FmmtParser.WholeFvTree.Findlist != []:
 TargetNode = FmmtParser.WholeFvTree.Findlist[0]
-if TargetNode.type == FV_TREE or SEC_FV_TREE or DATA_FV_TREE:
+if TargetNode.type == FV_TREE or TargetNode.type == SEC_FV_TREE or 
TargetNode.type == DATA_FV_TREE:
 FinalData = struct2stream(TargetNode.Data.Header) + 
TargetNode.Data.Data
 with open(outputfile, "wb") as f:
 f.write(FinalData)
diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index ff3d637623..b0cc1951a1 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -279,7 +279,7 @@ class FvHandler:
 ParTree.Child.remove(ParTree.Child[-1])
 ParTree.Data.Free_Space = 0
 ParTree.Data.Size += Needed_Space
-ParTree.Data.Header.Fvlength = ParTree.Data.Size
+ParTree.Data.Header.FvLength = ParTree.Data.Size
 ModifyFvSystemGuid(ParTree)
 for item in ParTree.Child:
 if item.type == FFS_FREE_SPACE:
@@ -650,8 +650,12 @@ class FvHandler:
 Removed_Space = TargetFv.Data.Free_Space - New_Free_Space
 TargetFv.Child[-1].Data.Data = b'\xff' * New_Free_Space
 TargetFv.Data.Size -= Removed_Space
-TargetFv.Data.Header.Fvlength = TargetFv.Data.Size
-ModifyFvSystemGuid(TargetFv)
+TargetFv.Data.Header.FvLength = TargetFv.Data.Size
+if struct2stream(TargetFv.Data.Header.FileSystemGuid) == 
EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE:
+if TargetFv.Data.Size <= 0xFF:
+TargetFv.Data.Header.FileSystemGuid = ModifyGuidFormat(
+"8c8ce578-8a3d-4f1c-9935-896185c32dd3")
+
 for item in TargetFv.Child:
 if item.type == FFS_FREE_SPACE:
 TargetFv.Data.Data += item.Data.Data + item.Data.PadData
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105706): https://edk2.groups.io/g/devel/message/105706
Mute This Topic: https://groups.io/mt/98340347/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Add quotes around OBJCOPY cmd in build_rule.template

2023-04-24 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Rebecca Cran  
Sent: Monday, April 24, 2023 10:06 PM
To: devel@edk2.groups.io; Gao, Liming ; Feng, Bob C 
; Chen, Christine 
Cc: Rebecca Cran 
Subject: [PATCH v2 1/1] BaseTools: Add quotes around OBJCOPY cmd in 
build_rule.template

Add quotes around the OBJCOPY command in build_rule.template to fix the case 
where LLVM is installed on Windows in a path with spaces such as C:\Program 
Files\LLVM.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Conf/build_rule.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index d42e7937cc90..eb64c62060e1 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -352,12 +352,12 @@
 -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) 
 
 $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
-$(OBJCOPY) $(OBJCOPY_STRIPFLAG) ${src}
+"$(OBJCOPY)" $(OBJCOPY_STRIPFLAG) ${src}
 
 #
 #The below 2 lines are only needed for UNIXGCC tool chain, which 
generates PE image directly
 #
--$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
+-"$(OBJCOPY)" $(OBJCOPY_ADDDEBUGFLAG) ${src}
 -$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug 
$(BIN_DIR)(+)$(MODULE_NAME_GUID).debug
 
 "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
--
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103508): https://edk2.groups.io/g/devel/message/103508
Mute This Topic: https://groups.io/mt/98470825/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 01/13] BaseTools,CryptoPkg: Update CLANGDWARF, remove CLANG 35/38 toolchains

2023-04-24 Thread Bob Feng
Hi Rebecca,

With this patch, the UniversalPayload will be built fail on windows.
It can be reproduced with this command on windows.

edksetup
python UefiPayloadPkg\UniversalPayloadBuild.py -t VS2019

But the root cause is a bug in build_rule.template.  
Under the   section, 2 $(OBJCOPY) should be wrapped by "".  Could 
you please also update build_rule.template in this patch?

---

[Dynamic-Library-File]

?.dll


$(OUTPUT_DIR)(+)$(MODULE_NAME).efi
$(OUTPUT_DIR)(+)$(MODULE_NAME).map


"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
$(CP) ${dst} $(DEBUG_DIR)
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
-$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) 

$(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
$(OBJCOPY) $(OBJCOPY_STRIPFLAG) ${src}

#
#The below 2 lines are only needed for UNIXGCC tool chain, which 
generates PE image directly
#
-$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
-$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug 
$(BIN_DIR)(+)$(MODULE_NAME_GUID).debug

"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
$(CP) ${dst} $(DEBUG_DIR)
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)


Thanks,
Bob

-Original Message-
From: Rebecca Cran  
Sent: Saturday, April 22, 2023 1:15 AM
To: devel@edk2.groups.io; Gao, Liming ; Feng, Bob C 
; Chen, Christine ; Kinney, Michael 
D ; Michael Kubacki ; 
Sean Brogan ; Chiu, Chasel ; 
Desimone, Nathaniel L ; Zeng, Star 
; Andrew Fish 
Cc: Rebecca Cran ; Ni, Ray ; Leif Lindholm 
; Liu, Zhiguang ; Wang, Jian 
J ; Lu, Xiaoyu1 ; Jiang, Guomin 
; Guo, Gua ; Ard Biesheuvel 
; Pedro Falcato ; Gerd Hoffmann 
; Marvin Häuser 
Subject: [PATCH v5 01/13] BaseTools,CryptoPkg: Update CLANGDWARF, remove CLANG 
35/38 toolchains

Update the CLANGDWARF toolchain definition in tools_def.template with the
settings from CLANG38, and delete the CLANG35 and CLANG38 toolchains.

The CLANG35 and CLANG38 toolchains were added for compatibility with
ARM's proprietary clang-based toolchain. Things have since moved on, and
with the latest clang version being 16.0.0, versions 3.5 and 3.9 are
obsolete and can be removed.

Update CryptoPkg: Add CLANGDWARF and remove CLANG35 and CLANG38 compiler flags

With the removal of CLANG35 and CLANG38 and the update of the CLANGDWARF
toolchain definition in Conf/tools_def.txt update the compiler flags in
BaseCryptLib and OpensslLib.

Signed-off-by: Rebecca Cran 
Reviewed-by: Liming Gao 
---
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf |   3 +--
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf  |   3 +--
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf  |   3 +--
 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf  |   3 +--
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf  |   3 +--
 CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf |   3 +--
 CryptoPkg/Library/OpensslLib/OpensslLib.inf |   3 +--
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf|   3 +--
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf   |   3 +--
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf |   3 +--
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf|   3 +--
 BaseTools/Conf/tools_def.template   | 471 
+--
 12 files changed, 200 insertions(+), 304 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 5be1724f0852..d99337a9ea39 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -110,8 +110,7 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 66261138a00b..5203941c75c1 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -97,8 +97,7 @@ [BuildOptions]
   #
   # suppress the 

Re: [edk2-devel] [PATCH 1/1] Maintainers.txt: BaseTools Bob Feng -> reviewer, Rebecca Cran -> maintainer

2023-03-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Thursday, March 30, 2023 1:35 AM
To: devel@edk2.groups.io
Cc: Rebecca Cran ; Gao, Liming ; 
Feng, Bob C 
Subject: [edk2-devel] [PATCH 1/1] Maintainers.txt: BaseTools Bob Feng -> 
reviewer, Rebecca Cran -> maintainer

Update Maintainers.txt for BaseTools: move Bob Feng from being a maintainer to 
reviewer, and add myself (Rebecca Cran) as a new maintainer.

Signed-off-by: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
---
 Maintainers.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt index d4607af7..2f8671147a67 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -177,8 +177,9 @@ R: Julien Grall  [jgrall]  BaseTools
 F: BaseTools/
 W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools
-M: Bob Feng  [BobCF]
+M: Rebecca Cran  [bcran]
 M: Liming Gao  [lgao4]
+R: Bob Feng  [BobCF]
 R: Yuwei Chen  [YuweiChen1110]
 
 CryptoPkg
--
2.34.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102143): https://edk2.groups.io/g/devel/message/102143
Mute This Topic: https://groups.io/mt/97933998/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-03-15 Thread Bob Feng
Ray, it's merged to edk2 repo.

-Original Message-
From: Ni, Ray  
Sent: Wednesday, March 15, 2023 9:12 AM
To: Palomino Sosa, Guillermo A ; Kinney, 
Michael D ; Feng, Bob C ; 
Gao, Liming ; devel@edk2.groups.io
Cc: Chen, Christine ; Oram, Isaac W 
; Sean Brogan ; 
a...@kernel.org
Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information 
in build report

I saw the code was merged to edk2-basetools repo 5 days ago.
When will the change be in edk2 repo? I am really interested in using the json 
files

Thanks,
Ray

> -Original Message-
> From: Palomino Sosa, Guillermo A 
> Sent: Monday, March 6, 2023 11:41 PM
> To: Kinney, Michael D ; Feng, Bob C 
> ; Gao, Liming ; 
> devel@edk2.groups.io
> Cc: Chen, Christine ; Ni, Ray 
> ; Oram, Isaac W ; Sean 
> Brogan ; a...@kernel.org
> Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> Hi guys, can we submit the pull request or do you have comments on it?
> https://github.com/tianocore/edk2-basetools/pull/88
> 
> Thanks
> 
> 
> -Original Message-
> From: Palomino Sosa, Guillermo A
> Sent: Tuesday, February 28, 2023 10:00 PM
> To: Ni, Ray ; Kinney, Michael D 
> ; devel@edk2.groups.io; a...@kernel.org
> Cc: Chen, Christine ; Feng, Bob C 
> ; Gao, Liming ; Oram, 
> Isaac W ; Sean Brogan 
> 
> Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> It takes same time as original build report to be generated as it 
> constructed using the same data structures as build report. So I think 
> its OK to not have it enabled by default.
> 
> Patch is ready in the pull request to be reviews.
> 
> 
> 
> -Original Message-
> From: Ni, Ray 
> Sent: Tuesday, February 28, 2023 6:52 PM
> To: Palomino Sosa, Guillermo A ;
> Kinney, Michael D ; devel@edk2.groups.io; 
> a...@kernel.org
> Cc: Chen, Christine ; Feng, Bob C 
> ; Gao, Liming ; Oram, 
> Isaac W ; Sean Brogan 
> 
> Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> What's the status of this patch?
> Does report generation take time? If no, why not generate them by 
> default without individual flag control.
> I really like the feature to generate "compile_commands.json"
> 
> > -Original Message-
> > From: Palomino Sosa, Guillermo A 
> > 
> > Sent: Tuesday, February 28, 2023 7:42 AM
> > To: Kinney, Michael D ; 
> > devel@edk2.groups.io; a...@kernel.org
> > Cc: Ni, Ray ; Chen, Christine 
> > ; Feng, Bob C ; Gao, 
> > Liming ; Oram, Isaac W 
> > ; Sean Brogan 
> > Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> > information in build report
> >
> > I have updated the pull based on Sean feedback. I added following 
> > fields to
> > module_report.json:
> > * LibraryClass
> > * ModuleEntryPointList
> > * ConstructorList
> > * DestructorList
> >
> > I have also added commit from Ard based on this request to fix build issue:
> > https://github.com/tianocore/edk2-basetools/pull/88
> >
> > Thanks
> >
> > -Original Message-
> > From: Kinney, Michael D 
> > Sent: Monday, February 27, 2023 4:36 PM
> > To: devel@edk2.groups.io; a...@kernel.org; Palomino Sosa, Guillermo 
> > A 
> > Cc: Ni, Ray ; Chen, Christine 
> > ; Feng, Bob C ; Gao, 
> > Liming ; Oram, Isaac W 
> > ; Sean Brogan ; 
> > Kinney, Michael D 
> > Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> > information in build report
> >
> > Hi Guillermo,
> >
> > Can you please look at Ards PR and make sure his fix is included in your PR.
> >
> > Also, please work with Christine and Bob to see what is going on 
> > with the Code Coverage check.  We do want it to be easy for all 
> > community members to submit change requests.  We may need support 
> > from the edk2-bastools maintainers to help with CI issues and help 
> > with changes to
> address.
> >
> > Thanks,
> >
> > Mike
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Ard 
> > > Biesheuvel
> > > Sent: Monday, February 27, 2023 10:58 AM
> > > To: devel@edk2.groups.io; Palomino Sosa, Guillermo A 
> > > 
> > > Cc: Ni, Ray ; Kinney, Michael D 
> > > ; Chen, Christine 
> > > ; Feng, Bob C ; Gao, 
> > > Liming ; Oram, Isaac W 
> > > ; Sean Brogan 
> > > Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate 
> > > compile information in build report
> > >
> > > On Mon, 27 Feb 2023 at 18:40, Guillermo Antonio Palomino Sosa 
> > >  wrote:
> > > >
> > > > Hi. I have submitted a pull request to edk2-basetools repository:
> > > > https://github.com/tianocore/edk2-basetools/pull/88
> > > > This is the feature request for it:
> > > > https://github.com/tianocore/edk2-basetools/issues/87
> > > > I'm also attaching the patch here:
> > > > (0001-BaseTools-Generate-compile-information-in-build-repo.patch
> > > > )
> > > >
> > > > On a side note, seems like tip of edk2-basetools is broken due 
> > > > this
> > commit that makes direct import 

Re: [edk2-devel] [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.

2023-03-09 Thread Bob Feng
Thanks Christine.

Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, March 9, 2023 10:55 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Feng, Bob C 
; Gao, Liming 
Subject: [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.

Add myself as maintainer for the BaseTools Pkg.

Cc: Michael D Kinney 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt index d4607a..463d9567e1 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -179,7 +179,7 @@ F: BaseTools/
 W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools
 M: Bob Feng  [BobCF]
 M: Liming Gao  [lgao4]
-R: Yuwei Chen  [YuweiChen1110]
+M: Yuwei Chen  [YuweiChen1110]
 
 CryptoPkg
 F: CryptoPkg/
--
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100948): https://edk2.groups.io/g/devel/message/100948
Mute This Topic: https://groups.io/mt/97489080/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 3/3] [edk2-staging]BaseTools: Add new build option for Variable default value generation

2023-01-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Monday, January 30, 2023 2:27 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [Patch V2 3/3] [edk2-staging]BaseTools: Add new build option for 
Variable default value generation

Add new build option "--gen-default-variable-bin" for Variable default value 
generation from Python VFR tool's extended json output file.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/DataPipe.py |   2 ++
 BaseTools/Source/Python/AutoGen/GenDefaultVar.py| 577 
+
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py|   8 
 BaseTools/Source/Python/Common/GlobalData.py|   5 +
 BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py |  12 ++--
 BaseTools/Source/Python/build/build.py  |  19 
++-
 BaseTools/Source/Python/build/buildoptions.py   |   1 +
 7 files changed, 617 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py 
b/BaseTools/Source/Python/AutoGen/DataPipe.py
index c700baf7b7..e45b4a928a 100755
--- a/BaseTools/Source/Python/AutoGen/DataPipe.py
+++ b/BaseTools/Source/Python/AutoGen/DataPipe.py
@@ -173,3 +173,5 @@ class MemoryDataPipe(DataPipe):
 self.DataContainer = 
{"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds}  
self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable}++
self.DataContainer = {"GenDefaultVarBin": GlobalData.gGenDefaultVarBin}diff 
--git a/BaseTools/Source/Python/AutoGen/GenDefaultVar.py 
b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py
new file mode 100644
index 00..859d4f25eb
--- /dev/null
+++ b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py
@@ -0,0 +1,577 @@
+import json+from ctypes import *+import re+import copy+from struct import 
unpack+import os+import Common.EdkLogger as EdkLogger++class GUID(Structure):+  
  _fields_ = [+('Guid1',c_uint32),+('Guid2',
c_uint16),+('Guid3',c_uint16),+('Guid4',
ARRAY(c_uint8, 8)),+]++def from_list(self, listformat):+
self.Guid1 = listformat[0]+self.Guid2 = listformat[1]+
self.Guid3 = listformat[2]+for i in range(8):+self.Guid4[i] 
= listformat[i+3]++def __cmp__(self, otherguid):+if 
isinstance(otherguid, GUID):+return 1+rt = False+if 
self.Guid1 == otherguid.Guid1 and self.Guid2 == otherguid.Guid2 and self.Guid3 
== otherguid.Guid3:+rt = True+for i in range(8):+   
 rt = rt & (self.Guid4[i] == otherguid.Guid4[i])+return 
rt+++class TIME(Structure):+_fields_ = [+('Year', 
c_uint16),+('Month',c_uint8),+('Day',  
c_uint8),+('Hour', c_uint8),+('Minute',   
c_uint8),+('Second',   c_uint8),+('Pad1', 
c_uint8),+('Nanosecond',   c_uint32),+('TimeZone', 
c_uint16),+('Daylight', c_uint8),+('Pad2', 
c_uint8),+]+def __init__(self):+self.Year = 0x0+
self.Month = 0x0+self.Day = 0x0+self.Hour = 0x0+
self.Minute = 0x0+self.Second = 0x0+self.Pad1 = 0x0+
self.Nanosecond = 0x0+self.TimeZone = 0x0+self.Daylight = 0x0+  
  self.Pad2 = 0x0+++EFI_VARIABLE_GUID = [0xddcf3616, 0x3275, 0x4164,+   
  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 
0x7d]+EFI_AUTHENTICATED_VARIABLE_GUID = [+0xaaf32c78, 0x947b, 0x439a, 0xa1, 
0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92]++AuthVarGuid = 
GUID()+AuthVarGuid.from_list(EFI_AUTHENTICATED_VARIABLE_GUID)+VarGuid = 
GUID()+VarGuid.from_list(EFI_VARIABLE_GUID)++# Variable Store Header 
Format.+VARIABLE_STORE_FORMATTED = 0x5a+# Variable Store Header 
State.+VARIABLE_STORE_HEALTHY = 0xfe+++class VARIABLE_STORE_HEADER(Structure):+ 
   _fields_ = [+('Signature',GUID),+('Size',
 c_uint32),+('Format',   c_uint8),+ 
   ('State',c_uint8),+('Reserved', 
c_uint16),+('Reserved1', 

Re: [edk2-devel] [Patch V2 2/3] [edk2-staging]BaseTools: Add new build option for PyVfrCompiler yaml generation

2023-01-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Monday, January 30, 2023 2:27 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [Patch V2 2/3] [edk2-staging]BaseTools: Add new build option for 
PyVfrCompiler yaml generation

Add new build option "--vfr-yaml-enable" for Python VfrCompiler extended output 
yaml file generation.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/DataPipe.py  |  2 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py |  8 
 BaseTools/Source/Python/Common/GlobalData.py |  4 
 BaseTools/Source/Python/build/build.py   | 33 
+
 BaseTools/Source/Python/build/buildoptions.py|  1 +
 5 files changed, 48 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py 
b/BaseTools/Source/Python/AutoGen/DataPipe.py
index 848c7a8296..c700baf7b7 100755
--- a/BaseTools/Source/Python/AutoGen/DataPipe.py
+++ b/BaseTools/Source/Python/AutoGen/DataPipe.py
@@ -171,3 +171,5 @@ class MemoryDataPipe(DataPipe):
 self.DataContainer = 
{"EnableGenfdsMultiThread":GlobalData.gEnableGenfdsMultiThread}  
self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds}++ 
   self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable}diff --git 
a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index d05410b329..eb81c3f3af 100755
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -434,6 +434,14 @@ class ModuleAutoGen(AutoGen):
 def DebugDir(self): return _MakeDir((self.BuildDir, "DEBUG")) +
@cached_property+def VarIFiles(self):+rt = []+for SrcFile 
in self.SourceFileList:+if SrcFile.Ext.lower() == '.vfr':+  
  rt.append(os.path.join(self.OutputDir, "{}.i".format(SrcFile.BaseName)))+ 
   return rt+ ## Return the path of custom file @cached_property
 def CustomMakefile(self):diff --git 
a/BaseTools/Source/Python/Common/GlobalData.py 
b/BaseTools/Source/Python/Common/GlobalData.py
index 197bd83666..039a9648aa 100755
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -123,3 +123,7 @@ gSikpAutoGenCache = set()  # Common lock for the file 
access in multiple process AutoGens file_lock = None +#+# Build flag for 
generate Yaml file from Vfr file+#+gVfrYamlEnable = Falsediff --git 
a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index 51fb1f433e..7e2f25686d 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -748,6 +748,7 @@ class Build():
 GlobalData.gBinCacheSource = BuildOptions.BinCacheSource 
GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread  
   GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck+  
  GlobalData.gVfrYamlEnable = BuildOptions.VfrYamlEnable  if 
GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: 
EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination 
must be used together with --hash.")@@ -1460,6 +1461,17 @@ class Build():
  # genfds if Target == 'fds':+if 
GlobalData.gVfrYamlEnable:+from VfrCompiler.main import 
VfrParse+variable_i_filelist = 
os.path.join(AutoGenObject.BuildDir,"variable_i_filelist.txt")+
if os.path.exists(variable_i_filelist):+with 
open(variable_i_filelist) as file:+i_filelist = 
file.readlines()+for i_file in i_filelist:+ 
   inputfile = i_file.replace("\n", "")+
yamloutputfile = inputfile.split(".")[0] + '.yaml'+
jsonoutputfile = inputfile.split(".")[0] + '.json'+
VfrParse(inputfile, yamloutputfile, jsonoutputfile) if 
GenFdsApi(AutoGenObject.GenFdsCommandDict, self.Db): 
EdkLogger.error("build", COMMAND_FAILURE) Threshold = 
self.GetFreeSizeThreshold()@@ -2246,6 +2258,15 @@ class Build():
 fw.write("Arch=%s\n" % "|".join((Wa.ArchList))) 
fw.write("BuildDir=%s\n" % Wa.BuildDir) 
fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid))+
variable_i_filelist = os.path.join(Wa.BuildDir,"variable_i_filelist.txt")+  
  vfr_var_i = []+if GlobalData.gVfrYamlEnable:+for ma in 
self.AllModules:+vfr_var_i.extend(ma.VarIFiles)+
SaveFileOnChange(variable_i_fi

Re: [edk2-devel] ??: [PATCH 1/1] BaseTools: remove useless header inclusion

2023-01-29 Thread Bob Feng
There is no build failure on Linux. Refer to: 
https://github.com/tianocore/edk2/pull/3966

Thierry, would you update the patch to remove the -luuid in GNUMakefile too? 
And trigger a edk2 CI to test it?

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of 
tlaro...@polynum.com
Sent: Sunday, January 29, 2023 5:45 PM
To: devel@edk2.groups.io; Gao, Liming 
Cc: Feng, Bob C ; Chen, Christine 
Subject: Re: [edk2-devel] ??: [PATCH 1/1] BaseTools: remove useless header 
inclusion

Hello,

Le Sun, Jan 29, 2023 at 09:59:29AM +0800, gaoliming via groups.io a écrit :
> With this change, does GenFv pass build on Linux environment?

It should: there is absolutely nothing in GenFvInternalLib.c using
uuid_* or UUID_*. Furthermore, the API exposed by FreeBSD uuid.h and 
util-linux-ng uuid/uuid.h are totally different; so this is why I wondered, 
from the start, what the inclusions were achieving.

If the Linux build should fail, this would be by side-effect because a header 
included via uuid.h is missing.

I can not test a Linux environment: I have none.

BTW, in the patch, I should have removed the -luuid in GNUMakefile too.

> 
> > --
> > ???: tlaro...@polynum.com 
> > : 2023?1?26? 18:03
> > ???: devel@edk2.groups.io
> > ??: Bob Feng ; Liming Gao 
> > ; Yuwei Chen 
> > ??: [PATCH 1/1] BaseTools: remove useless header inclusion
> > 
> > GenFvInternalLib.c: useless inclusion and dependency on uuid.h.
> > 
> > From 6c0ba96fa11390750e102ebd277f59ef38970394 Mon Sep 17 00:00:00
> > 2001
> > From: Thierry LARONDE 
> > Date: Thu, 26 Jan 2023 10:49:12 +0100
> > Subject: [PATCH] Remove useless uuid.h include.
> > 
> > Signed-off-by: Thierry LARONDE 
> > ---
> >  BaseTools/Source/C/GenFv/GenFvInternalLib.c | 5 -
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
> > b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
> > index 6bd59515b1..2df7182f8b 100644
> > --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
> > +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
> > @@ -14,11 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  // 
> > Include files  //
> > 
> > -#if defined(__FreeBSD__)
> > -#include 
> > -#elif defined(__GNUC__)
> > -#include 
> > -#endif
> >  #ifdef __GNUC__
> >  #include 
> >  #endif
> > --
> > 2.39.0
> > 
> > --
> > Thierry Laronde 
> >  http://www.kergis.com/
> > http://kertex.kergis.com/ Key fingerprint = 0FF7 
> > E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
> 
> 
> 
> 
> 
> 
> 

-- 
Thierry Laronde 
 http://www.kergis.com/
http://kertex.kergis.com/ Key fingerprint = 0FF7 E906 FBAF 
FE95 FD89  250D 52B1 AE95 6006 F40C







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99282): https://edk2.groups.io/g/devel/message/99282
Mute This Topic: https://groups.io/mt/96603224/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] tools_def: Remove duplicated -Os

2023-01-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of PierreGondois
Sent: Wednesday, January 25, 2023 5:21 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Leif Lindholm 
; Ard Biesheuvel ; Sami 
Mujawar ; Laszlo Ersek 
Subject: [edk2-devel] [PATCH 1/1] tools_def: Remove duplicated -Os

From: Pierre Gondois 

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

commit 17bd834eb5fd ("BaseTools: Factorize GCC flags") makes GCC48_ALL_CC_FLAGS 
inherit from GCC_ALL_CC_FLAGS.
GCC_ALL_CC_FLAGS contains the '-Os' flag.
The latest flag in a command line overrides the previous optimization option. 
This allows more specific build configuration to override the inherited '-Os' 
flag.

If a build configuration includes GCC48_ALL_CC_FLAGS, hard-coded '-Os' options 
are not necessary anymore.
Remove them.

Reported-by: Laszlo Ersek 
Signed-off-by: Pierre Gondois 
---
 BaseTools/Conf/tools_def.template | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 380d4587335a..f77e936c0453 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2024,8 +2024,8 @@ DEFINE GCC5_LOONGARCH64_PP_FLAGS   = -mabi=lp64d 
-march=loongarch64 DEF(
 *_GCC48_IA32_OBJCOPY_FLAGS=
 *_GCC48_IA32_NASM_FLAGS   = -f elf32
 
-  DEBUG_GCC48_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS) -Os
-RELEASE_GCC48_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS) -Os 
-Wno-unused-but-set-variable
+  DEBUG_GCC48_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS)
+RELEASE_GCC48_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS) 
-Wno-unused-but-set-variable
   NOOPT_GCC48_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS) -O0
 
 ##
@@ -2052,8 +2052,8 @@ RELEASE_GCC48_IA32_CC_FLAGS   = 
DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but
 *_GCC48_X64_OBJCOPY_FLAGS=
 *_GCC48_X64_NASM_FLAGS   = -f elf64
 
-  DEBUG_GCC48_X64_CC_FLAGS   = DEF(GCC48_X64_CC_FLAGS) -Os
-RELEASE_GCC48_X64_CC_FLAGS   = DEF(GCC48_X64_CC_FLAGS) -Os 
-Wno-unused-but-set-variable
+  DEBUG_GCC48_X64_CC_FLAGS   = DEF(GCC48_X64_CC_FLAGS)
+RELEASE_GCC48_X64_CC_FLAGS   = DEF(GCC48_X64_CC_FLAGS) 
-Wno-unused-but-set-variable
   NOOPT_GCC48_X64_CC_FLAGS   = DEF(GCC48_X64_CC_FLAGS) -O0
 
 ##
@@ -2161,8 +2161,8 @@ RELEASE_GCC48_AARCH64_CC_FLAGS   = 
DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
 *_GCC49_IA32_OBJCOPY_FLAGS=
 *_GCC49_IA32_NASM_FLAGS   = -f elf32
 
-  DEBUG_GCC49_IA32_CC_FLAGS   = DEF(GCC49_IA32_CC_FLAGS) -Os
-RELEASE_GCC49_IA32_CC_FLAGS   = DEF(GCC49_IA32_CC_FLAGS) -Os 
-Wno-unused-but-set-variable -Wno-unused-const-variable
+  DEBUG_GCC49_IA32_CC_FLAGS   = DEF(GCC49_IA32_CC_FLAGS)
+RELEASE_GCC49_IA32_CC_FLAGS   = DEF(GCC49_IA32_CC_FLAGS) 
-Wno-unused-but-set-variable -Wno-unused-const-variable
   NOOPT_GCC49_IA32_CC_FLAGS   = DEF(GCC49_IA32_CC_FLAGS) -O0
 
 ##
@@ -2189,8 +2189,8 @@ RELEASE_GCC49_IA32_CC_FLAGS   = 
DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but
 *_GCC49_X64_OBJCOPY_FLAGS=
 *_GCC49_X64_NASM_FLAGS   = -f elf64
 
-  DEBUG_GCC49_X64_CC_FLAGS   = DEF(GCC49_X64_CC_FLAGS) -Os
-RELEASE_GCC49_X64_CC_FLAGS   = DEF(GCC49_X64_CC_FLAGS) -Os 
-Wno-unused-but-set-variable -Wno-unused-const-variable
+  DEBUG_GCC49_X64_CC_FLAGS   = DEF(GCC49_X64_CC_FLAGS)
+RELEASE_GCC49_X64_CC_FLAGS   = DEF(GCC49_X64_CC_FLAGS) 
-Wno-unused-but-set-variable -Wno-unused-const-variable
   NOOPT_GCC49_X64_CC_FLAGS   = DEF(GCC49_X64_CC_FLAGS) -O0
 
 ##
@@ -2304,10 +2304,10 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z 
common-page-size=0x20
 *_GCC5_IA32_OBJCOPY_FLAGS=
 *_GCC5_IA32_NASM_FLAGS   = -f elf32
 
-  DEBUG_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto -Os
+  DEBUG_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto
   DEBUG_GCC5_IA32_DLINK_FLAGS= DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os 
-Wl,-m,elf_i386,--oformat=elf32-i386
 
-RELEASE_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto -Os 
-Wno-unused-but-set-variable -Wno-unused-const-variable
+RELEASE_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto 
-Wno-unused-but-set-variable -Wno-unused-const-variable
 RELEASE_GCC5_IA32_DLINK_FLAGS= DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os 
-Wl,-m,elf_i386,--oformat=elf32-i386
 
   NOOPT_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -O0
@@ -2336,10 +2336,10 @@ RELEASE_GCC5_IA32_DLINK_FLAGS= 
DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,
 *_GCC5_X64_OBJCOPY_FLAGS =
 *_GCC5_X64_NASM_FLAGS= -f elf64
 
-  DEBUG_GCC5_X64_CC_FLAGS= DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os
+  DEBUG_GCC5_X64_CC_FLAGS= DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO
   DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS)

Re: [edk2-devel] [PATCH v2 0/4] BaseTools,ArmPkg,ArmVirtPkg: Remove leftover RVCT and RealView Debugger support

2023-01-29 Thread Bob Feng
Hi Ard,

I have no objections. For the patch series,

Acked-by: Bob Feng 


Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Ard Biesheuvel
Sent: Saturday, January 28, 2023 1:00 AM
To: devel@edk2.groups.io; rebe...@bsdio.com; Gao, Liming 
; Feng, Bob C 
Cc: Leif Lindholm ; Chen, Christine 
; Marvin Häuser 
Subject: Re: [edk2-devel] [PATCH v2 0/4] BaseTools,ArmPkg,ArmVirtPkg: Remove 
leftover RVCT and RealView Debugger support

On Fri, 27 Jan 2023 at 17:43, Rebecca Cran  wrote:
>
> Personal PR: https://github.com/tianocore/edk2/pull/3958
>
> Changes from v1 to v2:
>
> Removed reference to CYGWIN_NT-5.1-i686 from Scripts/PatchCheck.py 
> Removed RealView Debugger support and references.
>
> Rebecca Cran (4):
>   BaseTools: Delete Bin/{CYGWIN_NT-5.1-i686,Darwin-i386} directories
>   BaseTools: Remove CYGWIN_NT-5.1-i686 ref from Scripts/PatchCheck.py
>   ArmPkg: Remove RealView Debugger support
>   ArmVirtPkg: Remove RealView Debugger lines from ArmVirtPkg.dsc.inc
>

Thanks for the respin.

For the series,

Acked-by: Ard Biesheuvel 

Liming, Bob: unless there are any objections, I intend to merge this, including 
the BaseTools/ changes, beginning of next week.

Thanks,
Ard.


>  ArmVirtPkg/ArmVirt.dsc.inc  |   
> 7 -
>  ArmPkg/ArmPkg.dsc   |   
> 1 -
>  ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf  |  
> 35 -
>  ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c|   
> 5 -
>  ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c| 
> 147 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage  |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv   |   
> 5 -
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc|  
> 14 --
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage|  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc32   |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex   |  
> 14 --
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds |  
> 14 --
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv  |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw  |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage|  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector   |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress   |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress|  
> 17 ---
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource  |   
> 5 -
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/Split  |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool |  
> 14 --
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress  |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim   |  
> 14 --
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile |  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo|  
> 29 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py   |  
> 87 
>  BaseTools/Bin/CYGWIN_NT-5.1-i686/build  |  
> 14 --
>  BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib   | 
> Bin 36072 -> 0 bytes
>  BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib   | 
> Bin 36072 -> 0 bytes
>  
> BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE31/CompilerIntrinsicsLib.lib | Bin 
> 11504 -> 0 bytes  
> BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE32/CompilerIntrinsicsLib.lib | Bin 
> 11504 -> 0 bytes
>  BaseTools/Scripts/PatchCheck.py |   
> 1 -
>  37 files changed, 887 deletions(-)
>  delete mode 100644 
> ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf
>  delete mo

Re: [edk2-devel] [PATCH] Fix cyclic dependency error on OptionROM build

2023-01-17 Thread Bob Feng
Hi Konstantin,

EDK2 has not moved to PR for code review yet. Please still send patches to the 
mailing list. 
Package maintainers open PR for triggering CI and merging the patch.

Refer to: 
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Tuesday, January 17, 2023 4:24 PM
To: Feng, Bob C 
Cc: devel@edk2.groups.io; Jake Garver ; Gao, Liming 
; Chen, Christine 
Subject: Re: [edk2-devel] [PATCH] Fix cyclic dependency error on OptionROM build

Thanks, Bob!

Sorry, somehow I've missed it.
Has EDK2 moved to the GitHub PR system instead of a mailing list for patches?
Do I need to open PR for my subsequent patches, or just send them to the 
mailing list like before?

Best regards,
Konstatin Aladyshev



On Tue, Jan 17, 2023 at 8:17 AM Feng, Bob C  wrote:
>
> Konstantin,
>
>
>
> The patch missed “Signed-off-by:”, I help you add it and open a PR 
> https://github.com/tianocore/edk2/pull/3909 for merge.
>
>
>
> Thanks,
>
> Bob
>
> From: devel@edk2.groups.io  On Behalf Of Bob 
> Feng
> Sent: Tuesday, January 17, 2023 1:05 PM
> To: Jake Garver ; Konstantin Aladyshev 
> ; devel@edk2.groups.io
> Cc: Gao, Liming ; Chen, Christine 
> 
> Subject: Re: [edk2-devel] [PATCH] Fix cyclic dependency error on 
> OptionROM build
>
>
>
> Reviewed-by: Bob Feng 
>
>
>
> From: Jake Garver 
> Sent: Wednesday, December 14, 2022 2:48 AM
> To: Konstantin Aladyshev ; devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> ; Chen, Christine 
> Subject: Re: [PATCH] Fix cyclic dependency error on OptionROM build
>
>
>
> Thanks, Konstantin,
>
>
>
> I approve this version.
>
>
>
> Thanks,
>
> Jake
>
> 
>
> From: Konstantin Aladyshev 
> Sent: Tuesday, December 13, 2022 11:22 AM
> To: devel@edk2.groups.io 
> Cc: bob.c.f...@intel.com ; 
> gaolim...@byosoft.com.cn ; 
> yuwei.c...@intel.com ; Jake Garver 
> ; Konstantin Aladyshev 
> Subject: [PATCH] Fix cyclic dependency error on OptionROM build
>
>
>
> External email: Use caution opening links or attachments
>
>
> EDKII build system supports OptionROM generation if particular PCI_* 
> defines are present in the module INF file:
> ```
> [Defines]
>   ...
>   PCI_VENDOR_ID  = <...>
>   PCI_DEVICE_ID  = <...>
>   PCI_CLASS_CODE = <...>
>   PCI_REVISION   = <...>
> ```
> Although after the commit d372ab585a2cdc5348af5f701c56c631235fe698
> ("BaseTools/Conf: Fix Dynamic-Library-File template") it is no longer 
> possible.
> The build system fails with the error:
> ```
> Cyclic dependency detected while generating rule for 
> "<...>/DEBUG/<...>.efi" file ``` Remove 
> "$(DEBUG_DIR)(+)$(MODULE_NAME).efi" from the 'dll' output files to fix 
> the cyclic dependency.
> ---
>  BaseTools/Conf/build_rule.template | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/BaseTools/Conf/build_rule.template 
> b/BaseTools/Conf/build_rule.template
> index af4819de92..21ccd864fa 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -342,7 +342,6 @@
>
>
>  
>
>  $(OUTPUT_DIR)(+)$(MODULE_NAME).efi
>
> -$(DEBUG_DIR)(+)$(MODULE_NAME).efi
>
>  $(OUTPUT_DIR)(+)$(MODULE_NAME).map
>
>
>
>  
>
> --
> 2.34.1
>
> 







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98658): https://edk2.groups.io/g/devel/message/98658
Mute This Topic: https://groups.io/mt/95647902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] Fix cyclic dependency error on OptionROM build

2023-01-16 Thread Bob Feng
Reviewed-by: Bob Feng 

From: Jake Garver 
Sent: Wednesday, December 14, 2022 2:48 AM
To: Konstantin Aladyshev ; devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: Re: [PATCH] Fix cyclic dependency error on OptionROM build

Thanks, Konstantin,

I approve this version.

Thanks,
Jake

From: Konstantin Aladyshev mailto:aladyshe...@gmail.com>>
Sent: Tuesday, December 13, 2022 11:22 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>
Cc: bob.c.f...@intel.com<mailto:bob.c.f...@intel.com> 
mailto:bob.c.f...@intel.com>>; 
gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> 
mailto:gaolim...@byosoft.com.cn>>; 
yuwei.c...@intel.com<mailto:yuwei.c...@intel.com> 
mailto:yuwei.c...@intel.com>>; Jake Garver 
mailto:j...@nvidia.com>>; Konstantin Aladyshev 
mailto:aladyshe...@gmail.com>>
Subject: [PATCH] Fix cyclic dependency error on OptionROM build

External email: Use caution opening links or attachments


EDKII build system supports OptionROM generation if particular PCI_*
defines are present in the module INF file:
```
[Defines]
  ...
  PCI_VENDOR_ID  = <...>
  PCI_DEVICE_ID  = <...>
  PCI_CLASS_CODE = <...>
  PCI_REVISION   = <...>
```
Although after the commit d372ab585a2cdc5348af5f701c56c631235fe698
("BaseTools/Conf: Fix Dynamic-Library-File template") it is no longer
possible.
The build system fails with the error:
```
Cyclic dependency detected while generating rule for
"<...>/DEBUG/<...>.efi" file
```
Remove "$(DEBUG_DIR)(+)$(MODULE_NAME).efi" from the 'dll' output files
to fix the cyclic dependency.
---
 BaseTools/Conf/build_rule.template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index af4819de92..21ccd864fa 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -342,7 +342,6 @@


 

 $(OUTPUT_DIR)(+)$(MODULE_NAME).efi

-$(DEBUG_DIR)(+)$(MODULE_NAME).efi

 $(OUTPUT_DIR)(+)$(MODULE_NAME).map



 

--
2.34.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98638): https://edk2.groups.io/g/devel/message/98638
Mute This Topic: https://groups.io/mt/95647902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] 回复: [PATCH 1/1] BaseTools: Fix IA32 UINT64 alignment for CLANG toolchains

2022-12-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Wednesday, December 21, 2022 9:25 AM
To: 'Pedro Falcato' ; devel@edk2.groups.io
Cc: 'Marvin Häuser' ; Feng, Bob C ; 
Chen, Christine 
Subject: [edk2-devel] 回复: [PATCH 1/1] BaseTools: Fix IA32 UINT64 alignment for 
CLANG toolchains

This change is good to me. Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Pedro Falcato 
> 发送时间: 2022年12月17日 3:50
> 收件人: devel@edk2.groups.io
> 抄送: Pedro Falcato ; Marvin Häuser 
> ; Bob Feng ; Liming Gao 
> ; Yuwei Chen 
> 主题: [PATCH 1/1] BaseTools: Fix IA32 UINT64 alignment for CLANG 
> toolchains
> 
> Currently, UINT64 is not 8-byte aligned for CLANG* toolchains on IA32, 
> which causes ABI differences between IA32 and X64 in such simple 
> examples
> as:
> 
> struct S {UINT32 A; UINT64 B;};
> 
> Pass -malign-double to align it to 8 bytes, as is done for GCC already.
> 
> Signed-off-by: Pedro Falcato 
> Cc: Marvin Häuser 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> ---
>  BaseTools/Conf/tools_def.template | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template
> b/BaseTools/Conf/tools_def.template
> index c4e4c7ded0af..2c66a11ae31f 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -2618,15 +2618,15 @@ DEFINE CLANG38_ALL_CC_FLAGS =
> DEF(GCC48_ALL_CC_FLAGS) DEF(CLANG38_WARNIN
>  *_CLANG38_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS)
> DEF(CLANG38_IA32_TARGET)
>  *_CLANG38_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS)
> DEF(CLANG38_IA32_TARGET)
> 
> -DEBUG_CLANG38_IA32_CC_FLAGS =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANG38_IA32_TARGET) -g
> +DEBUG_CLANG38_IA32_CC_FLAGS =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANG38_IA32_TARGET) -g -malign-double
>  DEBUG_CLANG38_IA32_DLINK_FLAGS  =
> DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Wl,-Oz -Wl,-melf_i386
> -Wl,--oformat=elf32-i386
>  DEBUG_CLANG38_IA32_DLINK2_FLAGS =
> DEF(GCC5_IA32_DLINK2_FLAGS) -O3
> 
> -RELEASE_CLANG38_IA32_CC_FLAGS   =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANG38_IA32_TARGET)
> +RELEASE_CLANG38_IA32_CC_FLAGS   =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANG38_IA32_TARGET) -malign-double
>  RELEASE_CLANG38_IA32_DLINK_FLAGS=
> DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Wl,-Oz -Wl,-melf_i386
> -Wl,--oformat=elf32-i386
>  RELEASE_CLANG38_IA32_DLINK2_FLAGS   =
> DEF(GCC5_IA32_DLINK2_FLAGS) -O3
> 
> -NOOPT_CLANG38_IA32_CC_FLAGS =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -O0 -march=i586
> DEF(CLANG38_IA32_TARGET) -g
> +NOOPT_CLANG38_IA32_CC_FLAGS =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -O0 -march=i586
> DEF(CLANG38_IA32_TARGET) -g -malign-double
>  NOOPT_CLANG38_IA32_DLINK_FLAGS  =
> DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_i386
> -Wl,--oformat=elf32-i386
>  NOOPT_CLANG38_IA32_DLINK2_FLAGS =
> DEF(GCC5_IA32_DLINK2_FLAGS) -O0
> 
> @@ -2806,15 +2806,15 @@ DEFINE CLANGPDB_ALL_CC_FLAGS =
> DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARN
>  *_CLANGPDB_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS)
> DEF(CLANGPDB_IA32_TARGET)
>  *_CLANGPDB_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS)
> DEF(CLANGPDB_IA32_TARGET)
> 
> -DEBUG_CLANGPDB_IA32_CC_FLAGS =
> DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANGPDB_IA32_TARGET) -gcodeview
> +DEBUG_CLANGPDB_IA32_CC_FLAGS =
> DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANGPDB_IA32_TARGET) -gcodeview -malign-double
>  DEBUG_CLANGPDB_IA32_DLINK_FLAGS  = /NOLOGO
> /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32
> /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DEBUG:GHASH /MLLVM:-exception-model=wineh /lldmap
>  DEBUG_CLANGPDB_IA32_DLINK2_FLAGS =
> 
> -RELEASE_CLANGPDB_IA32_CC_FLAGS   =
> DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANGPDB_IA32_TARGET)
> +RELEASE_CLANGPDB_IA32_CC_FLAGS   =
> DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
> DEF(CLANGPDB_IA32_TARGET) -malign-double
>  RELEASE_CLANGPDB_IA32_DLINK_FLAGS= /NOLOGO /NODEFAULTLIB
> /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /ALIGN:32
> /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /MERGE:.rdata=.data /MLLVM:-exception-model=wineh 
> /lldmap
>  RELEASE_CLANGPDB_IA32_DLINK2_FLAGS   =
&g

Re: [edk2-devel] [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath

2022-12-29 Thread Bob Feng
Thank you for fixing this issue.

Reviewed-by: Bob Feng 

-Original Message-
From: Jake Garver  
Sent: Tuesday, December 20, 2022 9:14 PM
To: devel@edk2.groups.io
Cc: jbra...@nvidia.com; ashishsin...@nvidia.com; Feng, Bob C 
; Gao, Liming ; Chen, Christine 
; Jake Garver 
Subject: [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath

When checking the version in DevicePath's Makefile, use BUILD_CC instead of 
assuming "gcc".  BUILD_CC is set in header.makefile and is the compiler that 
will actually be used to build DevicePath.  It defaults to "gcc", but may be 
overridden.

Signed-off-by: Jake Garver 
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index 17f213879e..13b54ead65 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,7 +13,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION = $(shell $(BUILD_CC) -dumpversion | awk -F'.' '{print 
+$$1}')
 ifneq ("$(GCCVERSION)", "5")
 ifneq ($(CXX), llvm)
 ifneq ($(DARWIN),Darwin)
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97805): https://edk2.groups.io/g/devel/message/97805
Mute This Topic: https://groups.io/mt/95785320/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools: Generate deps for Arm targets

2022-12-29 Thread Bob Feng
This patch is good to me.

Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jake Garver via 
groups.io
Sent: Friday, December 9, 2022 12:22 AM
To: devel@edk2.groups.io; jbra...@nvidia.com; ashishsin...@nvidia.com
Cc: Jake Garver 
Subject: [edk2-devel] [PATCH] BaseTools: Generate deps for Arm targets

Prior to this change, deps were not generated for Arm and AARCH64 libraries 
when MODULE_TYPE was BASE, SEC, PEI_CORE, or PIEM. That resulted in bad 
incremental builds.

Signed-off-by: Jake Garver 
Reviewed-by: Jeff Brasen 
---
 BaseTools/Conf/build_rule.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index af4819de92..ec83638144 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -145,7 +145,7 @@
 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
 
 
-"$(CC)" $(CC_FLAGS) $(CC_XIPFLAGS) -c -o ${dst} $(INC) ${src}
+"$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) $(CC_XIPFLAGS) -c -o ${dst} 
+ $(INC) ${src}
 
 [C-Header-File]
 
--
2.17.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97804): https://edk2.groups.io/g/devel/message/97804
Mute This Topic: https://groups.io/mt/95541348/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 3/3] [edk2-staging]BaseTools: Add new build option for Variable default value generation

2022-12-29 Thread Bob Feng
Hi Christine,

Could you send out the entire patch series together?

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Yuwei Chen
Sent: Tuesday, November 15, 2022 4:47 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [edk2-devel] [Patch V2 3/3] [edk2-staging]BaseTools: Add new build 
option for Variable default value generation

Add new build option "--gen-default-variable-bin" for Variable default value 
generation from Python VFR tool's extended json output file.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/DataPipe.py |   2 ++
 BaseTools/Source/Python/AutoGen/GenDefaultVar.py| 577 
+
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py|   8 
 BaseTools/Source/Python/Common/GlobalData.py|   5 +
 BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py |  12 ++--
 BaseTools/Source/Python/build/build.py  |  19 
++-
 BaseTools/Source/Python/build/buildoptions.py   |   1 +
 7 files changed, 617 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py 
b/BaseTools/Source/Python/AutoGen/DataPipe.py
index c700baf7b7..e45b4a928a 100755
--- a/BaseTools/Source/Python/AutoGen/DataPipe.py
+++ b/BaseTools/Source/Python/AutoGen/DataPipe.py
@@ -173,3 +173,5 @@ class MemoryDataPipe(DataPipe):
 self.DataContainer = 
{"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds}  
self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable}++
self.DataContainer = {"GenDefaultVarBin": GlobalData.gGenDefaultVarBin}diff 
--git a/BaseTools/Source/Python/AutoGen/GenDefaultVar.py 
b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py
new file mode 100644
index 00..859d4f25eb
--- /dev/null
+++ b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py
@@ -0,0 +1,577 @@
+import json+from ctypes import *+import re+import copy+from struct import 
unpack+import os+import Common.EdkLogger as EdkLogger++class GUID(Structure):+  
  _fields_ = [+('Guid1',c_uint32),+('Guid2',
c_uint16),+('Guid3',c_uint16),+('Guid4',
ARRAY(c_uint8, 8)),+]++def from_list(self, listformat):+
self.Guid1 = listformat[0]+self.Guid2 = listformat[1]+
self.Guid3 = listformat[2]+for i in range(8):+self.Guid4[i] 
= listformat[i+3]++def __cmp__(self, otherguid):+if 
isinstance(otherguid, GUID):+return 1+rt = False+if 
self.Guid1 == otherguid.Guid1 and self.Guid2 == otherguid.Guid2 and self.Guid3 
== otherguid.Guid3:+rt = True+for i in range(8):+   
 rt = rt & (self.Guid4[i] == otherguid.Guid4[i])+return 
rt+++class TIME(Structure):+_fields_ = [+('Year', 
c_uint16),+('Month',c_uint8),+('Day',  
c_uint8),+('Hour', c_uint8),+('Minute',   
c_uint8),+('Second',   c_uint8),+('Pad1', 
c_uint8),+('Nanosecond',   c_uint32),+('TimeZone', 
c_uint16),+('Daylight', c_uint8),+('Pad2', 
c_uint8),+]+def __init__(self):+self.Year = 0x0+
self.Month = 0x0+self.Day = 0x0+self.Hour = 0x0+
self.Minute = 0x0+self.Second = 0x0+self.Pad1 = 0x0+
self.Nanosecond = 0x0+self.TimeZone = 0x0+self.Daylight = 0x0+  
  self.Pad2 = 0x0+++EFI_VARIABLE_GUID = [0xddcf3616, 0x3275, 0x4164,+   
  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 
0x7d]+EFI_AUTHENTICATED_VARIABLE_GUID = [+0xaaf32c78, 0x947b, 0x439a, 0xa1, 
0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92]++AuthVarGuid = 
GUID()+AuthVarGuid.from_list(EFI_AUTHENTICATED_VARIABLE_GUID)+VarGuid = 
GUID()+VarGuid.from_list(EFI_VARIABLE_GUID)++# Variable Store Header 
Format.+VARIABLE_STORE_FORMATTED = 0x5a+# Variable Store Header 
State.+VARIABLE_STORE_HEALTHY = 0xfe+++class VARIABLE_STORE_HEADER(Structure):+ 
   _fields_ = [+('Signature',GUID),+('Size',
 c_uint32),+('Format',   c_uint8),+ 
   ('State',

Re: [edk2-devel] [PATCH] S-ACM entry ver 0x200 does not contain requested FMS

2022-12-29 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chiang, Dakota  
Sent: Tuesday, December 27, 2022 5:23 PM
To: devel@edk2.groups.io
Cc: Chiang, Dakota ; Feng, Bob C 
; Gao, Liming ; Lin, Jason1 
; Kumar, Rahul R 
Subject: [PATCH] S-ACM entry ver 0x200 does not contain requested FMS

From: Dakota Chiang 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4198

After commit 1e1e35bb3b2fceea75ad97968da4b31f059dcb4c,
FIT Type 2 ACM entry is not generated as expected with given -I arguments.
FMS/FMS value is overridden by GetAcmFms().

This patch detects whether FMS/FMS Mask is already assigned with -I argument. 
If it's not zero, skip invoking GetAcmFms().

Signed-off-by: Dakota Chiang 

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Jason1 Lin 
Cc: Rahul R Kumar 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 4ba07945a6..16c8b9b026 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -3745,9 +3745,14 @@ FitGen (
 DumpAcm((ACM_FORMAT *)AcmBuffer);  if 
(gFitTableContext.StartupAcm[Index].Version >= 0x200) {-  
GetAcmFms((ACM_FORMAT *)AcmBuffer, [Index].FMS, 
[Index].FMSMask);-  printf("ACM 
FMS:%08x\n", gFitTableContext.StartupAcm[Index].FMS);-  printf("ACM 
FMS Mask:%08x\n", gFitTableContext.StartupAcm[Index].FMSMask);+  if 
((gFitTableContext.StartupAcm[Index].FMS == 0) && 
(gFitTableContext.StartupAcm[Index].FMSMask == 0)) {+//+
// FMS and FMSMask is not assigned via -I argument. Get it from ACM+
//+GetAcmFms((ACM_FORMAT *)AcmBuffer, 
[Index].FMS, 
[Index].FMSMask);+printf("ACM 
FMS:%08x\n", gFitTableContext.StartupAcm[Index].FMS);+
printf("ACM FMS Mask:%08x\n", gFitTableContext.StartupAcm[Index].FMSMask);+ 
 } }   }   else {-- 
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97802): https://edk2.groups.io/g/devel/message/97802
Mute This Topic: https://groups.io/mt/95906183/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 2/3] [edk2-staging]BaseTools: Add new build option for PyVfrCompiler yaml generation

2022-12-05 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Tuesday, November 15, 2022 4:46 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [Patch V2 2/3] [edk2-staging]BaseTools: Add new build option for 
PyVfrCompiler yaml generation

Add new build option "--vfr-yaml-enable" for Python VfrCompiler extended output 
yaml file generation.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/DataPipe.py  |  2 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py |  8 
 BaseTools/Source/Python/Common/GlobalData.py |  4 
 BaseTools/Source/Python/build/build.py   | 33 
+
 BaseTools/Source/Python/build/buildoptions.py|  1 +
 5 files changed, 48 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py 
b/BaseTools/Source/Python/AutoGen/DataPipe.py
index 848c7a8296..c700baf7b7 100755
--- a/BaseTools/Source/Python/AutoGen/DataPipe.py
+++ b/BaseTools/Source/Python/AutoGen/DataPipe.py
@@ -171,3 +171,5 @@ class MemoryDataPipe(DataPipe):
 self.DataContainer = 
{"EnableGenfdsMultiThread":GlobalData.gEnableGenfdsMultiThread}  
self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds}++ 
   self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable}diff --git 
a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index d05410b329..eb81c3f3af 100755
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -434,6 +434,14 @@ class ModuleAutoGen(AutoGen):
 def DebugDir(self): return _MakeDir((self.BuildDir, "DEBUG")) +
@cached_property+def VarIFiles(self):+rt = []+for SrcFile 
in self.SourceFileList:+if SrcFile.Ext.lower() == '.vfr':+  
  rt.append(os.path.join(self.OutputDir, "{}.i".format(SrcFile.BaseName)))+ 
   return rt+ ## Return the path of custom file @cached_property
 def CustomMakefile(self):diff --git 
a/BaseTools/Source/Python/Common/GlobalData.py 
b/BaseTools/Source/Python/Common/GlobalData.py
index 197bd83666..039a9648aa 100755
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -123,3 +123,7 @@ gSikpAutoGenCache = set()  # Common lock for the file 
access in multiple process AutoGens file_lock = None +#+# Build flag for 
generate Yaml file from Vfr file+#+gVfrYamlEnable = Falsediff --git 
a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index 51fb1f433e..7e2f25686d 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -748,6 +748,7 @@ class Build():
 GlobalData.gBinCacheSource = BuildOptions.BinCacheSource 
GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread  
   GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck+  
  GlobalData.gVfrYamlEnable = BuildOptions.VfrYamlEnable  if 
GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: 
EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination 
must be used together with --hash.")@@ -1460,6 +1461,17 @@ class Build():
  # genfds if Target == 'fds':+if 
GlobalData.gVfrYamlEnable:+from VfrCompiler.main import 
VfrParse+variable_i_filelist = 
os.path.join(AutoGenObject.BuildDir,"variable_i_filelist.txt")+
if os.path.exists(variable_i_filelist):+with 
open(variable_i_filelist) as file:+i_filelist = 
file.readlines()+for i_file in i_filelist:+ 
   inputfile = i_file.replace("\n", "")+
yamloutputfile = inputfile.split(".")[0] + '.yaml'+
jsonoutputfile = inputfile.split(".")[0] + '.json'+
VfrParse(inputfile, yamloutputfile, jsonoutputfile) if 
GenFdsApi(AutoGenObject.GenFdsCommandDict, self.Db): 
EdkLogger.error("build", COMMAND_FAILURE) Threshold = 
self.GetFreeSizeThreshold()@@ -2246,6 +2258,15 @@ class Build():
 fw.write("Arch=%s\n" % "|".join((Wa.ArchList))) 
fw.write("BuildDir=%s\n" % Wa.BuildDir) 
fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid))+
variable_i_filelist = os.path.join(Wa.BuildDir,"variable_i_filelist.txt")+  
  vfr_var_i = []+if GlobalData.gVfrYamlEnable:+for ma in 
self.AllModules:+vfr_var_i.extend(ma.VarIFiles)+
SaveFileOnChange(variable_i_fi

Re: [edk2-devel] [PATCH] Silicon/Intel/FitGen:FitGen Supporting MultiFIT 2 rc

2022-11-21 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Kumar, Rahul R  
Sent: Wednesday, November 16, 2022 9:58 AM
To: devel@edk2.groups.io; Feng, Bob C ; Gao, Liming 
; Chen, Christine ; Oram, Isaac 
W ; Chaganty, Rangasai V 
; West, Catharine 
Cc: Kumar, Rahul R 
Subject: [PATCH] Silicon/Intel/FitGen:FitGen Supporting MultiFIT 2 rc

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4155

With new implementation, FITGEN will populate info needed
for the PROT assisted BootGuard solution and TXT on servers
using FIT 4 Entry. FitGen based on the CPU FMS FITGEN will
decide to call one of the two Type 2 FIT entry.

Signed-off-by: Rahul R Kumar 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 1186 ---
 Silicon/Intel/Tools/FitGen/FitGen.h |7 +-
 2 files changed, 722 insertions(+), 471 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 87123f9922..4ba07945a6 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -44,11 +44,18 @@ typedef struct {
 #define BIOS_MODULE_ALIGNMENT  0x3F  // 64 bytes for AnC

 #define MICROCODE_ALIGNMENT0x7FF

 

+#define MICROCODE_EXTERNAL_HEADER_SIZE 0x30

+

 #define ACM_PKCS_1_5_RSA_SIGNATURE_SHA256_SIZE  256

 #define ACM_PKCS_1_5_RSA_SIGNATURE_SHA384_SIZE  384

 

-#define ACM_HEADER_VERSION_3  (3 << 16)

-#define ACM_HEADER_VERSION_0  (0)

+#define ACM_XMSS_PUBLIC_KEY_SIZE64

+#define ACM_XMSS_SIGNATURE_SIZE 2692

+

+#define ACM_HEADER_VERSION_50x50004

+#define ACM_HEADER_VERSION_4(4 << 16)

+#define ACM_HEADER_VERSION_3(3 << 16)

+#define ACM_HEADER_VERSION_0(0)

 #define ACM_MODULE_TYPE_CHIPSET_ACM 2

 #define ACM_MODULE_SUBTYPE_CAPABLE_OF_EXECUTE_AT_RESET  0x1

 #define ACM_MODULE_SUBTYPE_ANC_MODULE   0x2

@@ -56,6 +63,37 @@ typedef struct {
 #define ACM_MODULE_FLAG_DEBUG_SIGN  0x8000

 

 #define NIBBLES_TO_BYTE(A, B)  (UINT8)(((A & (0x0F)) << 4) | (B & 0x0F))

+//

+//Flash Map 0 Register (Flash Descriptor Records)

+//

+typedef struct {

+  UINT32  Fcba : 8;  //Bits[7:0]: Flash Component Base Address

+  UINT32  Nc   : 2;  //Bits[9:8]: Number of Components

+  UINT32  Rsvd0: 1;  //Bit10: Reserved

+  UINT32  Rsvd1: 1;  //Bit11: Reserved

+  UINT32  Rsvd2: 1;  //Bit12: Reserved

+  UINT32  Rsvd3: 3;  //Bits[15:13]: Reserved

+  UINT32  Frba : 8;  //Bits[23:16]: Flash Region Base Address

+  UINT32  Rsvd4: 3;  //Bits[26:24]: Reserved

+  UINT32  Rsvd5: 5;  //Bits[31:27]: Reserved

+} FLASH_MAP_0_REGISTER;

+

+//

+//Flash Region 1 (BIOS) Register (Flash Descriptor Records)

+//

+typedef struct {

+  UINT32  RegionBase : 15;  //Bits[14:0]: Region base

+  UINT32  Rsvd   : 1;   //Bit15: Reserved

+  UINT32  RegionLimit: 15;  //Bits[30:16]: Region limit

+  UINT32  Rsvd1  : 1;   //Bit31: Reserved

+} FLASH_REGION_1_BIOS_REGISTER;

+

+#define FLASH_VALID_SIGNATURE   0x0FF0A55A   //Flash 
Valid Signature (Flash Descriptor Records)

+#define FLVALSIG_BASE_OFFSET0x10 //Flash 
Valid Signature Base Offset

+#define FLMAP0_BASE_OFFSET  0x14 //Flash 
Map 0 Register Base Offset

+

+#define ACMFV_GUID \

+  { 0x8a4b197f, 0x1113, 0x43d0, { 0xa2, 0x3f, 0x26, 0xf3, 0x69, 0xb2, 0xb8, 
0x41 }}

 

 typedef struct {

   UINT16 ModuleType;

@@ -98,6 +136,8 @@ typedef struct {
 #define CHIPSET_ACM_TYPE_BIOS   0

 #define CHIPSET_ACM_TYPE_SINIT  1

 

+#define DEFAULT_ACM_EXTENDED_MASK 0x00FF

+

 typedef struct {

   UINT32Guid0;

   UINT32Guid1;

@@ -238,6 +278,7 @@ typedef struct {
 #define FIT_TABLE_TYPE_MICROCODE   1

 #define FIT_TABLE_TYPE_STARTUP_ACM 2

 #define FIT_TABLE_TYPE_DIAGNST_ACM 3

+#define FIT_TABLE_TYPE_PROT_BOOT_POLICY4

 #define FIT_TABLE_TYPE_BIOS_MODULE 7

 #define FIT_TABLE_TYPE_TPM_POLICY  8

 #define FIT_TABLE_TYPE_BIOS_POLICY 9

@@ -252,7 +293,6 @@ typedef struct {
 #define FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST 27

 #define FIT_TABLE_TYPE_VAB_BOOT_KEY_MANIFEST   28

 

-

 //

 // With OptionalModule Address isn't known until free space has been

 // identified and the optional module has been copied into the FLASH

@@ -284,9 +324,10 @@ typedef struct {
   UINT32 GlobalVersion;

   UINT32 FitHeaderVersion;

   FIT_TABLE_CONTEXT_ENTRYStartupAcm[MAX_STARTUP_ACM_ENTRY];

-  UINT32 StartupAcmVersion[MAX_STARTUP_ACM_ENTRY];

+  UINT32 StartupAcmFvSize;

   FIT_TABLE_CONTEXT_ENTRYDiagnstAcm;

   UINT32  

Re: [edk2-devel] [Patch 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output

2022-11-04 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Kinney, Michael D  
Sent: Friday, November 4, 2022 11:31 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [Patch 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml 
output

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134

Set environment variable GTEST_OUTPUT to specify the output format of XML and 
the output file name.  Both CMOCKA_XML_FILE and GTEST_OUTPUT are set for each 
host based unit test to support both cmocka unit tests and gtest unit tests.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Michael D Kinney 
---
 .../HostBasedUnitTestRunner/HostBasedUnitTestRunner.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py 
b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
index c1eeaf26251e..a8220aacd396 100644
--- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
+++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.p
+++ y
@@ -85,9 +85,12 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin):
 raise NotImplementedError("Unsupported Operating System")
 
 for test in testList:
-# Configure output name.
+# Configure output name if test uses cmocka.
 shell_env.set_shell_var(
-'CMOCKA_XML_FILE', test + ".%g." + arch + ".result.xml")
+'CMOCKA_XML_FILE', test + ".CMOCKA.%g." + arch + 
".result.xml")
+# Configure output name if test uses gtest.
+shell_env.set_shell_var(
+'GTEST_OUTPUT', "xml:" + test + ".GTEST." + arch + 
+ ".result.xml")
 
 # Run the test.
 ret = RunCmd('"' + test + '"', "", workingdir=cp)
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95954): https://edk2.groups.io/g/devel/message/95954
Mute This Topic: https://groups.io/mt/94799430/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-31 Thread Bob Feng
Hi Pavamana,

This is the output on my side.

py -3 BaseTools\Scripts\PatchCheck.py 
edk2-devel]-[PATCH-v2]-edk2Platforms-Silicon-Add-VAB-FIT-record-types-support-in-FitGen.c.patch
Checking patch file: 
edk2-devel]-[PATCH-v2]-edk2Platforms-Silicon-Add-VAB-FIT-record-types-support-in-FitGen.c.patch
The 'Author' email address is not valid:
* Add quotes (") around name with a comma: Hv, Pavamana
[PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c
The commit message format is not valid:
* First line of commit message (subject line) is too long (77 >= 76).
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format
The code passed all checks.



Thanks,
Bob

From: Hv, Pavamana 
Sent: Friday, October 28, 2022 10:08 PM
To: Feng, Bob C ; devel@edk2.groups.io; Gao, Liming 
; Holland, Michael ; 
Chaganty, Rangasai V ; Lohr, Paul A 

Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Hi Bob,
I had run the check and ran it again and this is what I get

C:\Work\Tianocore\edk2-platforms> c:\python38\python 
..\edk2\BaseTools\Scripts\PatchCheck.py 
.\0001-edk2Platforms-Silicon-Add-VAB-FIT-record-types-suppo.patch
Checking patch file: 
.\0001-edk2Platforms-Silicon-Add-VAB-FIT-record-types-suppo.patch
edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c
The commit message format passed all checks.
The code passed all checks.

I am not sure what you are seeing. Can you please paste your output? Am I 
missing something?

Regards,
Pavamana

From: Feng, Bob C mailto:bob.c.f...@intel.com>>
Sent: Thursday, October 27, 2022 10:33 PM
To: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; Holland, Michael 
mailto:michael.holl...@intel.com>>; Hv, Pavamana 
mailto:pavamana...@intel.com>>; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Hi Pavamana,

I found there are few patch format issues.  Please use 
edk2\BaseTools\Scripts\PatchCheck.py to check the patch and fix them. After 
that, I’ll merge it.

Thanks,
Bob

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of gaoliming via 
groups.io
Sent: Friday, October 28, 2022 9:11 AM
To: Holland, Michael 
mailto:michael.holl...@intel.com>>; Hv, Pavamana 
mailto:pavamana...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Michael:
 Thanks for your sharing.

Pavamana:
 FIT spec 1.4 has been published. So, this change can be merged now.

Thanks
Liming
发件人: Holland, Michael 
mailto:michael.holl...@intel.com>>
发送时间: 2022年10月28日 1:41
收件人: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
Hv, Pavamana mailto:pavamana...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Hi Liming,

Please see published FIT spec 1.4:  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/software-and-services/firmware-and-bios/firmware-interface-table/

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Wednesday, October 26, 2022 07:59 PM
To: Hv, Pavamana mailto:pavamana...@intel.com>>; 
Holland, Michael mailto:michael.holl...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Pavamana:
 The change should be merged after new FIT spec is published, because FitGen 
tool follows the public FIT spec.

Thanks
Liming
发件人: Hv, Pavamana mailto:pavamana...@intel.com>>
发送时间: 2022年10月26日 23:13
收件人: Holland, Michael 
mailto:michael.holl...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Thanks for the review, Liming.
@Feng, Bob C,
What is the next step to merge the change?
Let me know if anything is needed from me.
Thanks for your help again.
Regards,
Pavamana


From: Holland, Michael 

Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-27 Thread Bob Feng
Hi Pavamana,

I found there are few patch format issues.  Please use 
edk2\BaseTools\Scripts\PatchCheck.py to check the patch and fix them. After 
that, I’ll merge it.

Thanks,
Bob

From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Friday, October 28, 2022 9:11 AM
To: Holland, Michael ; Hv, Pavamana 
; devel@edk2.groups.io; Chaganty, Rangasai V 
; Lohr, Paul A ; Feng, 
Bob C 
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Michael:
 Thanks for your sharing.

Pavamana:
 FIT spec 1.4 has been published. So, this change can be merged now.

Thanks
Liming
发件人: Holland, Michael 
mailto:michael.holl...@intel.com>>
发送时间: 2022年10月28日 1:41
收件人: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
Hv, Pavamana mailto:pavamana...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Hi Liming,

Please see published FIT spec 1.4:  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/software-and-services/firmware-and-bios/firmware-interface-table/

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Wednesday, October 26, 2022 07:59 PM
To: Hv, Pavamana mailto:pavamana...@intel.com>>; 
Holland, Michael mailto:michael.holl...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Pavamana:
 The change should be merged after new FIT spec is published, because FitGen 
tool follows the public FIT spec.

Thanks
Liming
发件人: Hv, Pavamana mailto:pavamana...@intel.com>>
发送时间: 2022年10月26日 23:13
收件人: Holland, Michael 
mailto:michael.holl...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Thanks for the review, Liming.
@Feng, Bob C,
What is the next step to merge the change?
Let me know if anything is needed from me.
Thanks for your help again.
Regards,
Pavamana


From: Holland, Michael 
mailto:michael.holl...@intel.com>>
Sent: Tuesday, October 25, 2022 8:36 PM
To: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Hi Liming,

The spec is in process of being published.

@Chaganty, Rangasai V @Lohr, Paul 
A

Any update on FIT spec being published?

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Tuesday, October 25, 2022 09:18 PM
To: devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c


Pavamana:

 The code change looks good. Now,  is FIT spec 1.4 public to be downloaded?

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 Hv, Pavamana
发送时间: 2022年10月26日 5:50
收件人: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
抄送: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
主题: Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c
重要性: 高

Hi Liming,
Any update on this? Please treat this with urgency as we have a release coming 
up and needs this change.

-Pavamana

From: Hv, Pavamana
Sent: Monday, October 24, 2022 10:05 AM
To: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: RE: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support 
in FitGen.c


@Gao, Liming,

Can you please review the patch and let me know if this can be merged?

Thanks in advance for your help.

Regards,

Pavamana



-Original Message-
From: Hv, Pavamana mailto:pavamana...@intel.com>>
Sent: Wednesday, October 19, 2022 8:57 PM

Re: [edk2-devel] [PATCH] BaseTools/Tests: Use quotes around PYTHON_COMMAND

2022-10-24 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Ard Biesheuvel
Sent: Monday, October 24, 2022 2:17 PM
To: devel@edk2.groups.io
Cc: quic_llind...@quicinc.com; Gao, Liming ; Feng, 
Bob C ; rebe...@bsdio.com; Ard Biesheuvel 

Subject: [edk2-devel] [PATCH] BaseTools/Tests: Use quotes around PYTHON_COMMAND

Commit ("2355f0c09c52 BaseTools: Fix check for ${PYTHON_COMMAND} in
Tests/GNUmakefile") fixed a latent issue in the BaseTools/Tests Makefile, but 
inadvertently broke the BaseTools build for cases where PYTHON_COMMAND is not 
set. As it turns out, running 'command' without a command argument makes the 
invocation succeed, causing the empty variable to be evaluated and called later.

Let's put double quotes around PYTHON_COMMAND in the invocation of 'command' 
and force it to fail when PYTHON_COMMAND is not set.

Signed-off-by: Ard Biesheuvel 
---
 BaseTools/Tests/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile index 
caa4d26c9ba6..20b387864f74 100644
--- a/BaseTools/Tests/GNUmakefile
+++ b/BaseTools/Tests/GNUmakefile
@@ -8,7 +8,7 @@
 all: test  test:-  @if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then 
${PYTHON_COMMAND} RunTests.py; else python RunTests.py; fi+  @if command -v 
"${PYTHON_COMMAND}" >/dev/null 2>&1; then ${PYTHON_COMMAND} RunTests.py; else 
python RunTests.py; fi  clean: find . -name '*.pyc' -exec rm '{}' ';'-- 
2.35.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95492): https://edk2.groups.io/g/devel/message/95492
Mute This Topic: https://groups.io/mt/94528814/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95502): https://edk2.groups.io/g/devel/message/95502
Mute This Topic: https://groups.io/mt/94528814/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] remove GCC build warning

2022-10-23 Thread Bob Feng
Reviewed-by: Bob Feng 

Thanks,
Bob

-Original Message-
From: Wu, JessyX  
Sent: Tuesday, October 4, 2022 10:04 AM
To: devel@edk2.groups.io
Cc: Wu, JessyX ; Feng, Bob C ; Gao, 
Liming ; Chen, Christine 
Subject: [PATCH v3] remove GCC build warning

Fix gcc: warning:
 -x c after last input file has no effect

These kind of flag can only affect the source code after them.
For the build command in build_rule.template, we have no other source code or 
object after these two flag.
It seems we don't need them here.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: JessyX Wu 
---
 BaseTools/Conf/build_rule.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index 5895b48fd8..af4819de92 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -463,7 +463,7 @@
 
 
 "$(ASLCC)" $(DEPS_FLAGS) -c -o 
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) 
$(DEPS_FLAGS) $(INC) ${src}
-"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) 
$(ASLCC_FLAGS)
+"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
 "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(GENFW_FLAGS)
 
 
-- 
2.37.3.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95490): https://edk2.groups.io/g/devel/message/95490
Mute This Topic: https://groups.io/mt/94106021/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] BaseTools: Fixed the multiple pairs brackets issue in GenFv

2022-10-22 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chao Li
Sent: Thursday, October 20, 2022 5:25 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [edk2-devel] [PATCH v2] BaseTools: Fixed the multiple pairs brackets 
issue in GenFv

If operation Werro is turned on when compiling BaseTools, the multi-brackets 
warning will be reported. This issue is comes from on of the LoongArch enabled 
patche. Removed extra pairs brackets to fix it.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4111

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Chao Li 
---
 BaseTools/Source/C/GenFv/GenFvInternalLib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c 
b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index 5c3d54f5f7..b5b9425003 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -3559,7 +3559,7 @@ Returns:
   }// Machine type is LOONGARCH64, set a flag so LoongArch64 reset 
vector processed.-  if ((MachineType == EFI_IMAGE_MACHINE_LOONGARCH64)) {+  
if (MachineType == EFI_IMAGE_MACHINE_LOONGARCH64) { 
VerboseMsg("Located LoongArch64 SEC core in child FV"); mLoongArch = 
TRUE;   }@@ -3721,7 +3721,7 @@ Returns:
   mRiscV = TRUE; } -if ( (ImageContext.Machine == 
EFI_IMAGE_MACHINE_LOONGARCH64) ) {+if (ImageContext.Machine == 
EFI_IMAGE_MACHINE_LOONGARCH64) {   mLoongArch = TRUE; } @@ -4002,7 
+4002,7 @@ Returns:
   mArm = TRUE; } -if ( (ImageContext.Machine == 
EFI_IMAGE_MACHINE_LOONGARCH64) ) {+if (ImageContext.Machine == 
EFI_IMAGE_MACHINE_LOONGARCH64) {   mLoongArch = TRUE; } -- 
2.27.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95422): https://edk2.groups.io/g/devel/message/95422
Mute This Topic: https://groups.io/mt/94450039/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95482): https://edk2.groups.io/g/devel/message/95482
Mute This Topic: https://groups.io/mt/94450039/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-22 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Hv, Pavamana
Sent: Thursday, October 20, 2022 11:57 AM
To: devel@edk2.groups.io
Cc: Hv, Pavamana 
Subject: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4086

This commit adds support for new FIT record type for Vendor Authorized Boot 
(VAB) security technology(FIT spec revision 1.4).
VAB defines 3 new following types
Vendor Authorized Boot Provisioning Table (Type 0x1A) Vendor Authorized Boot 
Image Manifest (Type 0x1B) Vendor Authorized Boot Key Manifest (Type 0x1C) The 
code has been updated to align these binaries on 64 byte boundary and not to 
overlap with other regions, similar to Key manifest, Boot Policy manifest and 
other optional types.

Also added macros to define FIT spec Major and Minor version numbers and print 
the same instead of hardcoded string.

Signed-off-by: Pavamana Holavanahalli 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 61 +++--  
Silicon/Intel/Tools/FitGen/FitGen.h |  5 ++-
 2 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 21dfcf1ebb..87123f9922 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -234,20 +234,24 @@ typedef struct {
 #define FLASH_TO_MEMORY(Address, FvBuffer, FvSize)  \  (VOID 
*)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (TOP_FLASH_ADDRESS - 
(UINTN)(Address))) -#define FIT_TABLE_TYPE_HEADER 0-#define 
FIT_TABLE_TYPE_MICROCODE  1-#define FIT_TABLE_TYPE_STARTUP_ACM  
  2-#define FIT_TABLE_TYPE_DIAGNST_ACM3-#define 
FIT_TABLE_TYPE_BIOS_MODULE7-#define FIT_TABLE_TYPE_TPM_POLICY   
  8-#define FIT_TABLE_TYPE_BIOS_POLICY9-#define 
FIT_TABLE_TYPE_TXT_POLICY 10-#define FIT_TABLE_TYPE_KEY_MANIFEST
   11-#define FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST   12-#define 
FIT_TABLE_TYPE_BIOS_DATA_AREA 13-#define FIT_TABLE_TYPE_CSE_SECURE_BOOT 
   16-#define FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST  12-#define 
FIT_TABLE_SUBTYPE_ACM_MANIFEST13+#define FIT_TABLE_TYPE_HEADER  
0+#define FIT_TABLE_TYPE_MICROCODE   1+#define 
FIT_TABLE_TYPE_STARTUP_ACM 2+#define FIT_TABLE_TYPE_DIAGNST_ACM 
3+#define FIT_TABLE_TYPE_BIOS_MODULE 7+#define 
FIT_TABLE_TYPE_TPM_POLICY  8+#define FIT_TABLE_TYPE_BIOS_POLICY 
9+#define FIT_TABLE_TYPE_TXT_POLICY  10+#define 
FIT_TABLE_TYPE_KEY_MANIFEST11+#define 
FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST12+#define 
FIT_TABLE_TYPE_BIOS_DATA_AREA  13+#define 
FIT_TABLE_TYPE_CSE_SECURE_BOOT 16+#define 
FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST   12+#define 
FIT_TABLE_SUBTYPE_ACM_MANIFEST 13+#define 
FIT_TABLE_TYPE_VAB_PROVISION_TABLE 26+#define 
FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST 27+#define 
FIT_TABLE_TYPE_VAB_BOOT_KEY_MANIFEST   28+  // // With OptionalModule 
Address isn't known until free space has been@@ -322,8 +326,10 @@ Returns:
 --*/ {   printf (-"%s - Tiano IA32/X64 FIT table generation Utility for 
FIT spec revision 1.2."" Version %i.%i\n\n",+"%s - Tiano IA32/X64 FIT table 
generation Utility for FIT spec revision %i.%i."" Version %i.%i\n\n", 
UTILITY_NAME,+FIT_SPEC_VERSION_MAJOR,+FIT_SPEC_VERSION_MINOR, 
UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION );@@ -1956,7 +1962,10 @@ 
Returns:
 (gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_KEY_MANIFEST) || 
(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST) || 
(gFitTableContext.OptionalModule[Index].Type == FIT_TABLE_TYPE_BIOS_DATA_AREA) 
||-(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_CSE_SECURE_BOOT)) {+
(gFitTableContext.OptionalModule[Index].Type == FIT_TABLE_TYPE_CSE_SECURE_BOOT) 
||+(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_VAB_PROVISION_TABLE) ||+
(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST) ||+
(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_VAB_BOOT_KEY_MANIFEST)) {   // NOTE: It might be virtual 
address now. Just put a place holder.   FitEntryNumber ++; }@@ -2154,8 
+2163,11 @@ Returns:
   (gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_KEY_MANIFEST) ||   
(gFitTableContext.OptionalModule[Index].Type == 
FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST) ||   
(gFitTableContext.OptionalModule[Index].Type == FIT_TABLE_TYPE_BIOS_DATA_AREA) 
||-  (gFitTableContext.OptionalModule[Index]

Re: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Allow tab in Makefile

2022-10-18 Thread Bob Feng
Hi Liming, Christine,

Please help review this patch. 

This patch can unblock the CI test for the change of Makefile/GNUmakefile.
https://github.com/tianocore/edk2/pull/3436


Thanks,
Bob
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Sunday, October 16, 2022 11:41 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Allow tab in 
Makefile

The syntax for Makefiles requires that indented lines s tart with a tab, but 
not a space.

This change of PatchCheck.py make the patch for Makefile/GNUmakefile pass the 
PatchCheck.py.

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 BaseTools/Scripts/PatchCheck.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py 
index 63e6223f8ebc..475b3a8c27d9 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -383,6 +383,9 @@ class GitDiffCheck:
 #
 self.force_crlf = False
 self.force_notabs = False
+if os.path.basename(self.filename) == 'GNUmakefile' or \
+   os.path.basename(self.filename) == 'Makefile':
+self.force_notabs = False
 elif len(line.rstrip()) != 0:
 self.format_error("didn't find diff command")
 self.line_num += 1
--
2.37.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95355): https://edk2.groups.io/g/devel/message/95355
Mute This Topic: https://groups.io/mt/94358945/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.29 to 0.1.39

2022-10-18 Thread Bob Feng
Hi Liming, Christine,

Please review this patch.

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Sunday, October 16, 2022 8:11 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools 
version from 0.1.29 to 0.1.39

features and bug fixes:
1. Revert "BaseTools: Fix DSC LibraryClass precedence rule"
2. BaseTools: Correct BPDG tool error prints 3. BaseTools: Remove duplicated 
words in Python tools 4. BaseTools/FMMT: Add Extract FV function 5. 
BaseTools/FMMT: Add Shrink Fv function 6. BaseTools: Add support for 
SUBTYPE_GUID section generation 7. BaseTools: Support COMPAT16 section 
generation 8. BaseTools/GenFds: Correct file type set for the PIC section 9. 
BaseTools: Correct initialization data size check for array PCDs 10. BaseTools: 
Add missing spaces for PCD expression values in AutoGenC

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt index 
967da7cb3783..40e9ad72ee4f 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.29
+edk2-basetools==0.1.39
 antlr4-python3-runtime==4.7.1
--
2.37.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95347): https://edk2.groups.io/g/devel/message/95347
Mute This Topic: https://groups.io/mt/94360785/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.29 to 0.1.39

2022-10-16 Thread Bob Feng
features and bug fixes:
1. Revert "BaseTools: Fix DSC LibraryClass precedence rule"
2. BaseTools: Correct BPDG tool error prints
3. BaseTools: Remove duplicated words in Python tools
4. BaseTools/FMMT: Add Extract FV function
5. BaseTools/FMMT: Add Shrink Fv function
6. BaseTools: Add support for SUBTYPE_GUID section generation
7. BaseTools: Support COMPAT16 section generation
8. BaseTools/GenFds: Correct file type set for the PIC section
9. BaseTools: Correct initialization data size check for array PCDs
10. BaseTools: Add missing spaces for PCD expression values in AutoGenC

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 967da7cb3783..40e9ad72ee4f 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.29
+edk2-basetools==0.1.39
 antlr4-python3-runtime==4.7.1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95265): https://edk2.groups.io/g/devel/message/95265
Mute This Topic: https://groups.io/mt/94360785/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.29 to 0.1.39

2022-10-16 Thread Bob Feng
features and bug fixes:
1. Revert "BaseTools: Fix DSC LibraryClass precedence rule"
2. BaseTools: Correct BPDG tool error prints
3. BaseTools: Remove duplicated words in Python tools
4. BaseTools/FMMT: Add Extract FV function
5. BaseTools/FMMT: Add Shrink Fv function
6. BaseTools: Add support for SUBTYPE_GUID section generation
7. BaseTools: Support COMPAT16 section generation
8. BaseTools/GenFds: Correct file type set for the PIC section
9. BaseTools: Correct initialization data size check for array PCDs
10. BaseTools: Add missing spaces for PCD expression values in AutoGenC

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 967da7cb3783..40e9ad72ee4f 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.29
+edk2-basetools==0.1.39
 antlr4-python3-runtime==4.7.1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95264): https://edk2.groups.io/g/devel/message/95264
Mute This Topic: https://groups.io/mt/94360785/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Allow tab in Makefile

2022-10-15 Thread Bob Feng
The syntax for Makefiles requires that indented lines s
tart with a tab, but not a space.

This change of PatchCheck.py make the patch for Makefile/GNUmakefile
pass the PatchCheck.py.

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 BaseTools/Scripts/PatchCheck.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 63e6223f8ebc..475b3a8c27d9 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -383,6 +383,9 @@ class GitDiffCheck:
 #
 self.force_crlf = False
 self.force_notabs = False
+if os.path.basename(self.filename) == 'GNUmakefile' or \
+   os.path.basename(self.filename) == 'Makefile':
+self.force_notabs = False
 elif len(line.rstrip()) != 0:
 self.format_error("didn't find diff command")
 self.line_num += 1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95263): https://edk2.groups.io/g/devel/message/95263
Mute This Topic: https://groups.io/mt/94358945/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] remove GCC build warning

2022-10-02 Thread Bob Feng
Hi Jessy,

Could you provide more details in the commit message?
Also, please remove "Change-Id: I743d47ed0cb9d2c0c099af461fa1d5e9024d9526" from 
the commit message.

Thanks,
Bob

-Original Message-
From: Wu, JessyX  
Sent: Monday, September 26, 2022 9:15 AM
To: devel@edk2.groups.io
Cc: Wu, JessyX ; Feng, Bob C ; Gao, 
Liming ; Chen, Christine 
Subject: [PATCH] remove GCC build warning

Fix gcc: warning:
-x c after last input file has no effect

Change-Id: I743d47ed0cb9d2c0c099af461fa1d5e9024d9526
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: JessyX Wu 
---
 BaseTools/Conf/build_rule.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index 5895b48fd8..af4819de92 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -463,7 +463,7 @@
 
 
 "$(ASLCC)" $(DEPS_FLAGS) -c -o 
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) 
$(DEPS_FLAGS) $(INC) ${src}
-"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) 
$(ASLCC_FLAGS)
+"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
 "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll 
$(GENFW_FLAGS)
 
 
-- 
2.37.3.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94626): https://edk2.groups.io/g/devel/message/94626
Mute This Topic: https://groups.io/mt/93940472/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

2022-10-01 Thread Bob Feng
Hi Pierre,

Could you split this patch into 2? One is for basetools C tool, the other is 
for python tool because the python code patch will be merged to edk2-basetools 
repo also.

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Saturday, October 1, 2022 11:08 PM
To: devel@edk2.groups.io; pierre.gond...@arm.com
Cc: Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of PierreGondois
Sent: Tuesday, September 6, 2022 4:29 PM
To: devel@edk2.groups.io
Cc: Pierre Gondois ; Feng, Bob C 
; Gao, Liming 
Subject: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

From: Pierre Gondois 

In an effort to clean the documentation of the above package, remove duplicated 
words.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Pierre Gondois 
---
 BaseTools/Source/C/Common/FirmwareVolumeBuffer.c| 6 +++---
 BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 2 +-
 BaseTools/Source/C/GenFv/GenFv.c| 2 +-
 BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c | 4 ++--
 BaseTools/Source/Python/Ecc/EccToolError.py | 2 +-
 BaseTools/Source/Python/build/build.py  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 
b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
index 70741c8afcb5..ace26eb71c6b 100644
--- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
+++ b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
@@ -91,7 +91,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
@@ -141,7 +141,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
@@ -285,7 +285,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c 
b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
index 2ffefa8ceeef..49078aac8caf 100644
--- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
+++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
@@ -37,7 +37,7 @@ CONST EFI_DEVICE_PATH_PROTOCOL  
mUefiDevicePathLibEndDevicePath = {
   @retval TRUEDevicePath is valid.
   @retval FALSE   DevicePath is NULL.
   @retval FALSE   Maxsize is less than sizeof(EFI_DEVICE_PATH_PROTOCOL).
-  @retval FALSE   The length of any node node in the DevicePath is less
+  @retval FALSE   The length of any node in the DevicePath is less
   than sizeof (EFI_DEVICE_PATH_PROTOCOL).
   @retval FALSE   If MaxSize is not zero, the size of the DevicePath
   exceeds MaxSize.
diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
index 43cc5cd3fe82..a742d55e5270 100644
--- a/BaseTools/Source/C/GenFv/GenFv.c
+++ b/BaseTools/Source/C/GenFv/GenFv.c
@@ -299,7 +299,7 @@ Returns:
 return STATUS_ERROR;
   }
   if (TempNumber == 0) {
-Error (NULL, 0, 1003, "Invalid option value", "Fv block size can't be 
be set to zero");
+Error (NULL, 0, 1003, "Invalid option value", "Fv block size 
+ can't be set to zero");
 return STATUS_ERROR;
   }
   mFvDataInfo.FvBlocks[0].Length = (UINT32) TempNumber; diff --git 
a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c 
b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
index b57f5ded846c..bf3dd18eaf6f 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
@@ -714,7 +714,7 @@ Tree *MR_compute_pred_tree_ctxXX(p)
 if (p == NULL) return NULL;
 
 /* this appears strange: why do we OR the context
-   of and AND predicate ?  It is because of the way
+   of an AND predicate ?  It is because of the way
that predicates are evaluated: if the context is
wrong then it's the same as if the predicate was
true.  That means that even when one leg of an @@ -1531,7 +1531,7 @@ 
Predicate * MR_find_in_aSubBlk(alt)
  *  1.  if lookahead for alt i is contained in the lookahead for any
  *  alt j then ignore semantic predicate of alt i
  *  2.  if lookahead for alt i is not contained in the lookahead for
- *  any alt j then add add predicate i to th

Re: [edk2-devel] [PATCH 1/1] BaseTools: Fix check for ${PYTHON_COMMAND} in Tests/GNUmakefile

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Rebecca Cran  
Sent: Tuesday, September 20, 2022 5:39 AM
To: devel@edk2.groups.io; Feng, Bob C ; Gao, Liming 
; Chen, Christine 
Cc: Rebecca Cran 
Subject: [PATCH 1/1] BaseTools: Fix check for ${PYTHON_COMMAND} in 
Tests/GNUmakefile

When checking if $PYTHON_COMMAND exists, curly braces should be used instead of 
parentheses.

Also, "1" causes an error on FreeBSD: it's likely supposed to be 2>&1 like 
other scripts.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Tests/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile index 
1cb77f84b1bf..caa4d26c9ba6 100644
--- a/BaseTools/Tests/GNUmakefile
+++ b/BaseTools/Tests/GNUmakefile
@@ -8,7 +8,7 @@
 all: test
 
 test:
-   @if command -v $(PYTHON_COMMAND) >/dev/null 1; then $(PYTHON_COMMAND) 
RunTests.py; else python RunTests.py; fi
+   @if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then 
+${PYTHON_COMMAND} RunTests.py; else python RunTests.py; fi
 
 clean:
find . -name '*.pyc' -exec rm '{}' ';'
--
2.37.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94624): https://edk2.groups.io/g/devel/message/94624
Mute This Topic: https://groups.io/mt/93791493/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] BaseTools/FMMT: Add Shrink Fv function

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Friday, September 16, 2022 9:51 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [PATCH 2/2] BaseTools/FMMT: Add Shrink Fv function

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3938

This function is used to remove the useless FV free space.
Usage: FMMT -s Inputfile Outputfile

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/FMMT/FMMT.py  |  7 +
 .../Source/Python/FMMT/core/FMMTOperation.py  | 26 +
 .../Source/Python/FMMT/core/FvHandler.py  | 28 ++-
 3 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/FMMT/FMMT.py 
b/BaseTools/Source/Python/FMMT/FMMT.py
index 3590f3340ec3..bf580b3843a8 100644
--- a/BaseTools/Source/Python/FMMT/FMMT.py
+++ b/BaseTools/Source/Python/FMMT/FMMT.py
@@ -41,6 +41,8 @@ parser.add_argument("-c", "--ConfigFilePath", 
dest="ConfigFilePath", nargs='+',
 FmmtConf file saves the target guidtool used in 
compress/uncompress process.\
 If do not provide, FMMT tool will search the inputfile 
folder for FmmtConf.ini firstly, if not found,\
 the FmmtConf.ini saved in FMMT tool's folder will be 
used as default.")
+parser.add_argument("-s", "--ShrinkFv", dest="ShrinkFv", nargs='+',
+help="Shrink the Fv file: '-s InputFvfile OutputFvfile")
 
 def print_banner():
 print("")
@@ -111,6 +113,9 @@ class FMMT():
 else:
 ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name), newffsfile, 
outputfile)
 
+def Shrink(self,inputfile: str, outputfile: str) -> None:
+self.SetDestPath(inputfile)
+ShrinkFv(inputfile, outputfile)
 
 def main():
 args=parser.parse_args()
@@ -142,6 +147,8 @@ def main():
 
fmmt.Replace(args.Replace[0],args.Replace[2],args.Replace[3],args.Replace[4],args.Replace[1])
 else:
 
fmmt.Replace(args.Replace[0],args.Replace[1],args.Replace[2],args.Replace[3])
+elif args.ShrinkFv:
+fmmt.Shrink(args.ShrinkFv[0], args.ShrinkFv[1])
 else:
 parser.print_help()
 except Exception as e:
diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py 
b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
index 4e58c91b5c41..a86f8dda9a1a 100644
--- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
+++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
@@ -204,3 +204,29 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: 
str, Fv_name: str=None
 logger.debug('Extract ffs data is saved in {}.'.format(outputfile))
 else:
 logger.error('Target Ffs/Fv not found!!!')
+
+def ShrinkFv(inputfile: str, outputfile: str) -> None:
+if not os.path.exists(inputfile):
+logger.error("Invalid inputfile, can not open {}.".format(inputfile))
+raise Exception("Process Failed: Invalid inputfile!")
+# 1. Data Prepare
+with open(inputfile, "rb") as f:
+whole_data = f.read()
+FmmtParser = FMMTParser(inputfile, ROOT_TREE)
+# 2. DataTree Create
+logger.debug('Parsing inputfile data..')
+FmmtParser.ParserFromRoot(FmmtParser.WholeFvTree, whole_data)
+logger.debug('Done!')
+TargetFv = FmmtParser.WholeFvTree.Child[0]
+if TargetFv:
+FvMod = FvHandler(TargetFv)
+Status = FvMod.ShrinkFv()
+else:
+logger.error('Target Fv not found!!!')
+# 4. Data Encapsulation
+if Status:
+logger.debug('Start encapsulating data..')
+FmmtParser.Encapsulation(FmmtParser.WholeFvTree, False)
+with open(outputfile, "wb") as f:
+f.write(FmmtParser.FinalData)
+logger.debug('Encapsulated data is saved in {}.'.format(outputfile))
diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py 
b/BaseTools/Source/Python/FMMT/core/FvHandler.py
index e8b848009878..ff3d637623f8 100644
--- a/BaseTools/Source/Python/FMMT/core/FvHandler.py
+++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py
@@ -145,7 +145,7 @@ def ModifyFvSystemGuid(TargetFv) -> None:
 TargetFv.Data.Data += struct2stream(item.Data.Header)+ 
item.Data.Data + item.Data.PadData
 
 class FvHandler:
-def __init__(self, NewFfs, TargetFfs) -> None:
+def __init__(self, NewFfs, TargetFfs=None) -> None:
 self.NewFfs = NewFfs
 self.TargetFfs = TargetFfs
 self.Status = False
@@ -638,3 +638,29 @@ class FvHandler:
 self.Status = True
 logger.debug('Done!')
 return self.Status
+
+def ShrinkFv(self) -> bool:
+TargetFv = self.NewFfs
+TargetFv.Data.Data = b''
+if not TargetFv.Data.Free_Space:
+self.Status = True
+else:
+

Re: [edk2-devel] [PATCH v2] BaseTools: Support COMPAT16 section generation

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Tuesday, August 30, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH v2] BaseTools: Support COMPAT16 section generation

Currently COMPAT16 section type is not recognized and GenSec is called without 
the "-s [SectionType]" argument.
Add COMPAT16 type to the SectionType dictionary to fix the issue.

Now this syntax works correctly:
```
FILE FREEFORM =   {
  SECTION COMPAT16 = 
}
```

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/Python/GenFds/Section.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/GenFds/Section.py 
b/BaseTools/Source/Python/GenFds/Section.py
index 447828c8e5..859db7230a 100644
--- a/BaseTools/Source/Python/GenFds/Section.py
+++ b/BaseTools/Source/Python/GenFds/Section.py
@@ -28,6 +28,7 @@ class Section (SectionClassObject):
 BINARY_FILE_TYPE_PIC   : 'EFI_SECTION_PIC', 
BINARY_FILE_TYPE_TE: 'EFI_SECTION_TE', 'FV_IMAGE'  : 
'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',+'COMPAT16'  : 
'EFI_SECTION_COMPATIBILITY16', BINARY_FILE_TYPE_DXE_DEPEX : 
'EFI_SECTION_DXE_DEPEX', BINARY_FILE_TYPE_PEI_DEPEX : 
'EFI_SECTION_PEI_DEPEX', 'GUIDED': 'EFI_SECTION_GUID_DEFINED',-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94621): https://edk2.groups.io/g/devel/message/94621
Mute This Topic: https://groups.io/mt/93345713/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools: Add support for SUBTYPE_GUID section generation

2022-10-01 Thread Bob Feng
This patch is good to me.

Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Wednesday, July 20, 2022 10:01 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH] BaseTools: Add support for SUBTYPE_GUID section 
generation

EFI_SECTION_FREEFORM_SUBTYPE_GUID is a leaf section type that contains a single 
EFI_GUID in the header to describe the raw data.
Currently is is not possible to generate such section.
This patch adds initial support for the generation of such sections.
The added syntax for this type of section corresponds to EDKII "[FV] section" 
documentation from the FDF Specification:
```
SECTION SUBTYPE_GUID  = 
```

Signed-off-by: Konstantin Aladyshev 
---
 .../Source/Python/CommonDataClass/FdfClass.py | 12 +++
 BaseTools/Source/Python/GenFds/FdfParser.py   | 22 ++
 .../Python/GenFds/SubTypeGuidSection.py   | 76 +++
 3 files changed, 110 insertions(+)
 create mode 100644 BaseTools/Source/Python/GenFds/SubTypeGuidSection.py

diff --git a/BaseTools/Source/Python/CommonDataClass/FdfClass.py 
b/BaseTools/Source/Python/CommonDataClass/FdfClass.py
index 2fbb7b436a..c8cfdaae32 100644
--- a/BaseTools/Source/Python/CommonDataClass/FdfClass.py
+++ b/BaseTools/Source/Python/CommonDataClass/FdfClass.py
@@ -190,6 +190,18 @@ class GuidSectionClassObject (SectionClassObject) :
 self.FvParentAddr = None self.IncludeFvSection = False +## 
SubType GUID section data in FDF+#+#+class SubTypeGuidSectionClassObject 
(SectionClassObject) :+## The constructor+#+#   @param  self
The object pointer+#+def __init__(self):+
SectionClassObject.__init__(self)+self.SubTypeGuid = None+ ## UI 
section data in FDF # #diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py 
b/BaseTools/Source/Python/GenFds/FdfParser.py
index 5c8263f9bc..aa18fef09e 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -42,6 +42,7 @@ from .DataSection import DataSection  from .DepexSection 
import DepexSection from .CompressSection import CompressSection from 
.GuidSection import GuidSection+from .SubTypeGuidSection import 
SubTypeGuidSection from .Capsule import EFI_CERT_TYPE_PKCS7_GUID, 
EFI_CERT_TYPE_RSA2048_SHA256_GUID, Capsule from .CapsuleData import CapsuleFfs, 
CapsulePayload, CapsuleFv, CapsuleFd, CapsuleAnyFile, CapsuleAfile from 
.RuleComplexFile import RuleComplexFile@@ -2892,6 +2893,27 @@ class FdfParser:
 DepexSectionObj.Expression = 
self._SkippedChars.rstrip(T_CHAR_BRACE_R) 
Obj.SectionList.append(DepexSectionObj) +elif 
self._IsKeyword("SUBTYPE_GUID"):+if AlignValue == 'Auto':+  
  raise Warning("Auto alignment can only be used in PE32 or TE section ", 
self.FileName, self.CurrentLineNumber)+SubTypeGuidValue = None+ 
   if not self._GetNextGuid():+raise 
Warning.Expected("GUID", self.FileName, self.CurrentLineNumber)+
else:+SubTypeGuidValue = self._Token++if not 
self._IsToken(TAB_EQUAL_SPLIT):+raise 
Warning.ExpectedEquals(self.FileName, self.CurrentLineNumber)+if 
not self._GetNextToken():+raise Warning.Expected("section file 
path", self.FileName, self.CurrentLineNumber)+FileName = 
self._Token++SubTypeGuidSectionObj = SubTypeGuidSection()+  
  SubTypeGuidSectionObj.Alignment = AlignValue+
SubTypeGuidSectionObj.SubTypeGuid = SubTypeGuidValue+
SubTypeGuidSectionObj.SectFileName = FileName+
Obj.SectionList.append(SubTypeGuidSectionObj)+ else: if not 
self._GetNextWord(): raise Warning.Expected("section type", 
self.FileName, self.CurrentLineNumber)diff --git 
a/BaseTools/Source/Python/GenFds/SubTypeGuidSection.py 
b/BaseTools/Source/Python/GenFds/SubTypeGuidSection.py
new file mode 100644
index 00..d522380117
--- /dev/null
+++ b/BaseTools/Source/Python/GenFds/SubTypeGuidSection.py
@@ -0,0 +1,76 @@
+## @file+# process Subtype GUIDed section generation+#+#  Copyright (c) 2022, 
Konstantin Aladyshev +#+#  SPDX-License-Identifier: 
BSD-2-Clause-Patent+#++##+# Import Modules+#+from __future__ import 
absolute_import+from . import Section+import subprocess+from .Ffs import 
SectionSuffix+import Common.LongFilePathOs as os+from .GenFdsGlobalVariable 
import GenFdsGlobalVariable+from .GenFdsGlobalVariable import 
FindExtendTool+from CommonDataClass.FdfClass import 
SubTypeGuidSectionClassObject+import sys+from Common import EdkLogger+from 
Common.BuildToolError import *+from .FvImageSection import FvImageSection+from 
Common.LongFilePathSupport import OpenLongFilePath as open+from Common.DataType 
import *++## g

Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Friday, July 22, 2022 11:38 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

Output file GUIDs from the DXE and PEI apriori files.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 74 
 1 file changed, 74 insertions(+)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 2d7c6212b3..28c6806cf0 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -43,6 +43,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //  EFI_GUID  gEfiCrc32GuidedSectionExtractionProtocolGuid = 
EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;+EFI_GUID  
gPeiAprioriFileNameGuid = { 0x1b45cc0a, 0x156a, 0x428a, { 0XAF, 0x62,  0x49, 
0x86, 0x4d, 0xa0, 0xe6, 0xe6 }};+EFI_GUID  gAprioriGuid = { 0xFC510EE7, 0xFFDC, 
0x11D4, { 0xBD, 0x41, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }};  #define 
UTILITY_MAJOR_VERSION  1 #define UTILITY_MINOR_VERSION  0@@ -107,6 
+109,12 @@ ReadHeader (
   OUT BOOLEAN   *ErasePolarity   ); +STATIC+EFI_STATUS+PrintAprioriFile (+  
EFI_FFS_FILE_HEADER *FileHeader+  );+ STATIC EFI_STATUS PrintFileInfo 
(@@ -1083,6 +1091,53 @@ Returns:
   return EFI_SUCCESS; } +STATIC+EFI_STATUS+PrintAprioriFile (+  
EFI_FFS_FILE_HEADER *FileHeader+  )+/*Routine Description:++  Print 
GUIDs from the APRIORI file++Arguments:++  FileHeader - The file 
header++Returns:++  EFI_SUCCESS   - The APRIORI file was parsed correctly+  
EFI_SECTION_ERROR - Problem with file parsing++--*/+{+  UINT8   
GuidBuffer[PRINTED_GUID_BUFFER_SIZE];+  UINT32  HeaderSize;++  
HeaderSize = FvBufGetFfsHeaderSize (FileHeader);++  if (FileHeader->Type != 
EFI_FV_FILETYPE_FREEFORM)+return EFI_SECTION_ERROR;++  
EFI_COMMON_SECTION_HEADER* SectionHeader = (EFI_COMMON_SECTION_HEADER *) 
((UINTN) FileHeader + HeaderSize);+  if (SectionHeader->Type != 
EFI_SECTION_RAW)+return EFI_SECTION_ERROR;++  UINT32 SectionLength = 
GetSectionFileLength (SectionHeader);+  EFI_GUID* FileName = (EFI_GUID *) 
((UINT8 *) SectionHeader + sizeof (EFI_COMMON_SECTION_HEADER));+  while 
(((UINT8 *) FileName) < ((UINT8 *) SectionHeader + SectionLength)) {+
PrintGuidToBuffer (FileName, GuidBuffer, sizeof (GuidBuffer), TRUE);+printf 
("%s  ", GuidBuffer);+PrintGuidName (GuidBuffer);+printf ("\n");+
FileName++;+  }++  return EFI_SUCCESS;+}+ STATIC EFI_STATUS PrintFileInfo (@@ 
-1339,6 +1394,25 @@ Returns:
 break;   } +  if (!CompareGuid (+   >Name,+   
+   ))+  {+printf("\n");+printf("PEI 
APRIORI FILE:\n");+return PrintAprioriFile (FileHeader);+  }+  if 
(!CompareGuid (+   >Name,+   +   ))+  {+   
 printf("\n");+printf("DXE APRIORI FILE:\n");+return PrintAprioriFile 
(FileHeader);+  }+   return EFI_SUCCESS; } -- 
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91722): https://edk2.groups.io/g/devel/message/91722
Mute This Topic: https://groups.io/mt/92550206/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94618): https://edk2.groups.io/g/devel/message/94618
Mute This Topic: https://groups.io/mt/92550206/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Update file and section type strings

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Friday, July 22, 2022 9:30 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Update file and section type 
strings

Change SMM to MM in naming according to the recent PI specifications.
Remove trailing whitespaces in some strings.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index d9be3d8c18..2d7c6212b3 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -676,11 +676,11 @@ Returns:
 // // 0x17 //-"EFI_SECTION_FIRMWARE_VOLUME_IMAGE ",+
"EFI_SECTION_FIRMWARE_VOLUME_IMAGE", // // 0x18 //-
"EFI_SECTION_FREEFORM_SUBTYPE_GUID ",+"EFI_SECTION_FREEFORM_SUBTYPE_GUID",  
   // // 0x19 //@@ -696,7 +696,7 @@ Returns:
 // // 0x1C //-"EFI_SECTION_SMM_DEPEX",+
"EFI_SECTION_MM_DEPEX", // // 0x1C+ //@@ -1282,7 +1282,7 @@ Returns:
 break;case EFI_FV_FILETYPE_SMM:-printf ("EFI_FV_FILETYPE_SMM\n");+ 
   printf ("EFI_FV_FILETYPE_MM\n"); break;case 
EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE:@@ -1290,11 +1290,11 @@ Returns:
 break;case EFI_FV_FILETYPE_COMBINED_SMM_DXE:-printf 
("EFI_FV_FILETYPE_COMBINED_SMM_DXE\n");+printf 
("EFI_FV_FILETYPE_COMBINED_MM_DXE\n"); break;case 
EFI_FV_FILETYPE_SMM_CORE:-printf ("EFI_FV_FILETYPE_SMM_CORE\n");+printf 
("EFI_FV_FILETYPE_MM_CORE\n"); break;case 
EFI_FV_FILETYPE_MM_STANDALONE:-- 
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91698): https://edk2.groups.io/g/devel/message/91698
Mute This Topic: https://groups.io/mt/92547456/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94617): https://edk2.groups.io/g/devel/message/94617
Mute This Topic: https://groups.io/mt/92547456/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Increase GUID base name string

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Thursday, July 21, 2022 9:12 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Increase GUID base name string

The current string lenght (=60) is not enough for cases where basename is a 
path to Build folder.
Drop custom define and use MAX_LINE_LEN from the BaseTools codebase instead.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 4628e756d7..d9be3d8c18 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -51,15 +51,13 @@ EFI_GUID  gEfiCrc32GuidedSectionExtractionProtocolGuid = 
EFI_CRC32_GUIDED_SECTIO
  #define EFI_SECTION_ERROR EFIERR (100) -#define MAX_BASENAME_LEN  60  // not 
good to hardcode, but let's be reasonable- // // Structure to keep a list of 
guid-to-basenames // typedef struct _GUID_TO_BASENAME {   struct 
_GUID_TO_BASENAME  *Next;   INT8  
Guid[PRINTED_GUID_BUFFER_SIZE];-  INT8  
BaseName[MAX_BASENAME_LEN];+  INT8  BaseName[MAX_LINE_LEN]; 
} GUID_TO_BASENAME;  static GUID_TO_BASENAME *mGuidBaseNameList = NULL;-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94616): https://edk2.groups.io/g/devel/message/94616
Mute This Topic: https://groups.io/mt/92526015/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/6] BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Tuesday, August 30, 2022 6:15 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH 1/6] BaseTools/VolInfo: Fix 
EFI_SECTION_GUID_DEFINED parsing

Currently 'PutFileImage' function is called with arguments that are not 
advanced on each section parsing. This would lead to an error if 
EFI_SECTION_GUID_DEFINED is not the first in a file.
The same mistake is present in the parsing of CRC32 guided section case.
Use correct arguments to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 135924e028..b5760d185e 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -2012,8 +2012,8 @@ Returns:
 Status =   PutFileImage ( ToolInputFile,-  
  (CHAR8*) SectionBuffer + DataOffset,-BufferLength - DataOffset+   
 (CHAR8*)Ptr + DataOffset,+SectionLength - DataOffset   
  );  system (SystemCommand);@@ -2058,8 +2058,8 @@ Returns:
 // printf ("/ Encapsulation section start 
-\\\n"); Status = ParseSection (-  
SectionBuffer + DataOffset,-  BufferLength - DataOffset+
  Ptr + DataOffset,+  SectionLength - DataOffset
   ); if (EFI_ERROR (Status)) {   Error (NULL, 0, 0003, 
"parse of CRC32 GUIDED section failed", NULL);-- 
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92968): https://edk2.groups.io/g/devel/message/92968
Mute This Topic: https://groups.io/mt/93345656/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94615): https://edk2.groups.io/g/devel/message/94615
Mute This Topic: https://groups.io/mt/93345656/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of PierreGondois
Sent: Tuesday, September 6, 2022 4:29 PM
To: devel@edk2.groups.io
Cc: Pierre Gondois ; Feng, Bob C 
; Gao, Liming 
Subject: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

From: Pierre Gondois 

In an effort to clean the documentation of the above package, remove duplicated 
words.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Pierre Gondois 
---
 BaseTools/Source/C/Common/FirmwareVolumeBuffer.c| 6 +++---
 BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 2 +-
 BaseTools/Source/C/GenFv/GenFv.c| 2 +-
 BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c | 4 ++--
 BaseTools/Source/Python/Ecc/EccToolError.py | 2 +-
 BaseTools/Source/Python/build/build.py  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 
b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
index 70741c8afcb5..ace26eb71c6b 100644
--- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
+++ b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
@@ -91,7 +91,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
@@ -141,7 +141,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
@@ -285,7 +285,7 @@ Routine Description:
 
 Arguments:
 
-  SourceFv - Address of the Fv in memory, this firmware volume volume will
+  SourceFv - Address of the Fv in memory, this firmware volume will
  be modified, if SourceFfsFile exists
   SourceFfsFile - Input FFS file to replace
 
diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c 
b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
index 2ffefa8ceeef..49078aac8caf 100644
--- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
+++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
@@ -37,7 +37,7 @@ CONST EFI_DEVICE_PATH_PROTOCOL  
mUefiDevicePathLibEndDevicePath = {
   @retval TRUEDevicePath is valid.
   @retval FALSE   DevicePath is NULL.
   @retval FALSE   Maxsize is less than sizeof(EFI_DEVICE_PATH_PROTOCOL).
-  @retval FALSE   The length of any node node in the DevicePath is less
+  @retval FALSE   The length of any node in the DevicePath is less
   than sizeof (EFI_DEVICE_PATH_PROTOCOL).
   @retval FALSE   If MaxSize is not zero, the size of the DevicePath
   exceeds MaxSize.
diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
index 43cc5cd3fe82..a742d55e5270 100644
--- a/BaseTools/Source/C/GenFv/GenFv.c
+++ b/BaseTools/Source/C/GenFv/GenFv.c
@@ -299,7 +299,7 @@ Returns:
 return STATUS_ERROR;
   }
   if (TempNumber == 0) {
-Error (NULL, 0, 1003, "Invalid option value", "Fv block size can't be 
be set to zero");
+Error (NULL, 0, 1003, "Invalid option value", "Fv block size 
+ can't be set to zero");
 return STATUS_ERROR;
   }
   mFvDataInfo.FvBlocks[0].Length = (UINT32) TempNumber; diff --git 
a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c 
b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
index b57f5ded846c..bf3dd18eaf6f 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
@@ -714,7 +714,7 @@ Tree *MR_compute_pred_tree_ctxXX(p)
 if (p == NULL) return NULL;
 
 /* this appears strange: why do we OR the context
-   of and AND predicate ?  It is because of the way
+   of an AND predicate ?  It is because of the way
that predicates are evaluated: if the context is
wrong then it's the same as if the predicate was
true.  That means that even when one leg of an @@ -1531,7 +1531,7 @@ 
Predicate * MR_find_in_aSubBlk(alt)
  *  1.  if lookahead for alt i is contained in the lookahead for any
  *  alt j then ignore semantic predicate of alt i
  *  2.  if lookahead for alt i is not contained in the lookahead for
- *  any alt j then add add predicate i to the OR list to be hoisted
+ *  any alt j then add predicate i to the OR list to be hoisted
  *  3.  if lookahead for alt i overlaps the lookahead for some alt j then
  *  add a dummy semantic predicate for alt j
  *
diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py 
b/BaseTools/Source/Python/Ecc/EccToolError.py
index d97bf7948ce8..2ff36c8329cc 100644
--- a/BaseTools/Source/Python/Ecc/EccToolError.py
+++ b/BaseTools/Source/Pyt

Re: [edk2-devel] [PATCH v2] BaseTools: Correct initialization data size check for array PCDs

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Tuesday, August 30, 2022 6:21 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH v2] BaseTools: Correct initialization data size check for array 
PCDs

Currently it is not possible to initialize all elements in the array PCD.

For example, this PCD would result to a build failure:
gTokenSpaceGuid.PcdArray|{0x11, 0x22}|UINT8[2]|0x4C4CB9A3

Correct logical operator in the initialization data size checks to fix the 
issue.

Signed-off-by: Konstantin Aladyshev 
---
 .../Source/Python/Workspace/DscBuildData.py  | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index e9f68384b4..73c6ee4006 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2089,12 +2089,12 @@ class DscBuildData(PlatformBuildClassObject):
 pcdarraysize = Pcd.PcdArraySize() if "{CODE(" 
in Pcd.DefaultValueFromDec: if Pcd.Capacity[-1] != "-1":-   
 CApp = CApp + '__STATIC_ASSERT(sizeof(%s_%s_INIT_Value) < 
%d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capability %s"); // 
From  %s Line %s \n ' % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])+
CApp = CApp + '__STATIC_ASSERT(sizeof(%s_%s_INIT_Value) 
<= %d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capability %s"); 
// From  %s Line %s \n ' % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])
 CApp = CApp + ' PcdArraySize = sizeof(%s_%s_INIT_Value);\n 
' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) CApp = CApp + 
'  memcpy (Pcd, %s_%s_INIT_Value,PcdArraySize);\n ' % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName) else: if Pcd.Capacity[-1] 
!= "-1":-CApp = CApp + '__STATIC_ASSERT(%d < %d * 
sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capability %s"); // From 
%s Line %s \n' % 
(ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])+
CApp = CApp + '__STATIC_ASSERT(%d <= %d * sizeof(%s), 
"Pcd %s.%s Value in Dec exceed the array capability %s"); // From %s Line %s 
\n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])
 CApp = CApp + ' PcdArraySize = %d;\n' % ValueSize  
   CApp = CApp + '  Value = %s; // From DEC Default Value %s\n' % 
(DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultValueFromDec)  
   CApp = CApp + '  memcpy (Pcd, Value, PcdArraySize);\n'@@ -2204,7 
+2204,7 @@ class DscBuildData(PlatformBuildClassObject):
 if "{CODE(" in Value: if 
Pcd.IsArray() and Pcd.Capacity[-1] != "-1": 
pcdarraysize = Pcd.PcdArraySize()-CApp = CApp + 
'__STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value 
in Dsc exceed the array capability %s"); // From %s \n' % 
(Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, 
DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType, valuefrom)+CApp = 
CApp + '__STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) <= %d * sizeof(%s), "Pcd 
%s.%s Value in Dsc exceed the array capability %s"); // From %s \n' % 
(Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, 
DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,Pcd.DatumType, valuefrom) CApp = CApp+ ' 
PcdArraySize = sizeof(%s_%s_%s_%s_Value);\n ' % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenCName,SkuName, DefaultStoreName) CApp = CApp + 
'  memcpy (Pcd, &%s_%s_%s_%s_Value,PcdArraySize);\n ' % 
(Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) 
else:@@ -2217,12 +2217,12 @@ class 
DscBuildData(PlatformBuildClassObject):
 pcdarraysize = Pcd.PcdArraySize()  
   if "{CODE(" in pcddefaultvalue: if 
Pcd.Capacity[-1] != "-1":-  

Re: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC

2022-10-01 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Wednesday, September 21, 2022 9:02 AM
To: devel@edk2.groups.io; aladyshe...@gmail.com
Cc: Feng, Bob C ; Chen, Christine 
Subject: 回复: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD 
expression values in AutoGenC

Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Konstantin 
> Aladyshev
> 发送时间: 2022年8月30日 18:20
> 收件人: devel@edk2.groups.io
> 抄送: bob.c.f...@intel.com; gaolim...@byosoft.com.cn; 
> yuwei.c...@intel.com; Konstantin Aladyshev 
> 主题: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD 
> expression values in AutoGenC
> 
> Currently the PCD values calculated from the expressions have 
> different formating from the simple byte arrays in AutoGenC.
> 
> Example:
> The following definition in DEC:
> gTokenSpaceGuid.PcdArray|{0x44, 0x33, 0x22, 0x11}|VOID*|0x
> gTokenSpaceGuid.PcdArrayByExpression|{UINT32(0x11223344)}|VOID*|0x6
> 666
> 
> Produces these strings in AutoGenC:
> <...> _gPcd_<...>_PcdArray[4] = {0x44, 0x33, 0x22, 0x11}; <...> 
> _gPcd_<...>_PcdArrayByExpression[4] = {0x44,0x33,0x22,0x11};
> 
> Add missing space character between the array elements to unify PCD 
> value formatting.
> 
> Signed-off-by: Konstantin Aladyshev 
> ---
>  BaseTools/Source/Python/Common/Expression.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 31bf0e4b6c..b62efe6f9b 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
>  Size += ItemSize
> 
> 
> 
>  if Size > 0:
> 
> -PcdValue = '{' +
> ','.join(AllPcdValueList) + '}'
> 
> +PcdValue = '{' + ',
> '.join(AllPcdValueList) + '}'
> 
>  else:
> 
>  raise  BadExpression("Type: %s,
> Value: %s, %s"%(self.PcdType, PcdValue, Value))
> 
> 
> 
> --
> 2.25.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#92977): 
> https://edk2.groups.io/g/devel/message/92977
> Mute This Topic: https://groups.io/mt/93345721/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 










-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94612): https://edk2.groups.io/g/devel/message/94612
Mute This Topic: https://groups.io/mt/94053057/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct buffer for GenCrc32 tool

2022-10-01 Thread Bob Feng
Yes, I agree that in the case of GenCrc32 we can just set
EFI_GUIDED_SECTION_PROCESSING_REQUIRED=0 and point DataOffset to the 
(EFI_GUID_DEFINED_SECTION + 4 bytes).

For this patch, 
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Friday, July 29, 2022 5:03 PM
To: Chen, Christine 
Cc: devel@edk2.groups.io; Feng, Bob C ; Gao, Liming 

Subject: Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct buffer for 
GenCrc32 tool

Hi Christine!

I think the GenCrc32 usage is different because it just prepends the data with 
the CRC32 value leaving the main data unmodified, opposed to all of the 
encryption utilities that change the data itself.

Therefore in the case of the GenCrc32 produced section it is possible to get 
the main data just by the 'DataOffset' field.

Here is the definition of the EFI_GUIDED_SECTION_PROCESSING_REQUIRED
flag from the PI specification:
```
EFI_GUIDED_SECTION_ PROCESSING_REQUIRED:
Set to 1 if the section requires processing to obtain meaningful data from the 
section contents. Processing would be required, for example, if the section 
contents were encrypted or compressed. If the 
EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit is cleared to zero, it is possible 
to retrieve the section’s contents without processing in the absence of an 
associated instance of the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL (DXE) or 
EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI (PEI).. In this case, the beginning of 
the encapsulated section stream is indicated by the value of DataOffset ```

So in the case of encryption utilities like 
LzmaCompress/TianoCompress/BrotliCompress/... we set
EFI_GUIDED_SECTION_PROCESSING_REQUIRED=1 and DataOffset points to the very 
start of data right after the EFI_GUID_DEFINED_SECTION header.
But in the case of GenCrc32 we can just set
EFI_GUIDED_SECTION_PROCESSING_REQUIRED=0 and point DataOffset to the 
(EFI_GUID_DEFINED_SECTION + 4 bytes).

Best regards,
Konstantin Aladyshev

On Fri, Jul 29, 2022 at 7:02 AM Chen, Christine  wrote:
>
> Hi Konstantin, this is really an issue need to be solved.
>
> When GenSec tool uses the guidtools to encode the section, it differentiates 
> how GenCrc32 is used from other tools..
>
> GenSec defines a CRC32_SECTION_HEADER structure for GenCrc32, and calculate 
> the DataOffset of the Section with this header.
>
> However other guidtools just use the EFI_GUID_DEFINED_SECTION header and 
> calculate the DataOffset with it.
>
>
>
> “
>
> typedef struct {
>
>   EFI_GUID_DEFINED_SECTION  GuidSectionHeader;
>
>   UINT32CRC32Checksum;
>
> } CRC32_SECTION_HEADER;
>
>
>
> Crc32GuidSect->GuidSectionHeader.DataOffset  = sizeof 
> Crc32GuidSect->(CRC32_SECTION_HEADER);
>
>
>
> ”
>
> Personally think that is the root cause of the 4 bytes issue.
>
>
>
> I do not know why the GenCrc32 usage is different from other tools in origin 
> design.
>
> Propose to solve this issue from GenSec side to keep all the guidtool with 
> same function.
>
>
>
> Thanks,
>
> Christine
>
>
>
> > -Original Message-
>
> > From: devel@edk2.groups.io  On Behalf Of
>
> > Konstantin Aladyshev
>
> > Sent: Tuesday, July 19, 2022 9:45 PM
>
> > To: devel@edk2.groups.io
>
> > Cc: Feng, Bob C ; Gao, Liming
>
> > ; Chen, Christine ;
>
> > Konstantin Aladyshev 
>
> > Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct buffer for
>
> > GenCrc32 tool
>
> >
>
> > If the guided section was encoded with GenCrc32 tool the resulting
>
> > 'EFI_GUID_DEFINED_SECTION.DataOffset' field points to the start of 
> > the
>
> > meaningfull data that follows the CRC32 value.
>
> > But if we want to decode the section with GenCrc32 tool we need to 
> > provide
>
> > a buffer that includes the CRC32 value itself.
>
> >
>
> > Signed-off-by: Konstantin Aladyshev 
>
> > ---
>
> >  BaseTools/Source/C/VolInfo/VolInfo.c | 7 +++
>
> >  1 file changed, 7 insertions(+)
>
> >
>
> > diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c
>
> > b/BaseTools/Source/C/VolInfo/VolInfo.c
>
> > index f450796f9c..47a8f80f46 100644
>
> > --- a/BaseTools/Source/C/VolInfo/VolInfo.c
>
> > +++ b/BaseTools/Source/C/VolInfo/VolInfo.c
>
> > @@ -1999,6 +1999,13 @@ Returns:
>
> >); free (ExtractionTool); +if (!CompareGuid (+   
> > EfiGuid,+
>
> > +   )+   ) 
> > {+
>
> > DataOffset -= 4;+} Status =   PutFileImage (
> >  ToolInputFile,--
>
> > 2.25.1
>
> >
>
> >
&g

Re: [edk2-devel] [PATCH] BaseTools: Correct BPDG tool error prints

2022-09-30 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Monday, September 5, 2022 5:19 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools: Correct BPDG tool error prints

Popen communication returns bytestrings. It is necessary to perform decode on 
these strings before passing them to the EdkLogger that works with ordinary 
strings.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/Python/Common/VpdInfoFile.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py 
b/BaseTools/Source/Python/Common/VpdInfoFile.py
index 4249b9f899..1e0c3dfe76 100644
--- a/BaseTools/Source/Python/Common/VpdInfoFile.py
+++ b/BaseTools/Source/Python/Common/VpdInfoFile.py
@@ -248,8 +248,8 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
 PopenObject.wait()  if PopenObject.returncode != 0:-
EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))+   
 EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", 
str(error.decode())) EdkLogger.error("BPDG", 
BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, 
the error message is: \n %s" % \-
(PopenObject.returncode, str(error)))+
(PopenObject.returncode, str(error.decode(  return 
PopenObject.returncode-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94610): https://edk2.groups.io/g/devel/message/94610
Mute This Topic: https://groups.io/mt/93474930/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MdeModulePkg: Handle InitialVFs=0 case for SR-IOV

2022-09-29 Thread Bob Feng
From: Foster Nong 

Per SR-IOV spec,InitialVFs minimum is 0. Below code which use to calculate 
SR-IOV bus number,
if InitialVFs =0, it maybe calculate the wrong bus number.

LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * VFStride
we can fix it with below code:
 if (PciIoDevice->InitialVFs == 0) {
 PciIoDevice->ReservedBusNum = 0;
} else {
PFRid  = EFI_PCI_RID (Bus, Device, Func);
 LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * VFStride;
//
// Calculate ReservedBusNum for this PF
//
PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus + 1);
//
 // Calculate ReservedBusNum for this PF
//
 PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus + 1);
}

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

Signed-off-by: Foster Nong 
---
 .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c 
b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 509f828b62..eb250f6f7b 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -2416,13 +2416,17 @@ CreatePciIoDevice (
   //
   // Calculate LastVF
   //
-  PFRid  = EFI_PCI_RID (Bus, Device, Func);
-  LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * 
VFStride;
+  if (PciIoDevice->InitialVFs == 0) {
+PciIoDevice->ReservedBusNum = 0;
+  } else {
+PFRid  = EFI_PCI_RID (Bus, Device, Func);
+LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * 
VFStride;
 
-  //
-  // Calculate ReservedBusNum for this PF
-  //
-  PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus 
+ 1);
+//
+// Calculate ReservedBusNum for this PF
+//
+PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - 
Bus + 1);
+  }
 
   DEBUG ((
 DEBUG_INFO,
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94512): https://edk2.groups.io/g/devel/message/94512
Mute This Topic: https://groups.io/mt/93990439/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Edk2ToolsBuild: Fixing pipeline build due to path too long

2022-09-22 Thread Bob Feng
Create PR https://github.com/tianocore/edk2/pull/3378 for merge.

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Thursday, September 22, 2022 7:11 PM
To: Kun Qin ; devel@edk2.groups.io
Cc: Gao, Liming ; Chen, Christine 
; Sean Brogan 
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Edk2ToolsBuild: Fixing 
pipeline build due to path too long

Reviewed-by: Bob Feng 

-Original Message-
From: Kun Qin  
Sent: Thursday, September 22, 2022 4:45 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Sean Brogan 
Subject: [PATCH v1 1/1] BaseTools: Edk2ToolsBuild: Fixing pipeline build due to 
path too long

From: Sean Brogan 

Current implementation of looking up toolchain will _insert_ the findings from 
vsvarsall.bat to existing path and potentially stuff the variable to exceed the 
length of maximal path length accepted by Windows.

This change updated the logic to use the discovered shell varialbes to replace 
the existing path, which is desirable in the specific use case.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 

Co-authored-by: Sean Brogan 
Signed-off-by: Kun Qin 
---
 BaseTools/Edk2ToolsBuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py index 
1ea8187de693..f862468ce275 100644
--- a/BaseTools/Edk2ToolsBuild.py
+++ b/BaseTools/Edk2ToolsBuild.py
@@ -122,7 +122,7 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for key in vc_vars.keys(): logging.debug(f"Var - 
{key} = {vc_vars[key]}") if key.lower() == 'path':- 
   shell_env.insert_path(vc_vars[key])+
shell_env.set_path(vc_vars[key]) else: 
shell_env.set_shell_var(key, vc_vars[key]) -- 
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94116): https://edk2.groups.io/g/devel/message/94116
Mute This Topic: https://groups.io/mt/93835889/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Edk2ToolsBuild: Fixing pipeline build due to path too long

2022-09-22 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Kun Qin  
Sent: Thursday, September 22, 2022 4:45 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Sean Brogan 
Subject: [PATCH v1 1/1] BaseTools: Edk2ToolsBuild: Fixing pipeline build due to 
path too long

From: Sean Brogan 

Current implementation of looking up toolchain will _insert_ the findings from 
vsvarsall.bat to existing path and potentially stuff the variable to exceed the 
length of maximal path length accepted by Windows.

This change updated the logic to use the discovered shell varialbes to replace 
the existing path, which is desirable in the specific use case.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 

Co-authored-by: Sean Brogan 
Signed-off-by: Kun Qin 
---
 BaseTools/Edk2ToolsBuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py index 
1ea8187de693..f862468ce275 100644
--- a/BaseTools/Edk2ToolsBuild.py
+++ b/BaseTools/Edk2ToolsBuild.py
@@ -122,7 +122,7 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for key in vc_vars.keys(): logging.debug(f"Var - 
{key} = {vc_vars[key]}") if key.lower() == 'path':- 
   shell_env.insert_path(vc_vars[key])+
shell_env.set_path(vc_vars[key]) else: 
shell_env.set_shell_var(key, vc_vars[key]) -- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94115): https://edk2.groups.io/g/devel/message/94115
Mute This Topic: https://groups.io/mt/93835889/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][PATCH v1] BaseTools: 64bit FSP FV map file cannot be created correctly

2022-09-12 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Kuo, Ted  
Sent: Monday, August 29, 2022 5:28 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Hamel, Lee M 
Subject: [edk2-devel][PATCH v1] BaseTools: 64bit FSP FV map file cannot be 
created correctly

https://bugzilla.tianocore.org/show_bug.cgi?id=4035
64bit FSP FV map file cannot be created correctly when using CLANG compiler. 
When compiling 64bit FSP with CLANG, there is no prefix symbol '_' added to 
function name. Hence FSP FV map file cannot be created properly. Updated the if 
condition for CLANG in GenFv to get the issue fixed.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Lee Hamel 
Signed-off-by: Ted Kuo 
---
 BaseTools/Source/C/GenFv/GenFvInternalLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c 
b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index d650a527a5..d28ac8f6eb 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -1004,7 +1004,7 @@ Returns:
   if (IsUseClang) { sscanf (Line, "%llx %s %s %s", 
, KeyWord, KeyWord2, FunctionTypeName); FunctionAddress 
= (UINT64) TempLongAddress;-if (FunctionTypeName [0] == '_' ) {+
if (FunctionTypeName [0] != '/' && FunctionTypeName [0] != '.' && 
FunctionTypeName [1] != ':') {   fprintf (FvMapFile, "  0x%010llx", 
(unsigned long long) (ImageBaseAddress + FunctionAddress - 
LinkTimeBaseAddress));   fprintf (FvMapFile, "%s\n", FunctionTypeName); 
}-- 
2.35.3.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93684): https://edk2.groups.io/g/devel/message/93684
Mute This Topic: https://groups.io/mt/93322647/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.28 to 0.1.29

2022-09-07 Thread Bob Feng
Pushed.

-Original Message-
From: Kinney, Michael D  
Sent: Thursday, September 8, 2022 10:23 AM
To: devel@edk2.groups.io; Feng, Bob C ; Kinney, Michael D 

Cc: Gao, Liming ; Chen, Christine 
; Rebecca Cran 
Subject: RE: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the 
edk2-basetools version from 0.1.28 to 0.1.29

Reviewed-by: Michael D Kinney 


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Bob 
> Feng
> Sent: Wednesday, September 7, 2022 8:24 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> ; Chen, Christine ; 
> Rebecca Cran 
> Subject: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the 
> edk2-basetools version from 0.1.28 to 0.1.29
> 
> features and bug fixes:
> 1. Revert "BaseTools: Fix DSC LibraryClass precedence rule"
> 
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Rebecca Cran 
> ---
>  pip-requirements.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pip-requirements.txt b/pip-requirements.txt index 
> 353c01ff71ed..967da7cb3783 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -14,5 +14,5 @@
> 
>  edk2-pytool-library==0.11.2
>  edk2-pytool-extensions~=0.16.0
> -edk2-basetools==0.1.28
> +edk2-basetools==0.1.29
>  antlr4-python3-runtime==4.7.1
> --
> 2.37.0.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93475): https://edk2.groups.io/g/devel/message/93475
Mute This Topic: https://groups.io/mt/93527291/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.28 to 0.1.29

2022-09-07 Thread Bob Feng
features and bug fixes:
1. Revert "BaseTools: Fix DSC LibraryClass precedence rule"

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Rebecca Cran 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 353c01ff71ed..967da7cb3783 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.28
+edk2-basetools==0.1.29
 antlr4-python3-runtime==4.7.1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93442): https://edk2.groups.io/g/devel/message/93442
Mute This Topic: https://groups.io/mt/93527291/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Pip edk2-basetools diverged from edk2/BaseTools (e.g. doesn't have "Revert "BaseTools: Fix DSC LibraryClass precedence rule"")

2022-09-07 Thread Bob Feng
Yes. I'll sync the edk2-basetools.

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Wednesday, September 7, 2022 9:08 PM
To: devel@edk2.groups.io; Leif Lindholm ; Kinney, 
Michael D ; Andrew Fish ; Michael 
Kubacki ; Sean Brogan 
; Barkelew, Bret ; Gao, 
Liming 
Subject: [edk2-devel] Pip edk2-basetools diverged from edk2/BaseTools (e.g. 
doesn't have "Revert "BaseTools: Fix DSC LibraryClass precedence rule"")

I've been running into a problem with CI that was fixed in edk2 BaseTools 
before the recent stable tag:


ERROR - Compiler #3000 from
/home/vsts/work/1/s/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf(42):
 
PCD [gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode] in 
[/home/vsts/work/1/s/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf]
is not found in dependent packages:

I noticed that CI is using the Pip based tools, and from comparing 
https://github.com/tianocore/edk2-basetools/commits/master and 
https://github.com/tianocore/edk2/commits/master/BaseTools it's clear they've 
diverged, and the former for example doesn't have "Revert
"BaseTools: Fix DSC LibraryClass precedence rule"", as well as several other 
fixes.

Could we get them synced up?

--
Rebecca Cran







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93432): https://edk2.groups.io/g/devel/message/93432
Mute This Topic: https://groups.io/mt/93524246/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/GenFw AARCH64: Convert more types of explicit GOT references

2022-09-07 Thread Bob Feng
Acked-by: Bob Feng 

-Original Message-
From: Leif Lindholm  
Sent: Tuesday, September 6, 2022 7:54 PM
To: Ard Biesheuvel ; Rebecca Cran 
Cc: devel@edk2.groups.io; Feng, Bob C ; Gao, Liming 
; Kinney, Michael D 
Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw AARCH64: Convert more types 
of explicit GOT references

On 2022-09-06 11:30, Ard Biesheuvel wrote:
> Bob, Liming, Leif: any thoughts?

I'm happy with this.
(Spotted one typo - "ofset".)

Acked-by: Leif Lindholm 

> On Sun, 21 Aug 2022 at 16:33, Rebecca Cran  wrote:
>>
>> Tested-by: Rebecca Cran 
>>
>>
>> On 8/21/22 08:16, Ard Biesheuvel wrote:
>>> Rebecca reports that builds of AArch64 DSCs that involve PIE linking 
>>> when using ELF based toolchains are failing in some cases, resulting 
>>> in an error message like
>>>
>>> bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or
>>> unsupported symbol type.  For example, absolute and undefined symbols
>>> are not supported.
>>>
>>> The reason turns out to be that, while GenFw does carry some logic 
>>> to convert GOT based symbol references into direct ones (which is 
>>> always possible given that our ELF to PE/COFF conversion only 
>>> supports fully linked executables), it does not support all possible 
>>> combinations of relocations that the linker may emit to load symbol 
>>> addresses from the GOT.
>>>
>>> In particular, when performing a non-LTO link on object code built 
>>> with GCC using -fpie, we may end up with GOT based references such 
>>> as the one below, where the address of the GOT itself is taken, and 
>>> the ofset of the symbol in the GOT is reflected in the immediate 
>>> offset of the subsequent LDR instruction.
>>>
>>> 838:   adrpx0, 16000
>>> 838: R_AARCH64_ADR_PREL_PG_HI21 _GLOBAL_OFFSET_TABLE_
>>> 83c:   ldr x0, [x0, #2536]
>>> 83c: R_AARCH64_LD64_GOTPAGE_LO15
>>> _gPcd_BinaryPatch_PcdFdBaseAddress
>>>
>>> The reason that we omit GOT based symbol references when performing 
>>> ELF to PE/COFF conversion is that the GOT is not described by static 
>>> ELF relocations, which means that the ELF file lacks the metadata to 
>>> generate the PE/COFF relocations covering the GOT table in the 
>>> PE/COFF executable. Given that none of the usual motivations for 
>>> using a GOT (copy on write footprint, shared libraries) apply to EFI 
>>> executables in the first place, the easiest way around this is to 
>>> convert all GOT based symbol address loads to PC relative ADR/ADRP 
>>> instructions.
>>>
>>> So implement this handling for R_AARCH64_LD64_GOTPAGE_LO15 and
>>> R_AARCH64_LD64_GOTOFF_LO15 relocations as well, and turn the LDR 
>>> instructions in question into ADR instructions that generate the 
>>> address immediately.
>>>
>>> This leaves the reference to _GLOBAL_OFFSET_TABLE_ itself, which is 
>>> what generated the error to begin with. Considering that this symbol 
>>> is never referenced (i.e., it doesn't appear anywhere in the code) 
>>> and is only meaningful in combination with R_*_GOT_* based 
>>> relocations that follow it, we can just disregard any references to 
>>> it entirely, given that we convert all of those followup relocations into 
>>> direct references.
>>>
>>> Cc: Rebecca Cran 
>>> Cc: Bob Feng 
>>> Cc: Liming Gao 
>>> Cc: "Kinney, Michael D" 
>>> Cc: Leif Lindholm 
>>> Signed-off-by: Ard Biesheuvel 
>>> ---
>>>
>>> This patch can be tested using the following method:
>>>
>>> - add the following lines to 
>>> ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
>>>
>>> [BuildOptions]
>>> GCC:*_*_AARCH64_CC_FLAGS = -fpie
>>> GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,-Bsymbolic,-pie
>>>
>>> - build ArmVirtPkg/ArmVirtQemuKernel.dsc in DEBUG mode using GCC49
>>> (other combos might work as well) and observe the build failure
>>>
>>> - apply this patch and observe that the build failure is gone
>>>
>>> - boot the resulting image in QEMU using the -kernel ../QEMU_EFI.fd
>>> command line option and observe that the image boots as usual
>>>
>>>BaseTools/Source/C/GenFw/Elf64Convert.c | 35 
>>>1 file changed, 35 insertions(+)
>>>
>>> diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
>>> b/BaseTools/Source/C

[edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.24 to 0.1.28

2022-09-02 Thread Bob Feng
features and bug fixes:
1. Fix the incremental build issue on Linux @176016387f
2. Fix DSC LibraryClass precedence rule @039bdb4d3e
3. INF should use latest Pcd value instead of default value @a512913
4. Support signtool input subject name to sign capsule @594b795

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Michael D Kinney 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 29424b08bd88..353c01ff71ed 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.24
+edk2-basetools==0.1.28
 antlr4-python3-runtime==4.7.1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93087): https://edk2.groups.io/g/devel/message/93087
Mute This Topic: https://groups.io/mt/93414024/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-stable202208 3/3] Revert "BaseTools: Fix DSC LibraryClass precedence rule"

2022-08-25 Thread Bob Feng
Acked-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Friday, August 26, 2022 10:15 AM
To: devel@edk2.groups.io
Cc: Chen, Christine ; Feng, Bob C 
Subject: [edk2-devel] [edk2-stable202208 3/3] Revert "BaseTools: Fix DSC 
LibraryClass precedence rule"

This reverts commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 for tag202208.
This brings the behavior changes, and needs more discussion.

Signed-off-by: Liming Gao 
Cc: Yuwei Chen 
Cc: Bob Feng 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 41f93c93f2..e9f68384b4 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -872,7 +872,7 @@ class DscBuildData(PlatformBuildClassObject):
 if ModuleType != TAB_COMMON and ModuleType not in 
SUP_MODULE_LIST:
 EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module 
type [%s]" % ModuleType,
 File=self.MetaFile, 
ExtraData=LibraryInstance, Line=LineNo)
-LibraryClassDict[ModuleType, Arch, LibraryClass] = 
LibraryInstance
+LibraryClassDict[Arch, ModuleType, LibraryClass] = 
LibraryInstance
 if LibraryInstance not in self._LibraryInstances:
 self._LibraryInstances.append(LibraryInstance)
 
@@ -881,7 +881,7 @@ class DscBuildData(PlatformBuildClassObject):
 for LibraryClass in LibraryClassSet:
 # try all possible module types
 for ModuleType in SUP_MODULE_LIST:
-LibraryInstance = LibraryClassDict[ModuleType, self._Arch, 
LibraryClass]
+LibraryInstance = LibraryClassDict[self._Arch, ModuleType, 
LibraryClass]
 if LibraryInstance is None:
 continue
 self._LibraryClasses[LibraryClass, ModuleType] = 
LibraryInstance
-- 
2.27.0.windows.1




-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92832): https://edk2.groups.io/g/devel/message/92832
Mute This Topic: https://groups.io/mt/93262564/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92839): https://edk2.groups.io/g/devel/message/92839
Mute This Topic: https://groups.io/mt/93262564/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04

2022-08-25 Thread Bob Feng
+ Huang Long, the bug submitter.

I am OK to revert this patch for this stable tag.

Since this patch break the MdeModulePkg build, also suggest to add this case in 
edk2 CI.

Thanks,
Bob

-Original Message-
From: Kinney, Michael D  
Sent: Thursday, August 25, 2022 11:44 PM
To: devel@edk2.groups.io; quic_llind...@quicinc.com; Feng, Bob C 
; Gao, Liming ; 'Ard 
Biesheuvel' ; rebe...@bsdio.com; Chen, Christine 
; Kinney, Michael D 
Cc: 'Andrew Fish' ; Wang, Jian J 
Subject: RE: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04

Hi Bob,

There was feedback in the Bugzilla on July 5 asking if this is a DSC spec issue 
or a BaseTools implementation issue.  There was no response to that question.

Why was a spec change not considered for this case to match the BaseTools 
behavior?

Why were no additional details added to the BZ?

I agree with Leif.  If this change introduced regressions, we should consider a 
revert and evaluate again after the release.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Leif 
> Lindholm
> Sent: Thursday, August 25, 2022 1:49 AM
> To: Feng, Bob C ; devel@edk2.groups.io; Gao, Liming 
> ; 'Ard Biesheuvel'
> ; rebe...@bsdio.com; Chen, Christine 
> 
> Cc: 'Andrew Fish' ; Kinney, Michael D 
> ; Wang, Jian J 
> Subject: Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on 
> Ubuntu 22.04
> 
> Hi Bob,
> 
> You are suggesting to knowingly break builds between one stable tag 
> and another on a technicality, for one of the most common (and up to 
> date) build operating systems.
> 
> The purpose of the stable tag is to avoid unplanned breakages. 
> Catching this sort of situation is literally what it is for.
> 
> /
>  Leif
> 
> On 2022-08-24 18:17, Feng, Bob C wrote:
> > Hi Liming,
> >
> > This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 was to fix the 
> > bug that the basetools implementation dose not follow the
> dsc spec and pass the edk2 CI.
> > The patch was send on June 30, reviewed on July 11 and pushed on 
> > July 17. I think there was enough time to give feedback to
> this change.
> >
> > Why not consider to fix the DSC file?
> >
> > Thanks,
> > Bob
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of 
> > gaoliming via groups.io
> > Sent: Wednesday, August 24, 2022 3:16 PM
> > To: Feng, Bob C ; devel@edk2.groups.io; 'Ard 
> > Biesheuvel' ; rebe...@bsdio.com; Chen,
> Christine 
> > Cc: 'Andrew Fish' ; 'Leif Lindholm' 
> > ; Kinney, Michael D
> ; Wang, Jian J 
> > Subject: 回复: [edk2-devel] MdeModulePkg build fails for AARCH64 on 
> > Ubuntu 22.04
> >
> > Bob:
> >   The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 was merged 
> > into Edk2 on Last month (2022 July 17th). This is very new
> change. It brings the behavior change. But, it doesn't highlight its impact 
> to collect feedback.
> >
> >   I suggest to revert it, because I think we need more time to 
> > discuss this behavior change. Even if we decide to make this
> change, we also need to give other people enough time to update DSC file.
> >
> > Thanks
> > Liming
> >> -邮件原件-
> >> 发件人: Feng, Bob C 
> >> 发送时间: 2022年8月23日 15:40
> >> 收件人: devel@edk2.groups.io; Gao, Liming ; 
> >> 'Ard Biesheuvel' ; rebe...@bsdio.com; Chen, 
> >> Christine 
> >> 抄送: 'Andrew Fish' ; 'Leif Lindholm'
> >> ; Kinney, Michael D 
> >> ; Wang, Jian J 
> >> 主题: RE: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu
> >> 22.04
> >>
> >> Hi Liming,
> >>
> >> Reverting patch may not a good idea, some platforms have done the 
> >> implementation based on the DSC spec, if revert, those platforms 
> >> build will break.
> >> This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 make the 
> >> Basetools behavior be consistent with DSC spec so I don't think 
> >> it's a regression bug.
> >>
> >> Thanks,
> >> Bob
> >>
> >> -Original Message-
> >> From: devel@edk2.groups.io  On Behalf Of 
> >> gaoliming via groups.io
> >> Sent: Tuesday, August 23, 2022 9:55 AM
> >> To: 'Ard Biesheuvel' ; devel@edk2.groups.io; 
> >> rebe...@bsdio.com; Feng, Bob C ; Chen, 
> >> Christine 
> >> Cc: 'Andrew Fish' ; 'Leif Lindholm'
> >> ; Kinney, Michael D 
> >> ; Wang, Jian J 
> >> Subject: 回复: [edk2-devel] MdeModulePkg build fails for AARCH64 on 
> >> Ubuntu 22.04
> >> Importance: High
> >>
> >> Yuwei:
> >>The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 (BaseTools:
> >> Fix DSC LibraryClass precedence rule) introduces this issue. I 
> >> agree with Ard suggestion to revert this change first for this 
> >> stable tag 202208. Then, we can discuss this change in the detail.
> >>
> >> Thanks
> >> Liming
> >>> -邮件原件-
> >>> 发件人: Ard Biesheuvel 
> >>> 发送时间: 2022年8月22日 17:34
> >>> 收件人: devel@edk2.groups.io; rebe...@bsdio.com; Feng, Bob C 
> >>> ; Liming Gao 
> >>> 抄送: Andrew Fish ; Leif Lindholm 
> >>> ; Michael D Kinney 
> >>> ; Jian J Wang 
> >>> 主题: Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on 
> >>> Ubuntu
> >>> 22.04
> >>>
> >>> 

Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04

2022-08-24 Thread Bob Feng
Hi Liming,

This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 was to fix the bug that 
the basetools implementation dose not follow the dsc spec and pass the edk2 CI.
The patch was send on June 30, reviewed on July 11 and pushed on July 17. I 
think there was enough time to give feedback to this change.

Why not consider to fix the DSC file?

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Wednesday, August 24, 2022 3:16 PM
To: Feng, Bob C ; devel@edk2.groups.io; 'Ard Biesheuvel' 
; rebe...@bsdio.com; Chen, Christine 
Cc: 'Andrew Fish' ; 'Leif Lindholm' 
; Kinney, Michael D ; 
Wang, Jian J 
Subject: 回复: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04

Bob:
 The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 was merged into Edk2 on 
Last month (2022 July 17th). This is very new change. It brings the behavior 
change. But, it doesn't highlight its impact to collect feedback.

 I suggest to revert it, because I think we need more time to discuss this 
behavior change. Even if we decide to make this change, we also need to give 
other people enough time to update DSC file. 

Thanks
Liming
> -邮件原件-
> 发件人: Feng, Bob C 
> 发送时间: 2022年8月23日 15:40
> 收件人: devel@edk2.groups.io; Gao, Liming ; 
> 'Ard Biesheuvel' ; rebe...@bsdio.com; Chen, Christine 
> 
> 抄送: 'Andrew Fish' ; 'Leif Lindholm'
> ; Kinney, Michael D 
> ; Wang, Jian J 
> 主题: RE: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu
> 22.04
> 
> Hi Liming,
> 
> Reverting patch may not a good idea, some platforms have done the 
> implementation based on the DSC spec, if revert, those platforms build 
> will break.
> This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 make the 
> Basetools behavior be consistent with DSC spec so I don't think it's a 
> regression bug.
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> gaoliming via groups.io
> Sent: Tuesday, August 23, 2022 9:55 AM
> To: 'Ard Biesheuvel' ; devel@edk2.groups.io; 
> rebe...@bsdio.com; Feng, Bob C ; Chen, Christine 
> 
> Cc: 'Andrew Fish' ; 'Leif Lindholm'
> ; Kinney, Michael D 
> ; Wang, Jian J 
> Subject: 回复: [edk2-devel] MdeModulePkg build fails for AARCH64 on 
> Ubuntu 22.04
> Importance: High
> 
> Yuwei:
>   The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 (BaseTools:
> Fix DSC LibraryClass precedence rule) introduces this issue. I agree 
> with Ard suggestion to revert this change first for this stable tag 
> 202208. Then, we can discuss this change in the detail.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Ard Biesheuvel 
> > 发送时间: 2022年8月22日 17:34
> > 收件人: devel@edk2.groups.io; rebe...@bsdio.com; Feng, Bob C 
> > ; Liming Gao 
> > 抄送: Andrew Fish ; Leif Lindholm 
> > ; Michael D Kinney 
> > ; Jian J Wang 
> > 主题: Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu
> > 22.04
> >
> > On Mon, 22 Aug 2022 at 11:30, Ard Biesheuvel  wrote:
> > >
> > > On Mon, 22 Aug 2022 at 11:11, Ard Biesheuvel  wrote:
> > > >
> > > > (cc Bob)
> > > >
> > > > NOTE this affects the stable tag - please see below
> > > >
> > > >
> > > > On Sun, 21 Aug 2022 at 06:34, Rebecca Cran 
> > wrote:
> > > > >
> > > > > I noticed that MdeModulePkg fails to build on my Ubuntu 22.04 
> > > > > system (and previously on the Ubuntu 20.04 installation). Is 
> > > > > this a
> known bug?
> > > > >
> > > > > It shouldn't be relevant, but I'm using gcc version 11.2.0 
> > > > > (Ubuntu 11.2.0-17ubuntu1). But perhaps more relevant, I'm 
> > > > > using
> Python 3.10.4.
> > > > >
> > > > > I'm trying to build commit
> > e2ac68a23b4954d5c0399913a1df3dd9fd90315d.
> > > > >
> > > > >
> > > > > bcran@photon:~/src/tmp/edk2$ build -p
> > MdeModulePkg/MdeModulePkg.dsc -a
> > > > > AARCH64 -t GCC5 -b RELEASE
> > > > > Build environment: 
> > > > > Linux-5.15.0-46-generic-x86_64-with-glibc2.35
> > > > > Build start time: 22:29:18, Aug.20 2022
> > > > >
> > > > > WORKSPACE= /home/bcran/src/tmp/edk2
> > > > > EDK_TOOLS_PATH   = /home/bcran/src/tmp/edk2/BaseTools
> > > > > CONF_PATH= /home/bcran/src/tmp/edk2/Conf
> > > > > PYTHON_COMMAND   = /usr/bin/python3
> > > > >
> > > > >
> > > > > Processing meta-data
> > > > > .Architecture(s)  = AARCH64
> > > > > Build target = RELEASE
> > > > > Toolchain= GCC5
> > > > >
> > > > > Active Platform  =
> > > > > /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dsc
> > > > >
> > > > >
> > > > > build.py...
> > > > >
> >
> /home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL
> > ockBoxPeiLib.inf(42):
> > > > > error 3000: PCD
> > > > > [gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode] in
> > > > >
> >
> [/home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL
> > ockBoxPeiLib.inf]
> > > > > is not found in dependent packages:
> > > > >
> /home/bcran/src/tmp/edk2/MdePkg/MdePkg.dec
> > > > >
> > /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dec
> > > > >
> > > > >
> > > >
> 

Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04

2022-08-23 Thread Bob Feng
Hi Liming,

Reverting patch may not a good idea, some platforms have done the 
implementation based on the DSC spec, if revert, those platforms build will 
break.
This commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 make the Basetools 
behavior be consistent with DSC spec so I don't think it's a regression bug. 

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Tuesday, August 23, 2022 9:55 AM
To: 'Ard Biesheuvel' ; devel@edk2.groups.io; 
rebe...@bsdio.com; Feng, Bob C ; Chen, Christine 

Cc: 'Andrew Fish' ; 'Leif Lindholm' 
; Kinney, Michael D ; 
Wang, Jian J 
Subject: 回复: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu 22.04
Importance: High

Yuwei:
  The commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 (BaseTools: Fix DSC 
LibraryClass precedence rule) introduces this issue. I agree with Ard 
suggestion to revert this change first for this stable tag 202208. Then, we can 
discuss this change in the detail. 

Thanks
Liming
> -邮件原件-
> 发件人: Ard Biesheuvel 
> 发送时间: 2022年8月22日 17:34
> 收件人: devel@edk2.groups.io; rebe...@bsdio.com; Feng, Bob C 
> ; Liming Gao 
> 抄送: Andrew Fish ; Leif Lindholm 
> ; Michael D Kinney 
> ; Jian J Wang 
> 主题: Re: [edk2-devel] MdeModulePkg build fails for AARCH64 on Ubuntu
> 22.04
> 
> On Mon, 22 Aug 2022 at 11:30, Ard Biesheuvel  wrote:
> >
> > On Mon, 22 Aug 2022 at 11:11, Ard Biesheuvel  wrote:
> > >
> > > (cc Bob)
> > >
> > > NOTE this affects the stable tag - please see below
> > >
> > >
> > > On Sun, 21 Aug 2022 at 06:34, Rebecca Cran 
> wrote:
> > > >
> > > > I noticed that MdeModulePkg fails to build on my Ubuntu 22.04 
> > > > system (and previously on the Ubuntu 20.04 installation). Is this a 
> > > > known bug?
> > > >
> > > > It shouldn't be relevant, but I'm using gcc version 11.2.0 
> > > > (Ubuntu 11.2.0-17ubuntu1). But perhaps more relevant, I'm using Python 
> > > > 3.10.4.
> > > >
> > > > I'm trying to build commit
> e2ac68a23b4954d5c0399913a1df3dd9fd90315d.
> > > >
> > > >
> > > > bcran@photon:~/src/tmp/edk2$ build -p
> MdeModulePkg/MdeModulePkg.dsc -a
> > > > AARCH64 -t GCC5 -b RELEASE
> > > > Build environment: Linux-5.15.0-46-generic-x86_64-with-glibc2.35
> > > > Build start time: 22:29:18, Aug.20 2022
> > > >
> > > > WORKSPACE= /home/bcran/src/tmp/edk2
> > > > EDK_TOOLS_PATH   = /home/bcran/src/tmp/edk2/BaseTools
> > > > CONF_PATH= /home/bcran/src/tmp/edk2/Conf
> > > > PYTHON_COMMAND   = /usr/bin/python3
> > > >
> > > >
> > > > Processing meta-data
> > > > .Architecture(s)  = AARCH64
> > > > Build target = RELEASE
> > > > Toolchain= GCC5
> > > >
> > > > Active Platform  =
> > > > /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dsc
> > > >
> > > >
> > > > build.py...
> > > >
> /home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL
> ockBoxPeiLib.inf(42):
> > > > error 3000: PCD
> > > > [gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode] in
> > > >
> [/home/bcran/src/tmp/edk2/MdeModulePkg/Library/SmmLockBoxLib/SmmL
> ockBoxPeiLib.inf]
> > > > is not found in dependent packages:
> > > >  /home/bcran/src/tmp/edk2/MdePkg/MdePkg.dec
> > > >
> /home/bcran/src/tmp/edk2/MdeModulePkg/MdeModulePkg.dec
> > > >
> > > >
> > >
> > > This looks like a BaseTools regression to me - afaik, these 
> > > packages all used to build for AARCH64 in the past.
> > >
> > > The following LockBoxLib resolutions appear in MdeModulePkg.dsc 
> > > (with line numbers)
> > >
> > > 115-[LibraryClasses.common.PEIM]
> > > 119:
> LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf
> > >
> > > 178-[LibraryClasses.ARM, LibraryClasses.AARCH64]
> > > 181:
> LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
> > >
> > > No other [LlibraryClasses] references to SmmLockBoxPeiLib.inf 
> > > exist in that file, and the [Components] reference does not apply to 
> > > AARCH64.
> > >
> > > This means the DSC parser ends up using the earlier definition, 
> > > which I think is a bug, or at least a change in behavior. Note 
> > > that doing this silently could potentially break many platforms in 
> > > subtle ways so I think this should be root caused and preferably 
> > > fixed before creating the stable tag.
> >
> > Seems to be deliberate:
> >
> > commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860
> > Author: Chen, Christine 
> > Date:   Thu Jun 30 17:04:05 2022 +0800
> >
> > BaseTools: Fix DSC LibraryClass precedence rule
> >
> > but I don't think the impact on other platforms and drivers has been 
> > taken into account here. Also, the document [0] seems ambiguous to me:
> >
> > """
> > The first globally defined library instance, defined in a DSC file, 
> > that satisfies a module's requirement for a Library Class, unless 
> > specifically overridden by the module in the [Components] section, 
> > will be used.
> > """
> >
> > This says that the first occurrence of a library instance definition 
> > that satisfies a INF 

Re: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided

2022-08-15 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael D Kinney
Sent: Tuesday, August 16, 2022 9:49 AM
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev ; Feng, Bob C 
; Gao, Liming ; Chen, Christine 

Subject: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: 
Preserve prior behavior when no GUID provided

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4022

If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID then 
preserve the prior behavior until all downstream platforms are updated to pass 
in a GUID value.

Cc: Konstantin Aladyshev 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Michael D Kinney 
---
 BaseTools/Source/C/GenSec/GenSec.c | 29 -
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index d86cc197cc26..191a49d99228 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1752,8 +1752,7 @@ Routine Description:
   // Check whether there is GUID for the SubtypeGuid section
   //
   if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid 
(, ) == 0)) {
-Error (NULL, 0, 1001, "Missing options", "GUID");
-goto Finish;
+fprintf (stdout, "Warning: input guid value is required for section 
+ type %s\n", SectionName);
   }
 
   //
@@ -1825,13 +1824,25 @@ Routine Description:
 break;
 
   case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
-Status = GenSectionSubtypeGuidSection (
-  InputFileName,
-  InputFileAlign,
-  InputFileNum,
-  ,
-  
-  );
+if (CompareGuid (, ) == 0) {
+  //
+  // Preserve existing behavior when no GUID value is provided
+  //
+  Status = GenSectionCommonLeafSection (
+InputFileName,
+InputFileNum,
+SectType,
+
+);
+} else {
+  Status = GenSectionSubtypeGuidSection (
+InputFileName,
+InputFileAlign,
+InputFileNum,
+,
+
+);
+}
 break;
 
   case EFI_SECTION_VERSION:
--
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92468): https://edk2.groups.io/g/devel/message/92468
Mute This Topic: https://groups.io/mt/93050981/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header

2022-08-15 Thread Bob Feng
This patch is good to me.

Reviewed-by: Bob Feng 

-Original Message-
From: Kinney, Michael D  
Sent: Tuesday, August 16, 2022 9:49 AM
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev ; Feng, Bob C 
; Gao, Liming ; Chen, Christine 

Subject: [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix 
EFI_SECTION_FREEFORM_SUBTYPE_GUID header

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4021

When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required the use 
of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section type to 
EFI_SECTION_FREEFORM_SUBTYPE_GUID.

Cc: Konstantin Aladyshev 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Michael D Kinney 
---
 BaseTools/Source/C/GenSec/GenSec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index 191a49d99228..e318d45f77d3 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1112,7 +1112,7 @@ Routine Description:
   //
   if (TotalLength >= MAX_SECTION_SIZE) {
 SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;
-SubtypeGuidSect2->CommonHeader.Type = EFI_SECTION_GUID_DEFINED;
+SubtypeGuidSect2->CommonHeader.Type = 
EFI_SECTION_FREEFORM_SUBTYPE_GUID;
 SubtypeGuidSect2->CommonHeader.Size[0]  = (UINT8) 0xff;
 SubtypeGuidSect2->CommonHeader.Size[1]  = (UINT8) 0xff;
 SubtypeGuidSect2->CommonHeader.Size[2]  = (UINT8) 0xff;
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92467): https://edk2.groups.io/g/devel/message/92467
Mute This Topic: https://groups.io/mt/93050982/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Show FV section boundaries

2022-08-04 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Tuesday, July 19, 2022 11:46 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Show FV section boundaries

Currently there is no labels for start and end of the 
EFI_SECTION_FIRMWARE_VOLUME_IMAGE type section. Therefore it is not possible to 
see where the FV section ends and another section starts.
Add labels for start and end of the FV sections to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 47a8f80f46..a78a7e7976 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1796,11 +1796,13 @@ Returns:
   break;  case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:+  printf 
("/ Firmware Volume section start ---\\\n");   
Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE);   if (EFI_ERROR 
(Status)) { Error (NULL, 0, 0003, "printing of FV section contents 
failed", NULL); return EFI_SECTION_ERROR;   }+  printf 
("\\ Firmware Volume section end -/\n");   
break;  case EFI_SECTION_COMPATIBILITY16:-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92115): https://edk2.groups.io/g/devel/message/92115
Mute This Topic: https://groups.io/mt/92485348/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/GenSec: Support EFI_SECTION_FREEFORM_SUBTYPE_GUID sections

2022-08-04 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Wednesday, July 20, 2022 10:08 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/GenSec: Support EFI_SECTION_FREEFORM_SUBTYPE_GUID 
sections

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/GenSec/GenSec.c | 171 -
 1 file changed, 169 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index 35a1ac64ea..d86cc197cc 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -988,6 +988,155 @@ Returns:
   return EFI_SUCCESS;

 }

 

+EFI_STATUS

+GenSectionSubtypeGuidSection (

+  CHAR8**InputFileName,

+  UINT32   *InputFileAlign,

+  UINT32   InputFileNum,

+  EFI_GUID *SubTypeGuid,

+  UINT8**OutFileBuffer

+  )

+/*++

+

+Routine Description:

+

+  Generate a section of type EFI_SECTION_FREEFORM_SUBTYPE_GUID

+  The function won't validate the input file contents.

+  The utility will add section header to the file.

+

+Arguments:

+

+  InputFileName - Name of the input file.

+

+  InputFileAlign - Alignment required by the input file data.

+

+  InputFileNum - Number of input files. Should be 1 for this section.

+

+  SubTypeGuid - Specify vendor guid value.

+

+  OutFileBuffer   - Buffer pointer to Output file contents

+

+Returns:

+

+  EFI_SUCCESS on successful return

+  EFI_INVALID_PARAMETER if InputFileNum is less than 1

+  EFI_ABORTED if unable to open input file.

+  EFI_OUT_OF_RESOURCES  No resource to complete the operation.

+

+--*/

+{

+  UINT32TotalLength;

+  UINT32InputLength;

+  UINT32Offset;

+  UINT8 *FileBuffer;

+  EFI_STATUSStatus;

+  EFI_FREEFORM_SUBTYPE_GUID_SECTION  *SubtypeGuidSect;

+  EFI_FREEFORM_SUBTYPE_GUID_SECTION2  *SubtypeGuidSect2;

+

+

+  InputLength = 0;

+  Offset  = 0;

+  FileBuffer  = NULL;

+  TotalLength = 0;

+

+  if (InputFileNum > 1) {

+Error (NULL, 0, 2000, "Invalid parameter", "more than one input file 
specified");

+return STATUS_ERROR;

+  } else if (InputFileNum < 1) {

+Error (NULL, 0, 2000, "Invalid parameter", "no input file specified");

+return STATUS_ERROR;

+  }

+

+  //

+  // read all input file contents into a buffer

+  // first get the size of all file contents

+  //

+  Status = GetSectionContents (

+InputFileName,

+InputFileAlign,

+InputFileNum,

+FileBuffer,

+

+);

+

+  if (Status == EFI_BUFFER_TOO_SMALL) {

+Offset = sizeof (EFI_FREEFORM_SUBTYPE_GUID_SECTION);

+if (InputLength + Offset >= MAX_SECTION_SIZE) {

+  Offset = sizeof (EFI_FREEFORM_SUBTYPE_GUID_SECTION2);

+}

+TotalLength = InputLength + Offset;

+

+FileBuffer = (UINT8 *) malloc (InputLength + Offset);

+if (FileBuffer == NULL) {

+  Error (NULL, 0, 4001, "Resource", "memory cannot be allocated");

+  return EFI_OUT_OF_RESOURCES;

+}

+//

+// read all input file contents into a buffer

+//

+Status = GetSectionContents (

+  InputFileName,

+  InputFileAlign,

+  InputFileNum,

+  FileBuffer + Offset,

+  

+  );

+  }

+

+  if (EFI_ERROR (Status)) {

+if (FileBuffer != NULL) {

+  free (FileBuffer);

+}

+Error (NULL, 0, 0001, "Error opening file for reading", InputFileName[0]);

+return Status;

+  }

+

+  if (InputLength == 0) {

+if (FileBuffer != NULL) {

+  free (FileBuffer);

+}

+Error (NULL, 0, 2000, "Invalid parameter", "the size of input file %s 
can't be zero", InputFileName);

+return EFI_NOT_FOUND;

+  }

+

+  //

+  // InputLength != 0, but FileBuffer == NULL means out of resources.

+  //

+  if (FileBuffer == NULL) {

+Error (NULL, 0, 4001, "Resource", "memory cannot be allocated");

+return EFI_OUT_OF_RESOURCES;

+  }

+

+  //

+  // Now data is in FileBuffer + Offset

+  //

+  if (TotalLength >= MAX_SECTION_SIZE) {

+SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;

+SubtypeGuidSect2->CommonHeader.Type = EFI_SECTION_GUID_DEFINED;

+SubtypeGuidSect2->CommonHeader.Size[0]  = (UINT8) 0xff;

+SubtypeGuidSect2->CommonHeader.Size[1]  = (UINT8) 0xff;

+SubtypeGuidSect2->CommonHeader.Size[2]  = (UINT8) 0xff;

+SubtypeGuidSect2->CommonHeader.ExtendedSize = InputLength + sizeof 
(EFI_FREEFORM_SUBTYPE_GUID_SECTION2);

+memcpy (&(SubtypeGuidSect2->SubTypeGuid), SubTypeGuid, sizeof (EFI_GUID));

+  } else {

+SubtypeGuidSect = (EFI_FREEFORM_SUBTYPE_GUID_SECTION *) FileBuffer;

+Subtyp

Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse EFI_SECTION_FREEFORM_SUBTYPE_GUID header

2022-08-04 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Wednesday, July 20, 2022 8:01 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Parse EFI_SECTION_FREEFORM_SUBTYPE_GUID 
header

Print 'SubtypeGuid' field from the EFI_FREEFORM_SUBTYPE_GUID_SECTION structure.
This value describes the raw data inside the section.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index a78a7e7976..4628e756d7 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1806,12 +1806,20 @@ Returns:
   break;  case EFI_SECTION_COMPATIBILITY16:-case 
EFI_SECTION_FREEFORM_SUBTYPE_GUID:   //   // Section does not contain 
any further header information.   //   break; +case 
EFI_SECTION_FREEFORM_SUBTYPE_GUID:+  printf ("  Guid:  ");+  if 
(SectionHeaderLen == sizeof (EFI_COMMON_SECTION_HEADER))+PrintGuid 
(&((EFI_FREEFORM_SUBTYPE_GUID_SECTION *)Ptr)->SubTypeGuid);+  else+
PrintGuid (&((EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *)Ptr)->SubTypeGuid);+  
printf ("\n");+  break;+ case EFI_SECTION_PEI_DEPEX: case 
EFI_SECTION_DXE_DEPEX: case EFI_SECTION_SMM_DEPEX:-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92116): https://edk2.groups.io/g/devel/message/92116
Mute This Topic: https://groups.io/mt/92502730/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/GenSec: Fix typo

2022-08-04 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Tuesday, July 19, 2022 10:27 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH] BaseTools/GenSec: Fix typo

Fix typo in the help message.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/GenSec/GenSec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index b1d05367ec..35a1ac64ea 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -191,7 +191,7 @@ Returns:
 as 0, tool get alignment value from SectionFile. It 
is\n\ specified in same order that the section file is 
input.\n");   fprintf (stdout, "  --dummy dummyfile\n\-
compare dummpyfile with input_file to decide whether\n\+
compare dummyfile with input_file to decide whether\n\ 
need to set PROCESSING_REQUIRED attribute.\n");   fprintf (stdout, "  -v, 
--verbose Turn on verbose output with informational messages.\n");   
fprintf (stdout, "  -q, --quiet   Disable all messages except key 
message and fatal error\n");-- 
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91533): https://edk2.groups.io/g/devel/message/91533
Mute This Topic: https://groups.io/mt/92483493/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92114): https://edk2.groups.io/g/devel/message/92114
Mute This Topic: https://groups.io/mt/92483493/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] BaseTools/VolInfo: Show encapsulation sections

2022-07-25 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Tuesday, July 19, 2022 8:29 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH v2] BaseTools/VolInfo: Show encapsulation sections

Currently there is no labels for start and end of the encapsulation sections. 
Therefore it is not possible to see where the encapsulation section ends and 
another section starts.
Add labels for start and end of encapsulation sections to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index c1f81f2dcb..ce1775f7fd 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1903,7 +1903,9 @@ Returns:
 return EFI_SECTION_ERROR;   } +  printf ("/ 
Encapsulation section start -\\\n");   Status = 
ParseSection (UncompressedBuffer, UncompressedLength);+  printf 
("\\ Encapsulation section end ---/\n");if 
(CompressionType == EFI_STANDARD_COMPRESSION) { //@@ -2022,6 +2024,7 @@ 
Returns:
   return EFI_SECTION_ERROR; } +printf ("/ 
Encapsulation section start -\\\n"); Status = 
ParseSection (   ToolOutputBuffer,   
ToolOutputLength@@ -2030,6 +2033,7 @@ Returns:
   Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", 
NULL);   return EFI_SECTION_ERROR; }+printf 
("\\ Encapsulation section end ---/\n");//  
 // Check for CRC32 sections which we can handle internally if needed.@@ 
-2042,6 +2046,7 @@ Returns:
 // // CRC32 guided section //+printf 
("/ Encapsulation section start -\\\n"); 
Status = ParseSection (   SectionBuffer + DataOffset,   
BufferLength - DataOffset@@ -2050,6 +2055,7 @@ Returns:
   Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL); 
  return EFI_SECTION_ERROR; }+printf ("\\ 
Encapsulation section end ---/\n");   } else { //   
  // We don't know how to parse it now.-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91814): https://edk2.groups.io/g/devel/message/91814
Mute This Topic: https://groups.io/mt/92481203/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for signtool to input subject name to sign capsule file

2022-07-25 Thread Bob Feng
Created the PR for merge. https://github.com/tianocore/edk2/pull/3137

-Original Message-
From: gaoliming  
Sent: Monday, July 25, 2022 12:27 PM
To: devel@edk2.groups.io; Lin, Jason1 
Cc: Feng, Bob C ; Chen, Christine ; 
Kinney, Michael D ; Chiang, Dakota 

Subject: 回复: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for 
signtool to input subject name to sign capsule file

Jason:
  Thanks for you to add the detail usage model in BZ 3928. I have no other 
comments. Reviewed-by: Liming Gao 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Lin, Jason1
> 发送时间: 2022年7月8日 19:42
> 收件人: devel@edk2.groups.io
> 抄送: Jason1 Lin ; Bob Feng 
> ; Liming Gao ; Yuwei 
> Chen ; Michael D Kinney 
> ; Dakota Chiang 
> 主题: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for 
> signtool
to
> input subject name to sign capsule file
> 
> From: Jason1 Lin 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3928
> 
> Windows-based system using signtool.exe to sign the capsule.
> Add the support to using "--subject-name" argument to assign the 
> subject name used to sign the capsule file.
> This argument would pass to signtool.exe as a part of input argument 
> with "/n" flag.
> 
> NOTE: If using signtool.exe to sign capsule at least need to
>   choose one of "--pfx-file" and "--subject-name"
>   argument to input the value.
> 
> Signed-off-by: Jason1 Lin 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Michael D Kinney 
> Cc: Dakota Chiang 
> ---
>  BaseTools/Source/Python/Capsule/GenerateCapsule.py | 43
> 
>  1 file changed, 34 insertions(+), 9 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> index b8039db878..35435946c6 100644
> --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> @@ -10,7 +10,7 @@
>  # keep the tool as simple as possible, it has the following limitations:
> 
>  #   * Do not support vendor code bytes in a capsule.
> 
>  #
> 
> -# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
> reserved.
> 
> +# Copyright (c) 2018 - 2022, Intel Corporation. All rights 
> +reserved.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> 
> 
> @@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader
> import FmpPayloadHeaderClass
>  # Globals for help information
> 
>  #
> 
>  __prog__= 'GenerateCapsule'
> 
> -__version__ = '0.9'
> 
> -__copyright__   = 'Copyright (c) 2018, Intel Corporation. All rights
reserved.'
> 
> +__version__ = '0.10'
> 
> +__copyright__   = 'Copyright (c) 2022, Intel Corporation. All rights
> reserved.'
> 
>  __description__ = 'Generate a capsule.\n'
> 
> 
> 
> -def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
> 
> +def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, 
> +Verbose
=
> False):
> 
>  #
> 
>  # Create a temporary directory
> 
>  #
> 
> @@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, ToolPath, 
> PfxFile, Verbose = False):
>  Command = Command + '"{Path}" '.format (Path = os.path.join
(ToolPath,
> 'signtool.exe'))
> 
>  Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData 
> /p7co 1.2.840.113549.1.7.2 '
> 
>  Command = Command + '/p7 {TempDir} '.format (TempDir =
> TempDirectoryName)
> 
> -Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
> 
> +if PfxFile is not None:
> 
> +Command = Command + '/f {PfxFile} '.format (PfxFile = 
> + PfxFile)
> 
> +if SubjectName is not None:
> 
> +Command = Command + '/n {SubjectName} '.format
> (SubjectName = SubjectName)
> 
>  Command = Command + TempFileName
> 
>  if Verbose:
> 
>  print (Command)
> 
> @@ -105,7 +108,7 @@ def SignPayloadSignTool (Payload, ToolPath, 
> PfxFile, Verbose = False):
>  shutil.rmtree (TempDirectoryName)
> 
>  return Signature
> 
> 
> 
> -def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, 
> Verbose
=
> False):
> 
> +def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile,
SubjectName,
> Verbose = False):
> 
>  print ('signtool verify is not supported.')
> 
>  raise ValueError ('GenerateCapsule: error: signtool verify is not
> supported.')
> 
> 
> 
> @@ -249,6 +252,7 @@ if __name__ == '__main__':
>  HardwareInstance = ConvertJsonValue
> (Config, 'HardwareInstance', ValidateUnsign

Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display

2022-07-24 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Monday, July 18, 2022 5:44 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display

- Correct typo in print statement,
- "BuildNumber" field is UINT16, therefore it needs "0x%04X" format modifier,
- "VersionString" field is CHAR16, therefore the input data should be processed 
to be displayed with "%s" printf modifier.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 8b6fcffa48..ed56587058 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1676,6 +1676,7 @@ Returns:
   CHAR8   *ToolInputFileName;   CHAR8   
*ToolOutputFileName;   CHAR8   *UIFileName;+  CHAR8   
*VersionString;ParsedLength = 0;   ToolInputFileName = NULL;@@ -1816,8 
+1817,14 @@ Returns:
   break;  case EFI_SECTION_VERSION:-  printf ("  Build Number:  
0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));-  printf ("  Version Strg: 
 %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));+  printf ("  
Build Number:  0x%04X\n", *(UINT16 *)(Ptr + SectionHeaderLen));+  
VersionString = (CHAR8 *) malloc (UnicodeStrLen (((EFI_VERSION_SECTION *) 
Ptr)->VersionString) + 1);+  if (VersionString == NULL) {+Error 
(NULL, 0, 4001, "Resource", "memory cannot be allocated!");+return 
EFI_OUT_OF_RESOURCES;+  }+  Unicode2AsciiString (((EFI_VERSION_SECTION 
*) Ptr)->VersionString, VersionString);+  printf ("  Version String:  
%s\n", VersionString);   break;  case EFI_SECTION_COMPRESSION:-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91774): https://edk2.groups.io/g/devel/message/91774
Mute This Topic: https://groups.io/mt/92454946/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

2022-07-24 Thread Bob Feng
Copyright (c) 2022, Konstantin Aladyshev 
Will be fine.

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Sunday, July 24, 2022 4:34 PM
To: Feng, Bob C 
Cc: devel@edk2.groups.io; Gao, Liming ; Chen, 
Christine 
Subject: Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

Hi, Bob!

How should I update it?

Should I increase a year for the Intel Corporation like this ``` Copyright (c) 
1999 - 2022, Intel Corporation. All rights reserved. ``` Or should I enter 
my name on another string?
```
Copyright (c) 2022, Konstantin Aladyshev  ```

Best regards,
Konstantin Aladyshev

On Sun, Jul 24, 2022 at 9:10 AM Feng, Bob C  wrote:
>
> Hi Konstantin,
>
> Could you update the copyright in VolInfo.c?
>
> Thanks,
> Bob
>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> Konstantin Aladyshev
> Sent: Friday, July 22, 2022 11:38 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> ; Chen, Christine ; 
> Konstantin Aladyshev 
> Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files
>
> Output file GUIDs from the DXE and PEI apriori files.
>
> Signed-off-by: Konstantin Aladyshev 
> ---
>  BaseTools/Source/C/VolInfo/VolInfo.c | 74 
> 
>  1 file changed, 74 insertions(+)
>
> diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
> b/BaseTools/Source/C/VolInfo/VolInfo.c
> index 2d7c6212b3..28c6806cf0 100644
> --- a/BaseTools/Source/C/VolInfo/VolInfo.c
> +++ b/BaseTools/Source/C/VolInfo/VolInfo.c
> @@ -43,6 +43,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  //  EFI_GUID  gEfiCrc32GuidedSectionExtractionProtocolGuid = 
> EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;+EFI_GUID  
> gPeiAprioriFileNameGuid = { 0x1b45cc0a, 0x156a, 0x428a, { 0XAF, 0x62,  0x49, 
> 0x86, 0x4d, 0xa0, 0xe6, 0xe6 }};+EFI_GUID  gAprioriGuid = { 0xFC510EE7, 
> 0xFFDC, 0x11D4, { 0xBD, 0x41, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }};  #define 
> UTILITY_MAJOR_VERSION  1 #define UTILITY_MINOR_VERSION  0@@ -107,6 
> +109,12 @@ ReadHeader (
>OUT BOOLEAN   *ErasePolarity   ); +STATIC+EFI_STATUS+PrintAprioriFile (+  
> EFI_FFS_FILE_HEADER *FileHeader+  );+ STATIC EFI_STATUS PrintFileInfo 
> (@@ -1083,6 +1091,53 @@ Returns:
>return EFI_SUCCESS; } +STATIC+EFI_STATUS+PrintAprioriFile (+  
> EFI_FFS_FILE_HEADER *FileHeader+  )+/*Routine Description:++  
> Print GUIDs from the APRIORI file++Arguments:++  FileHeader - The file 
> header++Returns:++  EFI_SUCCESS   - The APRIORI file was parsed 
> correctly+  EFI_SECTION_ERROR - Problem with file parsing++--*/+{+  UINT8 
>   GuidBuffer[PRINTED_GUID_BUFFER_SIZE];+  UINT32  
> HeaderSize;++  HeaderSize = FvBufGetFfsHeaderSize (FileHeader);++  if 
> (FileHeader->Type != EFI_FV_FILETYPE_FREEFORM)+return 
> EFI_SECTION_ERROR;++  EFI_COMMON_SECTION_HEADER* SectionHeader = 
> (EFI_COMMON_SECTION_HEADER *) ((UINTN) FileHeader + HeaderSize);+  if 
> (SectionHeader->Type != EFI_SECTION_RAW)+return EFI_SECTION_ERROR;++  
> UINT32 SectionLength = GetSectionFileLength (SectionHeader);+  EFI_GUID* 
> FileName = (EFI_GUID *) ((UINT8 *) SectionHeader + sizeof 
> (EFI_COMMON_SECTION_HEADER));+  while (((UINT8 *) FileName) < ((UINT8 *) 
> SectionHeader + SectionLength)) {+PrintGuidToBuffer (FileName, 
> GuidBuffer, sizeof (GuidBuffer), TRUE);+printf ("%s  ", GuidBuffer);+
> PrintGuidName (GuidBuffer);+printf ("\n");+FileName++;+  }++  return 
> EFI_SUCCESS;+}+ STATIC EFI_STATUS PrintFileInfo (@@ -1339,6 +1394,25 @@ 
> Returns:
>  break;   } +  if (!CompareGuid (+   >Name,+   
> +   ))+  {+printf("\n");+printf("PEI 
> APRIORI FILE:\n");+return PrintAprioriFile (FileHeader);+  }+  if 
> (!CompareGuid (+   >Name,+   +   ))+  {+ 
>printf("\n");+printf("DXE APRIORI FILE:\n");+return 
> PrintAprioriFile (FileHeader);+  }+   return EFI_SUCCESS; } --
> 2.25.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#91722): 
> https://edk2.groups.io/g/devel/message/91722
> Mute This Topic: https://groups.io/mt/92550206/1768742
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub 
> [bob.c.f...@intel.com] -=-=-=-=-=-=
>
>







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91765): https://edk2.groups.io/g/devel/message/91765
Mute This Topic: https://groups.io/mt/92550206/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

2022-07-24 Thread Bob Feng
Hi Konstantin,

Could you update the copyright in VolInfo.c?

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Konstantin 
Aladyshev
Sent: Friday, July 22, 2022 11:38 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Parse apriori files

Output file GUIDs from the DXE and PEI apriori files.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 74 
 1 file changed, 74 insertions(+)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 2d7c6212b3..28c6806cf0 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -43,6 +43,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //  EFI_GUID  gEfiCrc32GuidedSectionExtractionProtocolGuid = 
EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;+EFI_GUID  
gPeiAprioriFileNameGuid = { 0x1b45cc0a, 0x156a, 0x428a, { 0XAF, 0x62,  0x49, 
0x86, 0x4d, 0xa0, 0xe6, 0xe6 }};+EFI_GUID  gAprioriGuid = { 0xFC510EE7, 0xFFDC, 
0x11D4, { 0xBD, 0x41, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }};  #define 
UTILITY_MAJOR_VERSION  1 #define UTILITY_MINOR_VERSION  0@@ -107,6 
+109,12 @@ ReadHeader (
   OUT BOOLEAN   *ErasePolarity   ); +STATIC+EFI_STATUS+PrintAprioriFile (+  
EFI_FFS_FILE_HEADER *FileHeader+  );+ STATIC EFI_STATUS PrintFileInfo 
(@@ -1083,6 +1091,53 @@ Returns:
   return EFI_SUCCESS; } +STATIC+EFI_STATUS+PrintAprioriFile (+  
EFI_FFS_FILE_HEADER *FileHeader+  )+/*Routine Description:++  Print 
GUIDs from the APRIORI file++Arguments:++  FileHeader - The file 
header++Returns:++  EFI_SUCCESS   - The APRIORI file was parsed correctly+  
EFI_SECTION_ERROR - Problem with file parsing++--*/+{+  UINT8   
GuidBuffer[PRINTED_GUID_BUFFER_SIZE];+  UINT32  HeaderSize;++  
HeaderSize = FvBufGetFfsHeaderSize (FileHeader);++  if (FileHeader->Type != 
EFI_FV_FILETYPE_FREEFORM)+return EFI_SECTION_ERROR;++  
EFI_COMMON_SECTION_HEADER* SectionHeader = (EFI_COMMON_SECTION_HEADER *) 
((UINTN) FileHeader + HeaderSize);+  if (SectionHeader->Type != 
EFI_SECTION_RAW)+return EFI_SECTION_ERROR;++  UINT32 SectionLength = 
GetSectionFileLength (SectionHeader);+  EFI_GUID* FileName = (EFI_GUID *) 
((UINT8 *) SectionHeader + sizeof (EFI_COMMON_SECTION_HEADER));+  while 
(((UINT8 *) FileName) < ((UINT8 *) SectionHeader + SectionLength)) {+
PrintGuidToBuffer (FileName, GuidBuffer, sizeof (GuidBuffer), TRUE);+printf 
("%s  ", GuidBuffer);+PrintGuidName (GuidBuffer);+printf ("\n");+
FileName++;+  }++  return EFI_SUCCESS;+}+ STATIC EFI_STATUS PrintFileInfo (@@ 
-1339,6 +1394,25 @@ Returns:
 break;   } +  if (!CompareGuid (+   >Name,+   
+   ))+  {+printf("\n");+printf("PEI 
APRIORI FILE:\n");+return PrintAprioriFile (FileHeader);+  }+  if 
(!CompareGuid (+   >Name,+   +   ))+  {+   
 printf("\n");+printf("DXE APRIORI FILE:\n");+return PrintAprioriFile 
(FileHeader);+  }+   return EFI_SUCCESS; } -- 
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91722): https://edk2.groups.io/g/devel/message/91722
Mute This Topic: https://groups.io/mt/92550206/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91763): https://edk2.groups.io/g/devel/message/91763
Mute This Topic: https://groups.io/mt/92550206/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch v2 10/11] BaseTools: Remove all UGA support

2022-07-23 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Jiang, Guomin  
Sent: Friday, July 15, 2022 9:51 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [Patch v2 10/11] BaseTools: Remove all UGA support

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove UGA code in BaseTools

Signed-off-by: Guomin Jiang 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +-  
BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 --
 2 files changed, 1 insertion(+), 213 deletions(-)  delete mode 100644 
BaseTools/Source/C/Include/Protocol/UgaDraw.h

diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h 
b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
index 448350967bbf..4c651f89e0eb 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -6,7 +6,7 @@
   @par Revision Reference:
   This protocol is defined in HII spec 0.92.
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights 
+ reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -28,20 +28,6 @@
 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 
0xe1} \
   }
 
-// BugBug:
-//
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-//  UINT8 Blue;
-//  UINT8 Green;
-//  UINT8 Red;
-//  UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//
-//
-
 typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;
 
 //
@@ -575,39 +561,6 @@ EFI_STATUS
   IN OUT UINT32*InternalStatus
   );
 
-/**
-  Translates a glyph into the format required for input to the Universal
-  Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
-  @param  This  A pointer to the EFI_HII_PROTOCOL instance.
-  @param  GlyphBuffer   A pointer to the buffer that contains glyph 
data.
-  @param  ForegroundThe foreground setting requested to be used 
for the
-generated BltBuffer data.
-  @param  BackgroundThe background setting requested to be used 
for the
-generated BltBuffer data.
-  @param  Count The entry in the BltBuffer upon which to act.
-  @param  Width The width in bits of the glyph being converted.
-  @param  HeightThe height in bits of the glyph being converted
-  @param  BltBuffer A pointer to the buffer that contains the data 
that is
-ready to be used by the UGA BLT routines.
-
-  @retval EFI_SUCCESS   It worked.
-  @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
-  IN EFI_HII_PROTOCOL *This,
-  IN UINT8*GlyphBuffer,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
-  IN UINTN Count,
-  IN UINTN Width,
-  IN UINTN Height,
-  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
-  );
-
 /**
   Allows a new string to be added to an already existing string package.
 
@@ -878,9 +831,6 @@ EFI_STATUS
   @param GetGlyph
   Translates a Unicode character into the corresponding font glyph.
 
-  @param GlyphToBlt
-  Converts a glyph value into a format that is ready for a UGA BLT command.
-
   @param NewString
   Allows a new string to be added to an already existing string package.
 
@@ -924,7 +874,6 @@ struct _EFI_HII_PROTOCOL {
 
   EFI_HII_TEST_STRING TestString;
   EFI_HII_GET_GLYPH   GetGlyph;
-  EFI_HII_GLYPH_TO_BLTGlyphToBlt;
 
   EFI_HII_NEW_STRING  NewString;
   EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h 
b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000aeb6b..
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
-  UGA Draw protocol from the EFI 1.1 specification.
-
-  Abstraction of a very simple graphics device.
-
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
-  { \
-0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 
0x39 } \
-  }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
-  Return the current video mode information.
-
-  @param  This  Protocol instance pointer.
-  @param  HorizontalResolution  Current

Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Increase define for highest section value

2022-07-23 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Monday, July 18, 2022 8:56 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Increase define for highest section value

Currently sections with unknown types are displayed as `EFI_SECTION_SMM_DEPEX` 
which is wrong.
Increase the highest value for the section type to 0x1C for correct parsing.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.h 
b/BaseTools/Source/C/VolInfo/VolInfo.h
index 624ac38f0e..377cde80f7 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.h
+++ b/BaseTools/Source/C/VolInfo/VolInfo.h
@@ -22,8 +22,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define EFI_DEP_END   0x08 #define EFI_DEP_SOR   0x09 -#define 
EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1B-#define EFI_SECTION_LAST_SECTION_TYPE  
 0x1B+#define EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1C+#define 
EFI_SECTION_LAST_SECTION_TYPE   0x1C  #define OPENSSL_COMMAND_FORMAT_STRING 
  "%s sha1 -out %s %s" #define EXTRACT_COMMAND_FORMAT_STRING   "%s -d 
-o %s %s"-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91760): https://edk2.groups.io/g/devel/message/91760
Mute This Topic: https://groups.io/mt/92457706/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct alignment attributes display

2022-07-23 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Wednesday, July 13, 2022 9:11 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH] BaseTools/VolInfo: Correct alignment attributes display

Alignment attribute is not a bitmask, therefore we need to compare field value 
with all alignment defines.
Remove duplicate print statements. Unify indent with other attribute print 
statements.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 198 +--
 1 file changed, 96 insertions(+), 102 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index 2457ddd2e7..8b6fcffa48 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -911,140 +911,134 @@ Returns:
 printf ("   EFI_FVB2_WRITE_LOCK_STATUS\n");   } -  if 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1) {+  switch 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT) {+case EFI_FVB2_ALIGNMENT_1: 
printf ("   EFI_FVB2_ALIGNMENT_1\n");-  }--  if 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {-printf ("
EFI_FVB2_ALIGNMENT_2\n");-  }--  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_4) {-printf ("EFI_FVB2_ALIGNMENT_4\n");-  }+
break; -  if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {-printf ("   
 EFI_FVB2_ALIGNMENT_8\n");-  }+case EFI_FVB2_ALIGNMENT_2:+printf (" 
  EFI_FVB2_ALIGNMENT_2\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_16) {-printf ("EFI_FVB2_ALIGNMENT_16\n");-  }+   
 case EFI_FVB2_ALIGNMENT_4:+printf ("   EFI_FVB2_ALIGNMENT_4\n");+
break; -  if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {-printf ("  
  EFI_FVB2_ALIGNMENT_32\n");-  }+case EFI_FVB2_ALIGNMENT_8:+printf 
("   EFI_FVB2_ALIGNMENT_8\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_64) {-printf ("EFI_FVB2_ALIGNMENT_64\n");-  }+   
 case EFI_FVB2_ALIGNMENT_16:+printf ("   EFI_FVB2_ALIGNMENT_16\n");+
break; -  if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {-printf (" 
   EFI_FVB2_ALIGNMENT_128\n");-  }+case EFI_FVB2_ALIGNMENT_32:+
printf ("   EFI_FVB2_ALIGNMENT_32\n");+break; -  if 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {-printf ("
EFI_FVB2_ALIGNMENT_256\n");-  }+case EFI_FVB2_ALIGNMENT_64:+printf ("   
EFI_FVB2_ALIGNMENT_64\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_512) {-printf ("EFI_FVB2_ALIGNMENT_512\n");-  }+ 
   case EFI_FVB2_ALIGNMENT_128:+printf ("   
EFI_FVB2_ALIGNMENT_128\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_1K) {-printf ("EFI_FVB2_ALIGNMENT_1K\n");-  }+   
 case EFI_FVB2_ALIGNMENT_256:+printf ("   EFI_FVB2_ALIGNMENT_256\n");+  
  break; -  if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {-printf 
("EFI_FVB2_ALIGNMENT_2K\n");-  }+case EFI_FVB2_ALIGNMENT_512:+
printf ("   EFI_FVB2_ALIGNMENT_512\n");+break; -  if 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {-printf ("
EFI_FVB2_ALIGNMENT_4K\n");-  }+case EFI_FVB2_ALIGNMENT_1K:+printf ("
   EFI_FVB2_ALIGNMENT_1K\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_8K) {-printf ("EFI_FVB2_ALIGNMENT_8K\n");-  }+   
 case EFI_FVB2_ALIGNMENT_2K:+printf ("   EFI_FVB2_ALIGNMENT_2K\n");+
break; -  if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {-printf (" 
   EFI_FVB2_ALIGNMENT_16K\n");-  }+case EFI_FVB2_ALIGNMENT_4K:+
printf ("   EFI_FVB2_ALIGNMENT_4K\n");+break; -  if 
(VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {-printf ("
EFI_FVB2_ALIGNMENT_32K\n");-  }+case EFI_FVB2_ALIGNMENT_8K:+printf ("   
EFI_FVB2_ALIGNMENT_8K\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_64K) {-printf ("EFI_FVB2_ALIGNMENT_64K\n");-  }+ 
   case EFI_FVB2_ALIGNMENT_16K:+printf ("   
EFI_FVB2_ALIGNMENT_16K\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_128K) {-printf ("EFI_FVB2_ALIGNMENT_128K\n");-  
}+case EFI_FVB2_ALIGNMENT_32K:+printf ("   
EFI_FVB2_ALIGNMENT_32K\n");+break; -  if (VolumeHeader.Attributes & 
EFI_FVB2_ALIGNMENT_256K) {-printf ("EFI_FVB2_ALIGNMENT_256K\n");

Re: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value

2022-07-23 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Li, Yi1  
Sent: Monday, July 11, 2022 1:48 PM
To: devel@edk2.groups.io
Cc: Li, Yi1 ; Feng, Bob C ; Gao, Liming 

Subject: [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of 
default value

This patch is a bug fix about FeatureFlagExpression in INF file:
 INF [Source] section now unconditionally use Pcd default value in DEC  when 
handling FeatureFlagExpression, it is wrong.
 If a Pcd value has been set in the DSC file, we should use latest  value in 
DSC instead of default value.

Cc: Bob Feng 
Cc: Liming Gao 

Signed-off-by: Yi Li 
---
 BaseTools/Source/Python/Workspace/InfBuildData.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 5b9b3d7b4f..e4ff1c6686 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject):
 else:
 for Name, Guid in self.Pcds:
 if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or 
self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
-Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name, 
Guid)].DefaultValue
+PcdFullName = '%s.%s' % (Guid, Name);
+if not PcdFullName in Pcds:
+Pcds[PcdFullName] = self.Pcds[(Name, 
+ Guid)].DefaultValue
 try:
 Value = ValueExpression(Instance, Pcds)()
 if Value == True:
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91758): https://edk2.groups.io/g/devel/message/91758
Mute This Topic: https://groups.io/mt/92304285/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] pip-requirements.txt: Update basetools version to 0.1.26

2022-07-16 Thread Bob Feng
Upgrade the edk2-basetools version from 0.1.14 to 0.1.26

features and bug fixes:
1. Fix the incremental build issue on Linux
@176016387f
2. Fix DSC LibraryClass precedence rule
@039bdb4d3e

Signed-off-by: Bob Feng 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 29424b08bd..b805348baf 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -14,5 +14,5 @@
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.24
+edk2-basetools==0.1.26
 antlr4-python3-runtime==4.7.1
-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91431): https://edk2.groups.io/g/devel/message/91431
Mute This Topic: https://groups.io/mt/92434394/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] "VfrCompileEnhancement" branch on edk2-staging

2022-07-16 Thread Bob Feng
Hello,

The "VfrCompileEnhancement" branch was created on edk2-staging repository 
https://github.com/tianocore/edk2-staging/tree/VfrCompileEnhancement. This 
branch is based on the edk2 SHA-1: 176016387f and it's for the enhancement 
features on VfrCompile.


Best Regards,
Bob Feng
_._,_._,_


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91430): https://edk2.groups.io/g/devel/message/91430
Mute This Topic: https://groups.io/mt/92433445/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1] Silicon/Intel/FitGen: Fix Type 2 entry version value from BiosInfo would always 0x0

2022-07-13 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Lin, Jason1  
Sent: Wednesday, July 13, 2022 1:56 PM
To: devel@edk2.groups.io
Cc: Lin, Jason1 ; Feng, Bob C ; 
Gao, Liming ; Chen, Christine ; 
Oram, Isaac W ; Chaganty, Rangasai V 
; Chiang, Dakota 
Subject: [PATCH v1] Silicon/Intel/FitGen: Fix Type 2 entry version value from 
BiosInfo would always 0x0

From: Jason1 Lin 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3988

With the change #3958 using the incorrect variable to store the S-ACM entry 
version.
That would cause the value always 0x0.

gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Version
variable should be corrected to
gFitTableContext.StartupAcmVersion[gFitTableContext.StartupAcmNumber].

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Isaac W Oram 
Cc: Rangasai V Chaganty 
Cc: Dakota Chiang 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 577ce48b10..21dfcf1ebb 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -1182,7 +1182,7 @@ Returns:
   gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Type  
  = FIT_TABLE_TYPE_STARTUP_ACM;   
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Address = 
(UINT32)BiosInfoStruct[BiosInfoIndex].Address;   
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size= 
(UINT32)BiosInfoStruct[BiosInfoIndex].Size;-  
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Version = 
BiosInfoStruct[BiosInfoIndex].Version;+  
gFitTableContext.StartupAcmVersion[gFitTableContext.StartupAcmNumber]  = 
BiosInfoStruct[BiosInfoIndex].Version;   
gFitTableContext.StartupAcmNumber ++;   gFitTableContext.FitEntryNumber 
++;   break;-- 
2.37.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91306): https://edk2.groups.io/g/devel/message/91306
Mute This Topic: https://groups.io/mt/92352273/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] BaseTools: Fix DSC LibraryClass precedence rule

2022-07-10 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, June 30, 2022 5:04 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Huang, Long1 ; Ni, Ray 
Subject: [PATCH 1/1] BaseTools: Fix DSC LibraryClass precedence rule

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3965

Currently DSC LibraryClass precedence rule is not align with DSC Spec.

The expectation rule should be:
[LibraryClasses.$(ARCH)] < [LibraryClasses.Common.$(MODULE_TYPE)]

The actual behavior is:
[LibraryClasses.$(ARCH)] > [LibraryClasses.Common.$(MODULE_TYPE)]

This patch fixes the issue.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Long1 Huang 
Cc: Ray Ni 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index a599c5bb7688..7a56b2b2e972 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -872,7 +872,7 @@ class DscBuildData(PlatformBuildClassObject):
 if ModuleType != TAB_COMMON and ModuleType not in 
SUP_MODULE_LIST:
 EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module 
type [%s]" % ModuleType,
 File=self.MetaFile, 
ExtraData=LibraryInstance, Line=LineNo)
-LibraryClassDict[Arch, ModuleType, LibraryClass] = 
LibraryInstance
+LibraryClassDict[ModuleType, Arch, LibraryClass] = 
LibraryInstance
 if LibraryInstance not in self._LibraryInstances:
 self._LibraryInstances.append(LibraryInstance)
 
@@ -881,7 +881,7 @@ class DscBuildData(PlatformBuildClassObject):
 for LibraryClass in LibraryClassSet:
 # try all possible module types
 for ModuleType in SUP_MODULE_LIST:
-LibraryInstance = LibraryClassDict[self._Arch, ModuleType, 
LibraryClass]
+LibraryInstance = LibraryClassDict[ModuleType, self._Arch, 
LibraryClass]
 if LibraryInstance is None:
 continue
 self._LibraryClasses[LibraryClass, ModuleType] = 
LibraryInstance
-- 
2.26.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91210): https://edk2.groups.io/g/devel/message/91210
Mute This Topic: https://groups.io/mt/92082564/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] BaseTools: remove directly calling for gcc command

2022-07-10 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Friday, July 8, 2022 1:45 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [PATCH 1/1] BaseTools: remove directly calling for gcc command

In some environment, the directly calling for gcc is not supported.
Thus replace gcc to $(CC).

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index c217674345b1..f683efc5648a 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,7 +13,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION = $(shell $(CC) -dumpversion | awk -F'.' '{print $$1}')
 ifneq ("$(GCCVERSION)", "5")
 ifneq ($(CXX), llvm)
 # gcc 12 trips over device path handling
-- 
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91209): https://edk2.groups.io/g/devel/message/91209
Mute This Topic: https://groups.io/mt/92246093/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] BaseTools: add '-p' for Linux 'cp' command.

2022-07-09 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Friday, July 8, 2022 9:10 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [PATCH 1/1] BaseTools: add '-p' for Linux 'cp' command.

Currently BaseTools use 'cp' command for PcdValueInit and GenMake process, as 
the command can not keep the time info of the source file, which will cause 
incremental build issue in Linux system, thus the '-p' need be added to keep 
the source file's attributes in copy process.

This patch fixes this issue.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/GenMake.py| 2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index 92c7bf0cdad5..daec9c6d54b2 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -120,7 +120,7 @@ class BuildFile(object):
 },
 
 POSIX_PLATFORM : {
-"CP":   "cp -f",
+"CP":   "cp -p -f",
 "MV":   "mv -f",
 "RM":   "rm -f",
 "MD":   "mkdir -p",
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index a599c5bb7688..e9f68384b429 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2932,7 +2932,7 @@ class DscBuildData(PlatformBuildClassObject):
 MakeApp = MakeApp + PcdMakefileEnd
 MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) 
$(APPFILE) /y """)
 else:
-MakeApp = MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(APPFILE) 
""")
+MakeApp = MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) 
+ $(APPFILE) """)
 MakeApp = MakeApp + '\n'
 IncludeFileFullPaths = []
 for includefile in IncludeFiles:
@@ -2955,7 +2955,7 @@ class DscBuildData(PlatformBuildClassObject):
 else:
 PcdValueCommonPath = 
os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], 
"Source/C/Common/PcdValueCommon.c"))
 MakeApp = MakeApp + '%s/PcdValueCommon.c : %s\n' % 
(self.OutputPath, PcdValueCommonPath)
-MakeApp = MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % 
(PcdValueCommonPath, self.OutputPath)
+MakeApp = MakeApp + '\tcp -p -f %s %s/PcdValueCommon.c\n' % 
+ (PcdValueCommonPath, self.OutputPath)
 MakeFileName = os.path.join(self.OutputPath, 'Makefile')
 MakeApp += "$(OBJECTS) : %s\n" % MakeFileName
 SaveFileOnChange(MakeFileName, MakeApp, False)
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91205): https://edk2.groups.io/g/devel/message/91205
Mute This Topic: https://groups.io/mt/92250878/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for signtool to input subject name to sign capsule file

2022-07-09 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Lin, Jason1  
Sent: Friday, July 8, 2022 7:42 PM
To: devel@edk2.groups.io
Cc: Lin, Jason1 ; Feng, Bob C ; 
Gao, Liming ; Chen, Christine ; 
Kinney, Michael D ; Chiang, Dakota 

Subject: [PATCH v3] BaseTools/Capsule: Add support for signtool to input 
subject name to sign capsule file

From: Jason1 Lin 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3928

Windows-based system using signtool.exe to sign the capsule.
Add the support to using "--subject-name" argument to assign the subject name 
used to sign the capsule file.
This argument would pass to signtool.exe as a part of input argument with "/n" 
flag.

NOTE: If using signtool.exe to sign capsule at least need to
  choose one of "--pfx-file" and "--subject-name"
  argument to input the value.

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Michael D Kinney 
Cc: Dakota Chiang 
---
 BaseTools/Source/Python/Capsule/GenerateCapsule.py | 43 
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py 
b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
index b8039db878..35435946c6 100644
--- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
+++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
@@ -10,7 +10,7 @@
 # keep the tool as simple as possible, it has the following limitations: #   * 
Do not support vendor code bytes in a capsule. #-# Copyright (c) 2018 - 2019, 
Intel Corporation. All rights reserved.+# Copyright (c) 2018 - 2022, Intel 
Corporation. All rights reserved. # SPDX-License-Identifier: 
BSD-2-Clause-Patent # @@ -38,11 +38,11 @@ from 
Common.Edk2.Capsule.FmpPayloadHeader  import FmpPayloadHeaderClass
 # Globals for help information # __prog__= 
'GenerateCapsule'-__version__ = '0.9'-__copyright__   = 'Copyright (c) 
2018, Intel Corporation. All rights reserved.'+__version__ = 
'0.10'+__copyright__   = 'Copyright (c) 2022, Intel Corporation. All rights 
reserved.' __description__ = 'Generate a capsule.\n' -def SignPayloadSignTool 
(Payload, ToolPath, PfxFile, Verbose = False):+def SignPayloadSignTool 
(Payload, ToolPath, PfxFile, SubjectName, Verbose = False): # # Create 
a temporary directory #@@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, 
ToolPath, PfxFile, Verbose = False):
 Command = Command + '"{Path}" '.format (Path = os.path.join (ToolPath, 
'signtool.exe')) Command = Command + 'sign /fd sha256 /p7ce 
DetachedSignedData /p7co 1.2.840.113549.1.7.2 ' Command = Command + '/p7 
{TempDir} '.format (TempDir = TempDirectoryName)-Command = Command + '/f 
{PfxFile} '.format (PfxFile = PfxFile)+if PfxFile is not None:+
Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)+if 
SubjectName is not None:+Command = Command + '/n {SubjectName} '.format 
(SubjectName = SubjectName) Command = Command + TempFileName if 
Verbose: print (Command)@@ -105,7 +108,7 @@ def SignPayloadSignTool 
(Payload, ToolPath, PfxFile, Verbose = False):
 shutil.rmtree (TempDirectoryName) return Signature -def 
VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, Verbose = 
False):+def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, 
SubjectName, Verbose = False): print ('signtool verify is not supported.')  
   raise ValueError ('GenerateCapsule: error: signtool verify is not 
supported.') @@ -249,6 +252,7 @@ if __name__ == '__main__':
 HardwareInstance = ConvertJsonValue (Config, 
'HardwareInstance', ValidateUnsignedInteger, Required = False, Default = 0) 
MonotonicCount   = ConvertJsonValue (Config, 
'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)   
  SignToolPfxFile  = ConvertJsonValue (Config, 
'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = 
True)+SignToolSubjectName  = ConvertJsonValue (Config, 
'SignToolSubjectName', os.path.expandvars, Required = False, Default = None, 
Open = True) OpenSslSignerPrivateCertFile = ConvertJsonValue 
(Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, 
Default = None, Open = True) OpenSslOtherPublicCertFile   = 
ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, 
Required = False, Default = None, Open = True) 
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 
'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)@@ -264,6 +268,7 @@ if __name__ == '__main__':
 HardwareInstance,  
   UpdateImageIndex,
 SignToolPfxFile,+  

Re: [edk2-devel] [PATCH] .gitignore: Ignore build tools build logs

2022-07-09 Thread Bob Feng
Create the PR for merge. https://github.com/tianocore/edk2/pull/3062

Thanks,
Bob 
-Original Message-
From: Jeff Brasen  
Sent: Friday, July 8, 2022 2:14 AM
To: Gao, Liming ; devel@edk2.groups.io; Feng, Bob C 

Cc: Chen, Christine 
Subject: RE: [edk2-devel] [PATCH] .gitignore: Ignore build tools build logs

Just following up on my outstanding edk2 patches to check on status/review 
feedback.

Thanks,
Jeff

> -Original Message-
> From: Jeff Brasen
> Sent: Friday, June 17, 2022 9:38 AM
> To: gaoliming ; devel@edk2.groups.io; 
> bob.c.f...@intel.com
> Cc: 'Chen, Christine' 
> Subject: RE: [edk2-devel] [PATCH] .gitignore: Ignore build tools build 
> logs
> 
> Anything else needed prior to getting this merged to edk2?
> 
> > -Original Message-
> > From: gaoliming 
> > Sent: Thursday, May 19, 2022 7:19 PM
> > To: devel@edk2.groups.io; bob.c.f...@intel.com; Jeff Brasen 
> > 
> > Cc: 'Chen, Christine' 
> > Subject: 回复: [edk2-devel] [PATCH] .gitignore: Ignore build tools 
> > build logs
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Reviewed-by: Liming Gao 
> >
> > > -邮件原件-
> > > 发件人: devel@edk2.groups.io  代表 Bob Feng
> > > 发送时间: 2022年5月18日 15:15
> > > 收件人: devel@edk2.groups.io; Gao, Liming
> > ;
> > > jbra...@nvidia.com
> > > 抄送: Chen, Christine 
> > > 主题: Re: [edk2-devel] [PATCH] .gitignore: Ignore build tools build 
> > > logs
> > >
> > > They are the BaseTools build log files that are generated by 
> > > BaseTools/Edk2ToolsBuild.py.
> > >
> > > Thanks,
> > > Bob
> > >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of 
> > > gaoliming
> > > Sent: Wednesday, May 18, 2022 2:40 PM
> > > To: devel@edk2.groups.io; jbra...@nvidia.com
> > > Cc: Feng, Bob C ; Chen, Christine 
> > > 
> > > Subject: 回复: [edk2-devel] [PATCH] .gitignore: Ignore build tools 
> > > build logs
> > >
> > > Bob:
> > >   Do you know what files will be generated in 
> > > BaseTools/BaseToolsBuild directory?
> > >
> > > Thanks
> > > Liming
> > > > -邮件原件-
> > > > 发件人: devel@edk2.groups.io  代表 Jeff
> > Brasen
> > > via
> > > > groups.io
> > > > 发送时间: 2022年4月22日 1:01
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: bob.c.f...@intel.com; gaolim...@byosoft.com.cn; 
> > > > yuwei.c...@intel.com; Jeff Brasen 
> > > > 主题: [edk2-devel] [PATCH] .gitignore: Ignore build tools build 
> > > > logs
> > > >
> > > > The python BaseTools/Edk2ToolsBuild.py creates files in 
> > > > BaseTools/BaseToolsBuild and should be ignored.
> > > >
> > > > Signed-off-by: Jeff Brasen 
> > > > ---
> > > >  BaseTools/.gitignore | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/BaseTools/.gitignore b/BaseTools/.gitignore index
> > > > a45689bc89..ddf93b7116 100644
> > > > --- a/BaseTools/.gitignore
> > > > +++ b/BaseTools/.gitignore
> > > > @@ -17,4 +17,5 @@ Source/C/VfrCompile/VfrTokens.h  Source/C/bin/ 
> > > > Source/C/libs/
> > > >  Bin/Win32
> > > > -Lib
> > > > \ No newline at end of file
> > > > +Lib
> > > > +BaseToolsBuild/
> > > > \ No newline at end of file
> > > > --
> > > > 2.25.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > >
> >
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91203): https://edk2.groups.io/g/devel/message/91203
Mute This Topic: https://groups.io/mt/91823747/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen: Support multiple Startup ACM Type 2 entries in FitGen tool

2022-07-05 Thread Bob Feng
This patch series was pushed.

Thanks,
Bob

-Original Message-
From: Lin, Jason1  
Sent: Friday, July 1, 2022 11:10 PM
To: devel@edk2.groups.io
Cc: Lin, Jason1 ; Feng, Bob C ; 
Gao, Liming ; Chen, Christine ; 
Oram, Isaac W ; Chaganty, Rangasai V 
; Chiang, Dakota 
Subject: [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen: Support multiple 
Startup ACM Type 2 entries in FitGen tool

From: Jason1 Lin 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3958

Within current FitGen tool there had limitation only allow one S-ACM to 
generate the Type 2 entry.
This code change is used to support multiple type 2 entries up to 0x20.

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Isaac W Oram 
Cc: Rangasai V Chaganty 
Cc: Dakota Chiang 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 89 +++-  
Silicon/Intel/Tools/FitGen/FitGen.h |  4 +-
 2 files changed, 50 insertions(+), 43 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 4de72ea422..eac8fa8715 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -2,7 +2,7 @@
 This utility is part of build process for IA32/X64 FD. It generates FIT table. 
-Copyright (c) 2010-2021, Intel Corporation. All rights reserved.+Copyright 
(c) 2010-2022, Intel Corporation. All rights reserved. 
SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -204,6 +204,7 @@ typedef 
struct {
  #define MAX_BIOS_MODULE_ENTRY  0x20 #define MAX_MICROCODE_ENTRY
0x20+#define MAX_STARTUP_ACM_ENTRY  0x20 #define MAX_OPTIONAL_ENTRY 0x20 
#define MAX_PORT_ENTRY 0x20 @@ -255,11 +256,12 @@ typedef struct {
   UINT32 FitEntryNumber;   UINT32 
BiosModuleNumber;   UINT32 MicrocodeNumber;+  UINT32
 StartupAcmNumber;   UINT32 
OptionalModuleNumber;   UINT32 PortModuleNumber;   UINT32   
  GlobalVersion;   UINT32 
FitHeaderVersion;-  FIT_TABLE_CONTEXT_ENTRYStartupAcm;+  
FIT_TABLE_CONTEXT_ENTRYStartupAcm[MAX_STARTUP_ACM_ENTRY];   UINT32  
   StartupAcmVersion;   FIT_TABLE_CONTEXT_ENTRYDiagnstAcm;   UINT32 
DiagnstAcmVersion;@@ -1149,14 +1151,15 @@ Returns:
   Error (NULL, 0, 0, "-I Parameter incorrect, Header Type 
unsupported!", NULL);   return 0; case 
FIT_TABLE_TYPE_STARTUP_ACM:-  if (gFitTableContext.StartupAcm.Type != 
0) {-Error (NULL, 0, 0, "-I Parameter incorrect, Duplicated 
StartupAcm!", NULL);+  if (gFitTableContext.StartupAcmNumber >= 
MAX_STARTUP_ACM_ENTRY) {+Error (NULL, 0, 0, "-I Parameter 
incorrect, too many StartupAcm!", NULL); return 0;   }- 
 gFitTableContext.StartupAcm.Type= FIT_TABLE_TYPE_STARTUP_ACM;- 
 gFitTableContext.StartupAcm.Address = 
(UINT32)BiosInfoStruct[BiosInfoIndex].Address;-  
gFitTableContext.StartupAcm.Size= 
(UINT32)BiosInfoStruct[BiosInfoIndex].Size;-  
gFitTableContext.StartupAcmVersion  = BiosInfoStruct[BiosInfoIndex].Version;+   
   gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Type= 
FIT_TABLE_TYPE_STARTUP_ACM;+  
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Address = 
(UINT32)BiosInfoStruct[BiosInfoIndex].Address;+  
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size= 
(UINT32)BiosInfoStruct[BiosInfoIndex].Size;+  
gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Version = 
BiosInfoStruct[BiosInfoIndex].Version;+  
gFitTableContext.StartupAcmNumber ++;   gFitTableContext.FitEntryNumber 
++;   break; case FIT_TABLE_TYPE_DIAGNST_ACM:@@ -1351,16 
+1354,15 @@ Returns:
   //   // 1. StartupAcm   //-  do {+  while (TRUE) { if ((Index + 1 >= 
argc) || ((strcmp (argv[Index], "-S") != 0) &&  (strcmp 
(argv[Index], "-s") != 0)) ) {-  if (BiosInfoExist && 
(gFitTableContext.StartupAcm.Type == FIT_TABLE_TYPE_STARTUP_ACM)) {-
break;+  if (gFitTableContext.StartupAcmNumber == 0) {+printf ("-S 
not found. WARNING!\n");   } //  Error (NULL, 0, 0, "-S Parameter 
incorrect, expect -S!", NULL); //  return 0;-  printf ("-S not found. 
WARNING!\n");   break; } if (IsGuidData (argv[Index + 1], )) 
{@@ -1381,14 +1383,13 @@ Returns:
   FileSize = xtoi (argv[Index + 2]);   Index += 3; }-if 
(gFitTableContext.StartupAcm.Type != 0) {-  Error (NULL, 0, 0, "-S 
Parameter incorrect, Duplicated StartupAcm!", NULL);+if 
(gFitTableContext.StartupAcmNumber >= MAX_STARTUP_ACM_ENTRY) {+  Error 
(NULL, 0, 0, "-S Parameter incorrect,

Re: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools version to 0.1.24

2022-06-29 Thread Bob Feng
Created a PR https://github.com/tianocore/edk2/pull/3033

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Thursday, June 30, 2022 12:11 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Kubacki, Michael 

Subject: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools version 
to 0.1.24

Upgrade the edk2-basetools version from 0.1.17 to 0.1.24

features and bug fixes:
1. Add FMMT Python Tool
2. Remove RVCT support
3. Fix dependency issue in PcdValueInit
4. Output the intermediate library instance when error occurs 5. Ecc: Fix 
grammar in Ecc error message 6. Fix the GenMake bug for .cpp source file

Signed-off-by: Bob Feng 
Reviewed-by: Michael D Kinney 
Acked-by: Michael Kubacki  ---update the commit 
message.
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt index 
6585df201d..29424b08bd 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,7 +12,7 @@
 # https://www.python.org/dev/peps/pep-0440/#version-specifiers ##  
edk2-pytool-library==0.11.2 
edk2-pytool-extensions~=0.16.0-edk2-basetools==0.1.17+edk2-basetools==0.1.24 
antlr4-python3-runtime==4.7.1--
2.29.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90926): https://edk2.groups.io/g/devel/message/90926
Mute This Topic: https://groups.io/mt/92080401/1768742
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.f...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90927): https://edk2.groups.io/g/devel/message/90927
Mute This Topic: https://groups.io/mt/92080401/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [Patch V2] pip-requirements.txt: Update basetools version to 0.1.24

2022-06-29 Thread Bob Feng
Upgrade the edk2-basetools version from 0.1.17 to 0.1.24

features and bug fixes:
1. Add FMMT Python Tool
2. Remove RVCT support
3. Fix dependency issue in PcdValueInit
4. Output the intermediate library instance when error occurs
5. Ecc: Fix grammar in Ecc error message
6. Fix the GenMake bug for .cpp source file

Signed-off-by: Bob Feng 
Reviewed-by: Michael D Kinney 
Acked-by: Michael Kubacki 
---
update the commit message.
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 6585df201d..29424b08bd 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,7 +12,7 @@
 # https://www.python.org/dev/peps/pep-0440/#version-specifiers
 ##
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.17
+edk2-basetools==0.1.24
 antlr4-python3-runtime==4.7.1
-- 
2.29.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90926): https://edk2.groups.io/g/devel/message/90926
Mute This Topic: https://groups.io/mt/92080401/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [Patch] pip-requirements.txt: Update basetools version to 0.1.24

2022-06-29 Thread Bob Feng
Synced the basetools patch from edk2 repo to
edk2-basetools repo.

edk2 sha-1: 59141288716f8917968d4bb96367b7d08fe5ab8a

Update the basetools pip module version
to the latest 0.1.24.

Signed-off-by: Bob Feng 
---
 pip-requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 6585df201d..29424b08bd 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,7 +12,7 @@
 # https://www.python.org/dev/peps/pep-0440/#version-specifiers
 ##
 
 edk2-pytool-library==0.11.2
 edk2-pytool-extensions~=0.16.0
-edk2-basetools==0.1.17
+edk2-basetools==0.1.24
 antlr4-python3-runtime==4.7.1
-- 
2.29.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90833): https://edk2.groups.io/g/devel/message/90833
Mute This Topic: https://groups.io/mt/92060732/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Fix grammar in Ecc error message

2022-06-26 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Friday, June 24, 2022 9:25 AM
To: devel@edk2.groups.io; quic_rc...@quicinc.com; Feng, Bob C 
; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Fix grammar in Ecc error 
message

Reviewed-by: Yuwei Chen

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca 
> Cran
> Sent: Monday, June 20, 2022 6:07 AM
> To: devel@edk2.groups.io; Feng, Bob C ; Gao, 
> Liming ; Chen, Christine 
> 
> Cc: Rebecca Cran 
> Subject: [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Fix grammar in Ecc 
> error message
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/Source/Python/Ecc/c.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Ecc/c.py
> b/BaseTools/Source/Python/Ecc/c.py
> index 4a82e5e76003..61ad084fcc5b 100644
> --- a/BaseTools/Source/Python/Ecc/c.py
> +++ b/BaseTools/Source/Python/Ecc/c.py
> @@ -2612,8 +2612,8 @@ def
> CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier,
> FuncHeader, Fu
> 
> 
>  if Tag.find(ParamName) == -1 and ParamName != 'VOID' and 
> ParamName != 'void':
> -ErrorMsgList.append('Line %d : in Comment, <%s> does NOT
> consistent with parameter name %s ' % (CommentStartLine, 
> (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), 
> ParamName))
> -PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in
> Comment, <%s> does NOT consistent with parameter name %s ' % 
> ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', 
> '').replace('\r', ''), ParamName), TableName, CommentId)
> +ErrorMsgList.append('Line %d : in Comment, <%s> is 
> + NOT
> consistent with parameter name %s ' % (CommentStartLine, 
> (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', 
> '').replace('\r', ''), ParamName))
> +PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 
> + 'in
> Comment, <%s> is NOT consistent with parameter name %s ' % 
> ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', 
> '').replace('\r', ''), ParamName), TableName, CommentId)
>  Index += 1
> 
>  if Index < ParamNumber:
> --
> 2.35.3
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90761): https://edk2.groups.io/g/devel/message/90761
Mute This Topic: https://groups.io/mt/91866114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [Patch] BaseTools: Fix the GenMake bug for .cpp source file

2022-06-24 Thread Bob Feng
From: "Feng, Bob C" 

Build-rules.txt lists .cc and .cpp as supported file extensions.
BaseTools commit 05217d210e introduce a regression issue that
ignore the .cc and .cpp file type.

This patch is to fix this bug.

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/GenMake.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index da406e6ff4..92c7bf0cda 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -1108,11 +1108,12 @@ cleanlib:
 else:
 # CmdTargetDict[CmdSign] = "%s %s" % 
(CmdTargetDict[CmdSign], SingleCommandList[-1])
 CmdTargetDict[CmdSign].append(SingleCommandList[-1])
 Index = CommandList.index(Item)
 CommandList.pop(Index)
-if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, 
CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
+BaseName = SingleCommandList[-1].rsplit('.',1)[0]
+if BaseName.endswith("%s%s" % (TAB_SLASH, 
CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
 Cpplist = CmdCppDict[T.Target.SubDir]
 Cpplist.insert(0, '$(OBJLIST_%d): ' % 
list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
 source_files = CmdTargetDict[CmdSign][1:]
 source_files.insert(0, " ")
 if len(source_files)>2:
-- 
2.29.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90751): https://edk2.groups.io/g/devel/message/90751
Mute This Topic: https://groups.io/mt/91979266/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools: output the intermediate library instance when error occurs

2022-06-15 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Ni, Ray  
Sent: Wednesday, June 15, 2022 12:55 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine 
Subject: [PATCH] BaseTools: output the intermediate library instance when error 
occurs

When a module "Module" depends on a library instance "Lib1" which depends on 
"Lib2" which depends on "Lib3" ... depends on "LibN", but "LibN" doesn't 
support the type (e.g.: SEC) of the "Module", the following error messages are 
printed by build tool:

(...): error 1001: Module by library instance []
consumed by []

But it's unclear to user how LibN is consumed by the Module.


With the patch, following errors are printed:

(...): error 1001: Module by library instance []
consumed by library instance [] which is
consumed by module[]

It doesn't print all the intermediate library instances between the Module and 
LibN but at least the path of Lib N-1 can help users to help how to fix the 
build errors.

I hope this patch can be a trigger point that a better solution could be 
developed by tool experts to print all the library instances between the Module 
and LibN.

Signed-off-by: Ray Ni 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py 
b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index 53027a0e30..9e506fc646 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -150,7 +150,9 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, 
Arch, Target, Toolcha
 EdkLogger.error("build", OPTION_MISSING,
 "Module type [%s] is not supported by 
library instance [%s]" \
 % (ModuleType, LibraryPath), 
File=FileName,
-ExtraData="consumed by [%s]" % 
str(Module))
+ExtraData="consumed by library 
instance [%s] which is consumed by module [%s]" \
+% (str(M), str(Module))
+)
 else:
 return []
 
--
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90536): https://edk2.groups.io/g/devel/message/90536
Mute This Topic: https://groups.io/mt/91770914/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 1/1] [edk2-platforms]Tools\FitGen: Add extra parameter fixed FIT address

2022-06-13 Thread Bob Feng
This patch looks good to me.

Reviewed-by: Bob Feng 

-Original Message-
From: Jiang, Wenyi  
Sent: Friday, June 10, 2022 9:15 AM
To: devel@edk2.groups.io
Cc: Chen, Christine ; Feng, Bob C 
Subject: [PATCH v3 1/1] [edk2-platforms]Tools\FitGen: Add extra parameter fixed 
FIT address

From: fanwang2intel 

Add "-T " parameter to provide fixed FIT address on flash 
region. When this parameter is set to a valid address in the input FD/FV file, 
tool will directly generate FIT on this address.

It's users' responsibilities to reserve enough size for FIT table and option 
modules on the target location, otherwise, FIT Gen process will fail.

Cc: Chen Christine 
Cc: Bob Feng 

Signed-off-by: fanwang2intel 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 163 ++--
 1 file changed, 120 insertions(+), 43 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 290e688f6e4e..4de72ea4225e 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -345,6 +345,7 @@ Returns:
   "\t[-M ] [-M ...]|[-U ||] [-V 
]\n"   "\t[-O RecordType  [-V ]] [-O ... [-V ...]]\n"   "\t[-P 
RecordType  [-V ]] [-P ... 
[-V ...]]\n"+  "\t[-T ]\n"   , UTILITY_NAME); 
  printf ("  Where:\n");   printf ("\t-D - It is FD file 
instead of FV file. (The tool will search FV file)\n");@@ -388,6 +389,7 @@ 
Returns:
   printf ("\tWidth  - The Width of the port.\n");   printf 
("\tBit- The Bit Number of the port.\n");   printf 
("\tIndex  - The Index Number of the port.\n");+  printf 
("\tFixedFitLocation   - Fixed FIT location in flash address. FIT table 
will be generated at this location and Option Modules will be directly put 
right before it.\n");   printf ("\nUsage (view): %s [-view] InputFile -F 
\n", UTILITY_NAME);   printf ("  Where:\n");   printf 
("\tInputFile  - Name of the input file.\n");@@ -445,6 +447,46 @@ 
CheckPath (
   return TRUE; } +UINT32+GetFixedFitLocation (+  IN INTN   argc,+  IN CHAR8  
**argv+  )+/*Routine Description:++  Get fixed FIT location from 
argument++Arguments:++  argc   - Number of command line parameters.+  
argv   - Array of pointers to parameter strings.++Returns:++  
FitLocation - The FIT location specified by Argument+  0   - Argument 
parse fail++*/+{+  UINT32  FitLocation;+  INTN  
  Index;++  FitLocation = 0;++  for (Index = 0; Index + 1 < argc; Index 
++) {++if ((strcmp (argv[Index], "-T") == 0) ||+(strcmp 
(argv[Index], "-t") == 0) ) {+  FitLocation =  xtoi (argv[Index + 1]);+ 
 break;+}+  }++  return FitLocation;+}+ STATUS ReadInputFile (   IN CHAR8   
 *FileName,@@ -1909,10 +1951,11 @@ Returns:
 }  VOID *-GetFreeSpaceFromFv (+GetFreeSpaceForFit (   IN UINT8 *FvBuffer,  
 IN UINT32FvSize,-  IN UINT32FitEntryNumber+  IN UINT32
FitTableSize,+  IN UINT32FixedFitLocation   ) /*++ @@ -1922,9 +1965,10 @@ 
Routine Description:
  Arguments: -  FvBuffer   - FvRecovery binary buffer-  FvSize - 
FvRecovery size-  FitEntryNumber - The FIT entry number+  FvBuffer - 
FvRecovery binary buffer+  FvSize   - FvRecovery size+  FitTableSize
 - The FIT table size+  FixedFitLocation - Fixed FIT location provided by 
argument  Returns: @@ -1939,7 +1983,6 @@ Returns:
   UINT8   *OptionalModuleAddress;   EFI_GUIDVTFGuid = 
EFI_FFS_VOLUME_TOP_FILE_GUID;   UINT32  AlignedSize;-  UINT32  
FitTableSize;EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;   EFI_FFS_FILE_HEADER   
  *FileHeader;@@ -1966,45 +2009,62 @@ Returns:
 }   } -  //-  // Get EFI_FFS_VOLUME_TOP_FILE_GUID location-  //-  
FitTableOffset = NULL;+  if (FixedFitLocation != 0) {+//+// Get Free 
space from fixed location+//+FitTableOffset = (UINT8 *) FLASH_TO_MEMORY 
(FixedFitLocation, FvBuffer, FvSize);+  } else {+//+// Get Free Space 
from FvRecovery+//+FitTableOffset = NULL; -  FvHeader = 
(EFI_FIRMWARE_VOLUME_HEADER *)FvBuffer;-  FvLength = 
FvHeader->FvLength;-  FileHeader   = (EFI_FFS_FILE_HEADER *)(FvBuffer + 
FvHeader->HeaderLength);-  Offset   = (UINTN)FileHeader - 
(UINTN)FvBuffer;+FvHeader = (EFI_FIRMWARE_VOLUME_HEADER 
*)FvBuffer;+FvLength = FvHeader->FvLength;+FileHeader   = 
(EFI_FFS_FILE_HEADER *)(FvBuffer + FvHeader->HeaderLength);+Offset  
 = (UINTN)FileHeader - (UINTN)FvBuffer; -  while (Offset < FvLength) {-
FileLength = (*(UINT32 *)(FileHeader->Size)) & 0x00FF;-FileOccupiedSize 
= GETOCCUPIEDSIZE(FileLength, 8);-if ((CompareGuid (&(FileHeade

Re: [edk2-devel] [PATCH v1] [edk2-platforms] Silicon/Intel/FitGen: Fix CheckOverlap would do incorrect split BiosModule action in corner case

2022-06-03 Thread Bob Feng
Hi Jason,

Do you think the code could be more understandable if adding a check for the 
size? 

if ((gFitTableContext.BiosModule[Index].Address <= Address) && 
(gFitTableContext.BiosModule[Index].Size >= Size) &&
((gFitTableContext.BiosModule[Index].Size - Size) >= (Address - 
gFitTableContext.BiosModule[Index].Address)))


Thanks,
Bob

-Original Message-
From: Lin, Jason1  
Sent: Thursday, May 26, 2022 4:52 PM
To: devel@edk2.groups.io
Cc: Lin, Jason1 ; Feng, Bob C ; 
Gao, Liming ; Chen, Christine ; 
Chiang, Dakota ; Chuang, Vanessa 

Subject: [PATCH v1] [edk2-platforms] Silicon/Intel/FitGen: Fix CheckOverlap 
would do incorrect split BiosModule action in corner case

From: Jason1 Lin 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3922

[Description]
CheckOverlap function would do incorrect split on the BiosModule which not 
happen overlap. This would cause incorrect value locate in FIT entry record.

[Condition]
- This BiosModule base address is lower than input address.
- This BiosModule size is smaller than input size.

[Resolution]
- Do the type coversion to UINT64 to prevent overflow when the value shuld be 
nagative.
- Do the type coversion from UINT64 to INT64 to do the comparsion with possible 
nagative value.

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Dakota Chiang 
Cc: Vanessa Chuang 
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 30 +++-  
Silicon/Intel/Tools/FitGen/FitGen.h |  2 +-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c
index 290e688f6e..9d7185dc55 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -755,12 +755,40 @@ CheckOverlap (
   IN UINT32 Address,   IN UINT32 Size   )+/*+++Routine Description:++  Check 
wheather the input address and size is overlap with any BiosModule.+  If happen 
overlap, need to be deal with this case.+  ---  +--+ 
<-- BiosModule A Base   +--++   |   |   
   | |  |+   |  
| |  BiosModule  |+   | 
 | |  A   |+
   |  | |  |+  
BiosModule A +--+ <-- [Input] Address >   
+--++  Size |  ||+   |  
||[Input] Size+   +--+  --  
   +--++   |  | 
|  BiosModule  |+   |   |  |
 |  B   |+  ---  +--+   
  +--+++Arguments:++  Address - The 
address of the buffer that required to check.+  Size- The size of the 
buffer that required to check.++Returns:++  None++--*/ {   INTN  Index;for 
(Index = 0; Index < (INTN)gFitTableContext.BiosModuleNumber; Index ++) { if 
((gFitTableContext.BiosModule[Index].Address <= Address) &&-
((gFitTableContext.BiosModule[Index].Size - Size) >= (Address - 
gFitTableContext.BiosModule[Index].Address))) {+
((INT64)((UINT64)gFitTableContext.BiosModule[Index].Size - (UINT64)Size) >= 
(INT64)((UINT64)Address - (UINT64)gFitTableContext.BiosModule[Index].Address))) 
{   UINT32  TempSize;   INT32   SubIndex; diff --git 
a/Silicon/Intel/Tools/FitGen/FitGen.h b/Silicon/Intel/Tools/FitGen/FitGen.h
index 5add6a8870..4943ee259c 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.h
+++ b/Silicon/Intel/Tools/FitGen/FitGen.h
@@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 // Utility version information // #define UTILITY_MAJOR_VERSION 0-#define 
UTILITY_MINOR_VERSION 64+#define UTILITY_MINOR_VERSION 65 #define UTILITY_DATE  
__DATE__  //-- 
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90205): https://edk2.groups.io/g/devel/message/90205
Mute This Topic: https://groups.io/mt/91354490/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




  1   2   3   4   5   6   7   8   >