[edk2-platforms][PATCH 1/4] sync with edk2 where StandaloneMmCpu moved to AArch64/ parent directory
Etienne Carriere
Synchronize with edk2 package where StandaloneMmCpu component has moved
from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Ilias Apalodimas <ilias.apalodimas@...> Cc: Leif Lindholm <leif@...> Cc: Sami Mujawar <sami.mujawar@...> Cc: Sughosh Ganu <sughosh.ganu@...> Cc: Thomas Abraham <thomas.abraham@...> Signed-off-by: Etienne Carriere <etienne.carriere@...> --- Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 2 +- Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf | 2 +- Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc | 2 +- Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf | 2 +- Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc | 2 +- Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc index e281d54909..1e0af23711 100644 --- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc +++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc @@ -122,7 +122,7 @@ StandaloneMmPkg/Core/StandaloneMmCore.inf [Components.AARCH64] - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################################### # diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf index 5a0772cd85..96b4272dd6 100644 --- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf +++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf @@ -49,7 +49,7 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE INF StandaloneMmPkg/Core/StandaloneMmCore.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################ # diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc index e078de4bbb..b5524f87a6 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc +++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc @@ -80,7 +80,7 @@ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x2 } - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf { diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf index 33de03c8e7..89453477c9 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf +++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf @@ -111,7 +111,7 @@ READ_LOCK_STATUS = TRUE INF Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################ # diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc index f99a47ebf6..cb3f1ddf52 100644 --- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc +++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc @@ -133,7 +133,7 @@ # Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf StandaloneMmPkg/Core/StandaloneMmCore.inf - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf { <LibraryClasses> NULL|Drivers/OpTee/OpteeRpmbPkg/FixupPcd.inf diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf index e175dc7b2d..c4295a3e63 100644 --- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf +++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf @@ -68,7 +68,8 @@ READ_LOCK_STATUS = TRUE INF Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf + ################################################################################ # # Rules are use with the [FV] section's module INF type to define -- 2.17.1
|
|
[edk2-platforms][PATCH 0/4] Arm 32bit support in StandaloneMmRpmb
Etienne Carriere
This series brings support for building PlatformStandaloneMmRpmb for
32bit Arm architectures. This series is based on series [1] in edk2 that allows to build StandaloneMm package for 32bit Arm. This series starts by syncing with paths changes from [1] series, then comes changes for Arm 32bit support in OpTee drivers and last updates PlatformStandaloneMmRpmb.dsc for 32bit the ARM architure. [1] https://edk2.groups.io/g/devel/message/74734 Etienne Carriere (4): sync with edk2 where StandaloneMmCpu moved to AArch64/ parent directory Drivers/OpTee: Add Aarch32 SVC IDs for 32bit Arm targets Drivers/OpTee: address cast build warning issue in 32b mode Platform/StandaloneMm: build StandaloneMmRpmb for 32bit architectures Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 23 ++++++++++++------- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 16 +++++++++++-- Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 2 +- Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf | 2 +- .../Socionext/DeveloperBox/DeveloperBoxMm.dsc | 2 +- .../Socionext/DeveloperBox/DeveloperBoxMm.fdf | 2 +- .../PlatformStandaloneMmRpmb.dsc | 14 +++++++++-- .../PlatformStandaloneMmRpmb.fdf | 3 ++- 8 files changed, 47 insertions(+), 17 deletions(-) -- 2.17.1
|
|
Re: [Patch 1/1] BaseTools: Fix DSC override of Guided tool
Bob Feng
This patch is good to me.
toggle quoted messageShow quoted text
Reviewed-by: Bob Feng <bob.c.feng@...>
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@...> Sent: Sunday, May 9, 2021 3:43 AM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Liming Gao <gaoliming@...>; Chen, Christine <yuwei.chen@...> Subject: [Patch 1/1] BaseTools: Fix DSC override of Guided tool REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 If the DSC file provides an override of a Guided tool path and/or Guided tool GUID value, then make sure the one from the DSC file is used if it is higher priority than the Guided tool in the tools_def.txt file. This makes the Guided tool used by GenFds match the tool listed GuidedSectionTools.txt. Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> Cc: Yuwei Chen <yuwei.chen@...> Signed-off-by: Michael D Kinney <michael.d.kinney@...> --- .../Source/Python/AutoGen/PlatformAutoGen.py | 7 +- .../Python/GenFds/GenFdsGlobalVariable.py | 228 ++++++++++++------ BaseTools/Source/Python/build/build.py | 52 ++-- 3 files changed, 190 insertions(+), 97 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index 832c0da86bb7..592d4824a4b3 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -918,14 +918,13 @@ class PlatformAutoGen(AutoGen): if Tool in self._BuildOptionWithToolDef(RetVal) and Attr in self._BuildOptionWithToolDef(RetVal)[Tool]: # check if override is indicated if self._BuildOptionWithToolDef(RetVal)[Tool][Attr].startswith('='): - Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:] + Value = + self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:].strip() else: - if Attr != 'PATH': + # Do not append PATH or GUID + if Attr != 'PATH' and Attr != 'GUID': Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr] else: Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr] - Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr]) - self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value if Attr == "PATH": # Don't put MAKE definition in the file if Tool != "MAKE": diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index c31fc24870d5..25f9d54874d3 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -32,6 +32,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open from Common.MultipleWorkspace import MultipleWorkspace as mws import Common.GlobalData as GlobalData from Common.BuildToolError import * +from AutoGen.AutoGen import CalculatePriorityValue ## Global variables # @@ -850,6 +851,10 @@ class GenFdsGlobalVariable: # @param NameGuid The Guid name # def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): + if GenFdsGlobalVariable.GuidToolDefinition: + if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: + return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] + ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) ToolDef = ToolDefObj.ToolDef ToolDb = ToolDef.ToolsDefTxtDatabase @@ -864,86 +869,159 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): if Target + '_' + ToolChain + '_' + Arch not in KeyStringList: KeyStringList.append(Target + '_' + ToolChain + '_' + Arch) - if GenFdsGlobalVariable.GuidToolDefinition: - if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: - return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] - - ToolDefinition = ToolDef.ToolsDefTxtDictionary ToolPathTmp = None ToolOption = None - ToolPathKey = None - ToolOptionKey = None - KeyList = None - for tool_def in ToolDefinition.items(): - KeyList = tool_def[0].split('_') - if len(KeyList) < 5: - continue - if KeyList[4] != DataType.TAB_GUID: - continue - if NameGuid.lower() != tool_def[1].lower(): - continue - Key = KeyList[0] + \ - '_' + \ - KeyList[1] + \ - '_' + \ - KeyList[2] + for Arch in CurrentArchList: + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None for KeyString in KeyStringList: KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') - if KeyList[0] == DataType.TAB_STAR: - KeyList[0] = KeyStringBuildTarget - if KeyList[1] == DataType.TAB_STAR: - KeyList[1] = KeyStringToolChain - if KeyList[2] == DataType.TAB_STAR: - KeyList[2] = KeyStringArch - if KeyList[0] == KeyStringBuildTarget and KeyList[1] == KeyStringToolChain and KeyList[2] == KeyStringArch: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - ToolPath = ToolDefinition.get(ToolPathKey) - ToolOption = ToolDefinition.get(ToolOptionKey) - if ToolPathTmp is None: - ToolPathTmp = ToolPath - else: - if ToolPathTmp != ToolPath: - EdkLogger.error("GenFds", GENFDS_ERROR, "Don't know which tool to use, %s or %s ?" % (ToolPathTmp, ToolPath)) + if KeyStringArch != Arch: + continue + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute + continue + if ToolDef.ToolsDefTxtDictionary[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem.split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem) > CalculatePriorityValue(Item): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem.split('_')[3] + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem) <= CalculatePriorityValue(Item): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem) <= CalculatePriorityValue(Item): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = ToolDef.ToolsDefTxtDictionary[MatchPathItem] + if MatchOptionsItem: + ToolOption = + ToolDef.ToolsDefTxtDictionary[MatchOptionsItem] - BuildOption = {} for Arch in CurrentArchList: - Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] - # key is (ToolChainFamily, ToolChain, CodeBase) - for item in Platform.BuildOptions: - if '_PATH' in item[1] or '_FLAGS' in item[1] or '_GUID' in item[1]: - if not item[0] or (item[0] and GenFdsGlobalVariable.ToolChainFamily== item[0]): - if item[1] not in BuildOption: - BuildOption[item[1]] = Platform.BuildOptions[item] - if BuildOption: - ToolList = [DataType.TAB_TOD_DEFINES_TARGET, DataType.TAB_TOD_DEFINES_TOOL_CHAIN_TAG, DataType.TAB_TOD_DEFINES_TARGET_ARCH] - for Index in range(2, -1, -1): - for Key in list(BuildOption.keys()): - List = Key.split('_') - if List[Index] == DataType.TAB_STAR: - for String in ToolDb[ToolList[Index]]: - if String in [Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]: - List[Index] = String - NewKey = '%s_%s_%s_%s_%s' % tuple(List) - if NewKey not in BuildOption: - BuildOption[NewKey] = BuildOption[Key] - continue - del BuildOption[Key] - elif List[Index] not in ToolDb[ToolList[Index]]: - del BuildOption[Key] - if BuildOption: - if not KeyList: - for Op in BuildOption: - if NameGuid == BuildOption[Op]: - KeyList = Op.split('_') - Key = KeyList[0] + '_' + KeyList[1] +'_' + KeyList[2] - if Key in KeyStringList and KeyList[4] == DataType.TAB_GUID: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - if ToolPathKey in BuildOption: - ToolPathTmp = BuildOption[ToolPathKey] - if ToolOptionKey in BuildOption: - ToolOption = BuildOption[ToolOptionKey] - + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None + for KeyString in KeyStringList: + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') + if KeyStringArch != Arch: + continue + Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, KeyStringBuildTarget, KeyStringToolChain] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute match + continue + if Platform.BuildOptions[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem[1].split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem[1]) > CalculatePriorityValue(Item[1]): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem[1].split('_')[3] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem[1]) <= CalculatePriorityValue(Item[1]): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem[1]) <= CalculatePriorityValue(Item[1]): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = Platform.BuildOptions[MatchPathItem] + if MatchOptionsItem: + ToolOption = Platform.BuildOptions[MatchOptionsItem] GenFdsGlobalVariable.GuidToolDefinition[NameGuid] = (ToolPathTmp, ToolOption) return ToolPathTmp, ToolOption diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e5693c0d27a2..037493f0b02a 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo from GenFds.FdfParser import FdfParser from AutoGen.IncludesAutoGen import IncludesAutoGen from GenFds.GenFds import resetFdsGlobalVariable +from AutoGen.AutoGen import CalculatePriorityValue ## standard targets of build command gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] @@ -2425,27 +2426,42 @@ class Build(): FvDir = Wa.FvDir if not os.path.exists(FvDir): continue - for Arch in self.ArchList: - # Look through the tool definitions for GUIDed tools + guidList = [] + tooldefguidList = [] guidAttribs = [] - for (attrib, value) in self.ToolDef.ToolsDefTxtDictionary.items(): - GuidBuildTarget, GuidToolChain, GuidArch, GuidTool, GuidAttr = attrib.split('_') - if GuidAttr.upper() == 'GUID': - if GuidBuildTarget == TAB_STAR: - GuidBuildTarget = BuildTarget - if GuidToolChain == TAB_STAR: - GuidToolChain = ToolChain - if GuidArch == TAB_STAR: - GuidArch = Arch - if GuidBuildTarget == BuildTarget and GuidToolChain == ToolChain and GuidArch == Arch: - path = '_'.join(attrib.split('_')[:-1]) + '_PATH' - if path in self.ToolDef.ToolsDefTxtDictionary: - path = self.ToolDef.ToolsDefTxtDictionary[path] - path = self.GetRealPathOfTool(path) - guidAttribs.append((value.lower(), GuidTool, path)) + for Platform in Wa.AutoGenObjectList: + if Platform.BuildTarget != BuildTarget: + continue + if Platform.ToolChain != ToolChain: + continue + if Platform.Arch != Arch: + continue + if hasattr (Platform, 'BuildOption'): + for Tool in Platform.BuildOption: + if 'GUID' in Platform.BuildOption[Tool]: + if 'PATH' in Platform.BuildOption[Tool]: + value = Platform.BuildOption[Tool]['GUID'] + if value in guidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in DSC [BuildOptions]." % (value, Tool)) + path = Platform.BuildOption[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, path)) + for Tool in Platform.ToolDefinition: + if 'GUID' in Platform.ToolDefinition[Tool]: + if 'PATH' in Platform.ToolDefinition[Tool]: + value = Platform.ToolDefinition[Tool]['GUID'] + if value in tooldefguidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in tools_def.txt." % (value, Tool)) + tooldefguidList.append(value) + if value in guidList: + # Already added by platform + continue + path = Platform.ToolDefinition[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, + path)) # Sort by GuidTool name - sorted (guidAttribs, key=lambda x: x[1]) + guidAttribs = sorted (guidAttribs, key=lambda x: + x[1]) # Write out GuidedSecTools.txt toolsFile = os.path.join(FvDir, 'GuidedSectionTools.txt') toolsFile = open(toolsFile, 'wt') -- 2.31.1.windows.1
|
|
[PATCH] EmulatorPkg: Update lldbefi.py to work with current lldb which uses python3
Rebecca Cran
The version of lldb shipping with macOS Big Sur is lldb-1205.0.27.3, and
it uses python3. Update lldbefi.py to work with it, including removing the unused 'commands' import and fixing the print statements. Signed-off-by: Rebecca Cran <rebecca@...> --- EmulatorPkg/Unix/lldbefi.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py index c3fb2675cb..952f8bf982 100755 --- a/EmulatorPkg/Unix/lldbefi.py +++ b/EmulatorPkg/Unix/lldbefi.py @@ -10,7 +10,6 @@ import lldb import os=0D import uuid=0D import string=0D -import commands=0D import optparse=0D import shlex=0D =0D @@ -389,7 +388,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): =0D FileName =3D frame.thread.process.ReadCStringFromMemory (FileNamePtr, = FileNameLen, Error)=0D if not Error.Success():=0D - print "!ReadCStringFromMemory() did not find a %d byte C string at= %x" % (FileNameLen, FileNamePtr)=0D + print("!ReadCStringFromMemory() did not find a %d byte C string at= %x" % (FileNameLen, FileNamePtr))=0D # make breakpoint command continue=0D return False=0D =0D @@ -398,7 +397,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUnsig= ned() - 0x240=0D =0D debugger.HandleCommand ("target modules add %s" % FileName)=0D - print "target modules load --slid 0x%x %s" % (LoadAddress, FileNam= e)=0D + print("target modules load --slid 0x%x %s" % (LoadAddress, FileNam= e))=0D debugger.HandleCommand ("target modules load --slide 0x%x --file %= s" % (LoadAddress, FileName))=0D else:=0D target =3D debugger.GetSelectedTarget()=0D @@ -408,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): if FileName =3D=3D ModuleName or FileName =3D=3D SBModule.GetF= ileSpec().GetFilename():=0D target.ClearModuleLoadAddress (SBModule)=0D if not target.RemoveModule (SBModule):=0D - print "!lldb.target.RemoveModule (%s) FAILED" % SBModu= le=0D + print("!lldb.target.RemoveModule (%s) FAILED" % SBModu= le)=0D =0D # make breakpoint command continue=0D return False=0D @@ -490,15 +489,15 @@ def efi_guid_command(debugger, command, result, dict): =0D if len(args) >=3D 1:=0D if GuidStr in guid_dict:=0D - print "%s =3D %s" % (guid_dict[GuidStr], GuidStr)=0D - print "%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (Gui= dStr))=0D + print("%s =3D %s" % (guid_dict[GuidStr], GuidStr))=0D + print("%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (Gui= dStr)))=0D else:=0D - print GuidStr=0D + print(GuidStr)=0D else:=0D # dump entire dictionary=0D width =3D max(len(v) for k,v in guid_dict.iteritems())=0D for value in sorted(guid_dict, key=3Dguid_dict.get):=0D - print '%-*s %s %s' % (width, guid_dict[value], value, GuidToCS= tructStr(value))=0D + print('%-*s %s %s' % (width, guid_dict[value], value, GuidToCS= tructStr(value)))=0D =0D return=0D =0D @@ -538,4 +537,4 @@ def __lldb_init_module (debugger, internal_dict): if Breakpoint.GetNumLocations() =3D=3D 1:=0D # Set the emulator breakpoints, if we are in the emulator=0D debugger.HandleCommand("breakpoint command add -s python -F ll= dbefi.LoadEmulatorEfiSymbols {id}".format(id=3DBreakpoint.GetID()))=0D - print 'Type r to run emulator. SecLldbScriptBreak armed. EFI m= odules should now get source level debugging in the emulator.'=0D + print('Type r to run emulator. SecLldbScriptBreak armed. EFI m= odules should now get source level debugging in the emulator.')=0D --=20 2.30.1 (Apple Git-130)
|
|
[tianocore.github.io.wiki PATCH 1/1] Xcode.md: Update instructions to work on modern macOS and Xcode versions
Rebecca Cran
The existing instructions no longer work on macOS Big Sur and Xcode 12.5.
Update them to include for example using lldb instead of gdb, installing XQuartz, and using modern names such as macOS instead of Mac OS X. Signed-off-by: Rebecca Cran <rebecca@...> --- Xcode.md | 142 +++++++++++--------- 1 file changed, 78 insertions(+), 64 deletions(-) diff --git a/Xcode.md b/Xcode.md index 3d220a5..c494d9d 100644 --- a/Xcode.md +++ b/Xcode.md @@ -1,12 +1,12 @@ -This page provides step-by-step instructions for setting up a [http://www.= tianocore.org/edk2/ EDK II] build environment on Mac OS X systems using the= Xcode development tools. These steps have been verified with macOS Sierra= Version 10.12.4 +This page provides step-by-step instructions for setting up a [EDK II](htt= ps://github.com/tianocore/tianocore.github.io/wiki/EDK-II) build environmen= t on macOS systems using the Xcode development tools. These steps have bee= n verified with macOS Big Sur 11.3.1 =20 -# Mac OS X Xcode -Download the latest version of [Xcode](https://developer.apple.com/xcode) = (9.4.1 as of this writing) from the Mac App Store. After installing Xcode,= you will additionally need to install the extra command-line tools. To do= this, at a Terminal prompt, enter: +# macOS Xcode +Download the latest version of [Xcode](https://developer.apple.com/xcode) = (12.5 as of 2021-05-09) from the Mac App Store. After installing Xcode, yo= u will additionally need to install the extra command-line tools. To do th= is, at a Terminal prompt, enter: ``` $ xcode-select --install ``` ## Additional Development Tools -While Xcode provides a full development environment as well as a suite of = different utilities, it does not provide all tools required for Tianocore d= evelopment. These tools can be provided in a number of ways, but the two m= ost popular ways come from [Brew](https://brew.sh) and [MacPorts](https://w= ww.macports.org/install.php). Installation information is provided at the = previous links. +While Xcode provides a full development environment as well as a suite of = different utilities, it does not provide all tools required for TianoCore d= evelopment. These tools can be provided in a number of ways, but the two m= ost popular ways come from [Brew](https://brew.sh) and [MacPorts](https://w= ww.macports.org/install.php). Installation information is provided at the = previous links. =20 ### MacPorts Tips * If you work behind a firewall and need to pass your network traffic thro= ugh a proxy, ensure you set the environment variable RSYNC_PROXY to your ht= tp proxy in the form of `proxy.dns.name:port_number`. @@ -18,7 +18,7 @@ The mtoc utility is required to convert from the macOS Ma= ch-O image format to th =20 ### Brew Instructions ``` -$ brew install mtoc=0D +$ brew install mtoc ``` ## MacPorts Instructions ``` @@ -27,7 +27,7 @@ $ sudo port install cctools By default, this will install `mtoc` at `/opt/local/bin/mtoc`. # Install NASM =20 -The assembler used for EDK II builds is Netwide Assembler (NASM). The late= st version of NASM is available from http://www.nasm.us/. +The assembler used for EDK II builds is Netwide Assembler (NASM). The late= st version of NASM is available from https://nasm.us/. ## Brew Instructions ``` $ brew install nasm @@ -53,9 +53,13 @@ $ sudo port install acpica ``` By default this installs `iasl` at `/opt/local/bin/iasl` =20 +# Install XQuartz + +The EmulatorPkg requires headers from X11, which are provided by the XQuar= tz project. Install it from https://www.xquartz.org/. + # Install QEMU Emulator =20 -On order to support running the OVMF platforms from the OvmfPkg, the QEMU = emulator from http://www.qemu.org/ must be installed. +On order to support running the OVMF platforms from the OvmfPkg, the QEMU = emulator from https://www.qemu.org/ must be installed. =20 ## Brew Install ``` @@ -97,84 +101,94 @@ Pick the location you want to down load the files to a= nd `cd` to that directory: ``` cd ~/work git clone https://github.com/tianocore/edk2.git +cd edk2 +git submodule update --init ``` =20 -# Build from Command Line/Debug with gdb +# Build from Command Line/Debug with lldb =20 -Build the UnixPkg: +Build the EmulatorPkg: =20 ``` -cd ~/work/edk2/UnixPkg +cd ~/work/edk2/EmulatorPkg ./build.sh ``` =20 -Debug the UnixPkg +Debug the EmulatorPkg =20 ``` ./build.sh run =20 -Building from: /Users/fish/work/edk2 +Initializing workspace +/Users/bcran/src/edk2/BaseTools +Loading previous configuration from /Users/bcran/src/edk2/Conf/BuildEnv.sh +Using EDK2 in-source Basetools +WORKSPACE: /Users/bcran/src/edk2 +EDK_TOOLS_PATH: /Users/bcran/src/edk2/BaseTools +CONF_PATH: /Users/bcran/src/edk2/Conf using prebuilt tools -Reading symbols for shared libraries ...... done -Breakpoint 1 at 0xce84: file /Users/fish/work/edk2/UnixPkg/Sec/SecMain.c, = line 1070. -(gdb)=20 -``` - -Type `r` at the gdb prompt (don't forget to hit carriage return) to boot t= he emulator. Ctrl-c in the terminal window will break in to gdb. bt is the = stack backtrace command: - -``` -^C -Program received signal SIGINT, Interrupt. -0x92423806 in __semwait_signal () -(gdb) bt -#0 0x92423806 in __semwait_signal () -#1 0x9244f441 in nanosleep$UNIX2003 () -#2 0x0000b989 in msSleep (Milliseconds=3D0x14) at /Users/fish/work/Migrat= ion/edk2/UnixPkg/Sec/UnixThunk.c:102 -#3 0x0000acf5 in UgaCheckKey (UgaIo=3D0x2078d0) at /Users/fish/work/Migra= tion/edk2/UnixPkg/Sec/UgaX11.c:380 -#4 0x0000d8b7 in _GasketUintn () at /Users/fish/work/Migration/edk2/Build= /Unix/DEBUG_XCODE32/IA32/UnixPkg/Sec/SecMain/OUTPUT/Ia32/Gasket.iii:63 -#5 0x0000d801 in GasketUgaCheckKey (UgaIo=3D0x2078d0) at /Users/fish/work= /Migration/edk2/UnixPkg/Sec/Gasket.c:406 -#6 0x454a25fb in UnixUgaSimpleTextInWaitForKey (Event=3D0x45603610, Conte= xt=3D0x45382110) at /Users/fish/work/Migration/edk2/UnixPkg/UnixUgaDxe/Unix= UgaInput.c:169 -#7 0x45faad3a in CoreDispatchEventNotifies (Priority=3D0x10) at /Users/fi= sh/work/Migration/edk2/MdeModulePkg/Core/Dxe/Event/Event.c:185 -#8 0x45faa639 in CoreRestoreTpl (NewTpl=3D0x4) at /Users/fish/work/Migrat= ion/edk2/MdeModulePkg/Core/Dxe/Event/Tpl.c:114 -#9 0x45f9f197 in CoreReleaseLock (Lock=3D0x45fb1024) at /Users/fish/work/= Migration/edk2/MdeModulePkg/Core/Dxe/Library/Library.c:102 -#10 0x45faabd6 in CoreReleaseEventLock () at /Users/fish/work/Migration/ed= k2/MdeModulePkg/Core/Dxe/Event/Event.c:113 -#11 0x45fab26c in CoreCheckEvent (UserEvent=3D0x45603210) at /Users/fish/w= ork/Migration/edk2/MdeModulePkg/Core/Dxe/Event/Event.c:562 -#12 0x45fab2db in CoreWaitForEvent (NumberOfEvents=3D0x1, UserEvents=3D0x4= 5f94cc4, UserIndex=3D0x45f94cb8) at /Users/fish/work/Migration/edk2/MdeModu= lePkg/Core/Dxe/Event/Event.c:621 -#13 0x49ce9557 in ?? () -#14 0x49cf0344 in ?? () -#15 0x49ce3bc2 in ?? () -#16 0x49ce3ae1 in ?? () -#17 0x45f9e4e3 in CoreStartImage (ImageHandle=3D0x49e31e10, ExitDataSize= =3D0x45f94eec, ExitData=3D0x45f94ee8) at /Users/fish/work/Migration/edk2/Md= eModulePkg/Core/Dxe/Image/Image.c:1260 -#18 0x4550cccc in BdsLibBootViaBootOption (Option=3D0x49ffa110, DevicePath= =3D0x49ffa190, ExitDataSize=3D0x45f94eec, ExitData=3D0x45f94ee8) at /Users/= fish/work/Migration/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsB= oot.c:382 -#19 0x455252a9 in BdsBootDeviceSelect () at /Users/fish/work/Migration/edk= 2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:214 -#20 0x455255bc in BdsEntry (This=3D0x4552d01c) at /Users/fish/work/Migrati= on/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:356 -#21 0x45fad7e8 in DxeMain (HobStart=3D0x45f70010) at /Users/fish/work/Migr= ation/edk2/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:425 -#22 0x45fadd1d in ProcessModuleEntryPointList (HobStart=3D0x42020000) at /= Users/fish/work/Migration/edk2/Build/Unix/DEBUG_XCODE32/IA32/MdeModulePkg/C= ore/Dxe/DxeMain/DEBUG/AutoGen.c:287 -#23 0x45f97773 in _ModuleEntryPoint (HobStart=3D0x42020000) at /Users/fish= /work/Migration/edk2/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c:54 -(gdb)=20 +(lldb) target create "./Host" +Current executable set to '/Users/bcran/src/edk2/Build/EmulatorX64/DEBUG_X= CODE5/X64/Host' (x86_64). +(lldb) command script import /Users/bcran/src/edk2/EmulatorPkg/Unix/lldbef= i.py +Type r to run emulator. SecLldbScriptBreak armed. EFI modules should now g= et source level debugging in the emulator. +(lldb) script lldb.debugger.SetAsync(True) +(lldb) run +Process 12155 launched: '/Users/bcran/src/edk2/Build/EmulatorX64/DEBUG_XCO= DE5/X64/Host' (x86_64) + +EDK II UNIX Host Emulation Environment from http://www.tianocore.org/edk2/ + BootMode 0x00 + OS Emulator passing in 128 KB of temp RAM at 0x102000000 to SEC + FD loaded from ../FV/FV_RECOVERY.fd at 0x102020000 contains SEC Core +... +``` + +Type `process interrupt` at the lldb prompt (don't forget to hit carriage = return) to pause execution. Ctrl-c in the terminal window will quit lldb. `= bt` is the stack backtrace command: + +``` +Process 12420 stopped +* thread #1, queue =3D 'com.apple.main-thread', stop reason =3D signal SIG= STOP + frame #0: 0x00007fff2033cc22 libsystem_kernel.dylib:__semwait_signal()= + 10 +libsystem_kernel.dylib`__semwait_signal: +-> 0x7fff2033cc22 <+10>: jae 0x7fff2033cc2c ; <+20> + 0x7fff2033cc24 <+12>: movq %rax, %rdi + 0x7fff2033cc27 <+15>: jmp 0x7fff2033b72d ; cerror + 0x7fff2033cc2c <+20>: retq +Target 0: (Host) stopped. +(lldb) bt +* thread #1, queue =3D 'com.apple.main-thread', stop reason =3D signal SIG= STOP + * frame #0: 0x00007fff2033cc22 libsystem_kernel.dylib:__semwait_signal()= + 10 + frame #1: 0x00007fff202bcc2a libsystem_c.dylib:nanosleep() + 196 + frame #2: 0x0000000100005e55 Host:SecCpuSleep() + 37 at /Users/bcran/s= rc/edk2/EmulatorPkg/Unix/Host/EmuThunk.c:334 + frame #3: 0x000000010000e96e Host:GasketSecCpuSleep() + 11 at /Users/b= cran/src/edk2/Build/EmulatorX64/DEBUG_XCODE5/X64/EmulatorPkg/Unix/Host/Host= /OUTPUT/X64/Gasket.iiii:283 + frame #4: 0x0000000106f985e9 DxeCore.dll:CoreDispatchEventNotifies() += 264 at /Users/bcran/src/edk2/MdeModulePkg/Core/Dxe/Event/Event.c:194 + frame #5: 0x0000000106f97fce DxeCore.dll:CoreRestoreTpl() + 227 at /Us= ers/bcran/src/edk2/MdeModulePkg/Core/Dxe/Event/Tpl.c:131 + frame #6: 0x0000000106f989db DxeCore.dll:CoreSignalEvent() + 111 at /U= sers/bcran/src/edk2/MdeModulePkg/Core/Dxe/Event/Event.c:566 + frame #7: 0x0000000106f98b01 DxeCore.dll:CoreWaitForEvent() + 94 at /U= sers/bcran/src/edk2/MdeModulePkg/Core/Dxe/Event/Event.c:707 + frame #8: 0x0000000113e8e54c BdsDxe.dll:BdsWaitForSingleEvent() + 127 = at /Users/bcran/src/edk2/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:250 + frame #9: 0x0000000113e8e70b BdsDxe.dll:BdsWait() + 215 at /Users/bcra= n/src/edk2/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:328 + frame #10: 0x0000000113e8dffb BdsDxe.dll:BdsEntry() + 2612 at /Users/b= cran/src/edk2/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:1012 + frame #11: 0x0000000106f9bbd6 DxeCore.dll:DxeMain() + 2791 at /Users/b= cran/src/edk2/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:551 + frame #12: 0x0000000106f9ed8f DxeCore.dll:_ModuleEntryPoint() + 20 at = /Users/bcran/src/edk2/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c:= 48 + frame #13: 0x0000000106fdd02f DxeIpl.dll:InternalSwitchStack() + 15 + frame #14: 0x0000000106fdc0b6 DxeIpl.dll:HandOffToDxeCore() + 546 at /= Users/bcran/src/edk2/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c:126 + frame #15: 0x0000000106fda78a DxeIpl.dll:DxeLoadCore() + 1354 at /User= s/bcran/src/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c:449 + frame #16: 0x0000000106ff1d7c + frame #17: 0x00000001020255c6 PeiCore.dll:PeiCore() + 1982 at /Users/b= cran/src/edk2/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c:331 + frame #18: 0x000000010202a82c PeiCore.dll:PeiCheckAndSwitchStack() + 1= 171 at /Users/bcran/src/edk2/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c:= 842 + frame #19: 0x000000010202b853 PeiCore.dll:PeiDispatcher() + 1206 at /U= sers/bcran/src/edk2/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c:1609 +(lldb) + ``` =20 # Build and Debug from Xcode -To build from the Xcode GUI open ~/work/edk2/UnixPkg/Xcode/xcode_project/x= code_project.xcodeproj. You can build, clean, and source level debug from= the Xcode GUI. You can hit the Build and Debug button to start the build p= rocess. You need to need to hit command-shift-B to show the output of the b= uild. Click Pause to break into the debugger. - -[[File:Xcode.jpg]] +To build from the Xcode GUI open ~/work/edk2/EmulatorPkg/Unix/Xcode/xcode_= project64/xcode_project.xcodeproj. You can build, clean, and source level d= ebug from the Xcode GUI. You can hit the Build and Debug button to start th= e build process. You need to need to hit command-shift-B to show the output= of the build. Click Pause to break into the debugger. =20 The stack trace contains items that show as ?? since the default shell is = checked in as a binary. `nanosleep$UNIX2003` and `__semwait_signal` are POS= IX library calls and you do not get C source debug with these symbols. =20 -# Source Level Debug Shell=20 - -It is possible to get source level debug for the EFI Shell by pulling thes= e projects from source control and building them. - -Instructions for building and hooking in the shell are located in the [htt= ps://sourceforge.net/apps/mediawiki/tianocore/index.php?title=3DGcc-shell g= cc-shell] project. - -Please note the gcc-shell and UnixPkg build separately, so if you update s= hell code you need to build the shell to see the changes. The following scr= een shot shows being able to source level debug the shell: - -[[File:Xcode_good.jpg]] +*Note* The Xcode project is currently (as of 2021-05-09) broken. =20 # See Also =20 -* [[Step-by-step instructions]] - # Continue with common instructions =20 -The [remaining instructions](../Common-instructions) are common for most U= NIX-like systems. +The [remaining instructions](https://github.com/tianocore/tianocore.github= .io/wiki/Common-instructions-for-Unix) are common for most UNIX-like system= s. --=20 2.30.1 (Apple Git-130)
|
|
Re: Build fails with VS2012
Rebecca Cran <rebecca@...>
Similarly the build is also failing with GCC49, using gcc 4.9.2:
toggle quoted messageShow quoted text
/edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c: In function 'ShellSortFileList': Building ... /edk2/OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf [X64] /edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c:2202:19: error: 'Dupes' may be used uninitialized in this function [-Werror=maybe-uninitialized] *Duplicates = Dupes; ^ -- Rebecca Cran
On 5/8/21 1:47 PM, Rebecca Cran wrote:
I'm setting up a new Jenkins server to do Bhyve builds and run on platforms that aren't currently tested with the GitHub/Azure system.
|
|
Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in SimpleTextOut test
Samer El-Haj-Mahmoud
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>
toggle quoted messageShow quoted text
-----Original Message-----IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
|
Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
Samer El-Haj-Mahmoud
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>
toggle quoted messageShow quoted text
-----Original Message-----IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
|
TianoCore Design Meeting - APAC/NAMO - Fri, 05/14/2021 9:30am-10:30am
#cal-reminder
devel@edk2.groups.io Calendar <devel@...>
Reminder: TianoCore Design Meeting - APAC/NAMO When: Friday, 14 May 2021, 9:30am to 10:30am, (GMT+08:00) Asia/Shanghai Where:Microsoft Teams Organizer: Ray Ni ray.ni@... Description: TOPIC
For more info, see here: https://www.tianocore.org/design-meeting/ Microsoft Teams meetingJoin on your computer or mobile appClick here to join the meeting Join with a video conferencing deviceteams@... Video Conference ID: 119 715 416 0
|
|
Build fails with VS2012
Rebecca Cran
I'm setting up a new Jenkins server to do Bhyve builds and run on platforms that aren't currently tested with the GitHub/Azure system.
Since VS2012 appears to be a supported toolchain, I tried building OvmfPkgX64 with it (I'm also planning on testing VS2013, VS2015, VS2017 and VS2019), but it fails with: Building ... c:\users\administrator\src\edk2\NetworkPkg\Library\DxeUdpIoLib\DxeUdpIoLib.inf [X64] c:\users\administrator\src\edk2\UefiCpuPkg\Library\MpInitLib\MpLib.c(1268) : error C2220: warning treated as error - no 'object' file generated c:\users\administrator\src\edk2\UefiCpuPkg\Library\MpInitLib\MpLib.c(1268) : warning C4306: 'type cast' : conversion from 'int' to 'SEV_ES_AP_JMP_FAR *' of greater size I know the GitHub/Azure system only tests with VS2017 and VS2019: are there plans to drop the older VS versions, or should they still work? And would it be considered useful to _check_ that they still work, or should they be considered unsupported? -- Rebecca Cran
|
|
[Patch 1/1] BaseTools: Fix DSC override of Guided tool
Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359
If the DSC file provides an override of a Guided tool path and/or Guided tool GUID value, then make sure the one from the DSC file is used if it is higher priority than the Guided tool in the tools_def.txt file. This makes the Guided tool used by GenFds match the tool listed GuidedSectionTools.txt. Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> Cc: Yuwei Chen <yuwei.chen@...> Signed-off-by: Michael D Kinney <michael.d.kinney@...> --- .../Source/Python/AutoGen/PlatformAutoGen.py | 7 +- .../Python/GenFds/GenFdsGlobalVariable.py | 228 ++++++++++++------ BaseTools/Source/Python/build/build.py | 52 ++-- 3 files changed, 190 insertions(+), 97 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index 832c0da86bb7..592d4824a4b3 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -918,14 +918,13 @@ class PlatformAutoGen(AutoGen): if Tool in self._BuildOptionWithToolDef(RetVal) and Attr in self._BuildOptionWithToolDef(RetVal)[Tool]: # check if override is indicated if self._BuildOptionWithToolDef(RetVal)[Tool][Attr].startswith('='): - Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:] + Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:].strip() else: - if Attr != 'PATH': + # Do not append PATH or GUID + if Attr != 'PATH' and Attr != 'GUID': Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr] else: Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr] - Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr]) - self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value if Attr == "PATH": # Don't put MAKE definition in the file if Tool != "MAKE": diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index c31fc24870d5..25f9d54874d3 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -32,6 +32,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open from Common.MultipleWorkspace import MultipleWorkspace as mws import Common.GlobalData as GlobalData from Common.BuildToolError import * +from AutoGen.AutoGen import CalculatePriorityValue ## Global variables # @@ -850,6 +851,10 @@ class GenFdsGlobalVariable: # @param NameGuid The Guid name # def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): + if GenFdsGlobalVariable.GuidToolDefinition: + if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: + return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] + ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) ToolDef = ToolDefObj.ToolDef ToolDb = ToolDef.ToolsDefTxtDatabase @@ -864,86 +869,159 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): if Target + '_' + ToolChain + '_' + Arch not in KeyStringList: KeyStringList.append(Target + '_' + ToolChain + '_' + Arch) - if GenFdsGlobalVariable.GuidToolDefinition: - if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: - return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] - - ToolDefinition = ToolDef.ToolsDefTxtDictionary ToolPathTmp = None ToolOption = None - ToolPathKey = None - ToolOptionKey = None - KeyList = None - for tool_def in ToolDefinition.items(): - KeyList = tool_def[0].split('_') - if len(KeyList) < 5: - continue - if KeyList[4] != DataType.TAB_GUID: - continue - if NameGuid.lower() != tool_def[1].lower(): - continue - Key = KeyList[0] + \ - '_' + \ - KeyList[1] + \ - '_' + \ - KeyList[2] + for Arch in CurrentArchList: + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None for KeyString in KeyStringList: KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') - if KeyList[0] == DataType.TAB_STAR: - KeyList[0] = KeyStringBuildTarget - if KeyList[1] == DataType.TAB_STAR: - KeyList[1] = KeyStringToolChain - if KeyList[2] == DataType.TAB_STAR: - KeyList[2] = KeyStringArch - if KeyList[0] == KeyStringBuildTarget and KeyList[1] == KeyStringToolChain and KeyList[2] == KeyStringArch: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - ToolPath = ToolDefinition.get(ToolPathKey) - ToolOption = ToolDefinition.get(ToolOptionKey) - if ToolPathTmp is None: - ToolPathTmp = ToolPath - else: - if ToolPathTmp != ToolPath: - EdkLogger.error("GenFds", GENFDS_ERROR, "Don't know which tool to use, %s or %s ?" % (ToolPathTmp, ToolPath)) + if KeyStringArch != Arch: + continue + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute + continue + if ToolDef.ToolsDefTxtDictionary[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem.split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem) > CalculatePriorityValue(Item): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem.split('_')[3] + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem) <= CalculatePriorityValue(Item): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem) <= CalculatePriorityValue(Item): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = ToolDef.ToolsDefTxtDictionary[MatchPathItem] + if MatchOptionsItem: + ToolOption = ToolDef.ToolsDefTxtDictionary[MatchOptionsItem] - BuildOption = {} for Arch in CurrentArchList: - Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] - # key is (ToolChainFamily, ToolChain, CodeBase) - for item in Platform.BuildOptions: - if '_PATH' in item[1] or '_FLAGS' in item[1] or '_GUID' in item[1]: - if not item[0] or (item[0] and GenFdsGlobalVariable.ToolChainFamily== item[0]): - if item[1] not in BuildOption: - BuildOption[item[1]] = Platform.BuildOptions[item] - if BuildOption: - ToolList = [DataType.TAB_TOD_DEFINES_TARGET, DataType.TAB_TOD_DEFINES_TOOL_CHAIN_TAG, DataType.TAB_TOD_DEFINES_TARGET_ARCH] - for Index in range(2, -1, -1): - for Key in list(BuildOption.keys()): - List = Key.split('_') - if List[Index] == DataType.TAB_STAR: - for String in ToolDb[ToolList[Index]]: - if String in [Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]: - List[Index] = String - NewKey = '%s_%s_%s_%s_%s' % tuple(List) - if NewKey not in BuildOption: - BuildOption[NewKey] = BuildOption[Key] - continue - del BuildOption[Key] - elif List[Index] not in ToolDb[ToolList[Index]]: - del BuildOption[Key] - if BuildOption: - if not KeyList: - for Op in BuildOption: - if NameGuid == BuildOption[Op]: - KeyList = Op.split('_') - Key = KeyList[0] + '_' + KeyList[1] +'_' + KeyList[2] - if Key in KeyStringList and KeyList[4] == DataType.TAB_GUID: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - if ToolPathKey in BuildOption: - ToolPathTmp = BuildOption[ToolPathKey] - if ToolOptionKey in BuildOption: - ToolOption = BuildOption[ToolOptionKey] - + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None + for KeyString in KeyStringList: + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') + if KeyStringArch != Arch: + continue + Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, KeyStringBuildTarget, KeyStringToolChain] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute match + continue + if Platform.BuildOptions[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem[1].split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem[1]) > CalculatePriorityValue(Item[1]): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem[1].split('_')[3] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem[1]) <= CalculatePriorityValue(Item[1]): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem[1]) <= CalculatePriorityValue(Item[1]): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = Platform.BuildOptions[MatchPathItem] + if MatchOptionsItem: + ToolOption = Platform.BuildOptions[MatchOptionsItem] GenFdsGlobalVariable.GuidToolDefinition[NameGuid] = (ToolPathTmp, ToolOption) return ToolPathTmp, ToolOption diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e5693c0d27a2..037493f0b02a 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo from GenFds.FdfParser import FdfParser from AutoGen.IncludesAutoGen import IncludesAutoGen from GenFds.GenFds import resetFdsGlobalVariable +from AutoGen.AutoGen import CalculatePriorityValue ## standard targets of build command gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] @@ -2425,27 +2426,42 @@ class Build(): FvDir = Wa.FvDir if not os.path.exists(FvDir): continue - for Arch in self.ArchList: - # Look through the tool definitions for GUIDed tools + guidList = [] + tooldefguidList = [] guidAttribs = [] - for (attrib, value) in self.ToolDef.ToolsDefTxtDictionary.items(): - GuidBuildTarget, GuidToolChain, GuidArch, GuidTool, GuidAttr = attrib.split('_') - if GuidAttr.upper() == 'GUID': - if GuidBuildTarget == TAB_STAR: - GuidBuildTarget = BuildTarget - if GuidToolChain == TAB_STAR: - GuidToolChain = ToolChain - if GuidArch == TAB_STAR: - GuidArch = Arch - if GuidBuildTarget == BuildTarget and GuidToolChain == ToolChain and GuidArch == Arch: - path = '_'.join(attrib.split('_')[:-1]) + '_PATH' - if path in self.ToolDef.ToolsDefTxtDictionary: - path = self.ToolDef.ToolsDefTxtDictionary[path] - path = self.GetRealPathOfTool(path) - guidAttribs.append((value.lower(), GuidTool, path)) + for Platform in Wa.AutoGenObjectList: + if Platform.BuildTarget != BuildTarget: + continue + if Platform.ToolChain != ToolChain: + continue + if Platform.Arch != Arch: + continue + if hasattr (Platform, 'BuildOption'): + for Tool in Platform.BuildOption: + if 'GUID' in Platform.BuildOption[Tool]: + if 'PATH' in Platform.BuildOption[Tool]: + value = Platform.BuildOption[Tool]['GUID'] + if value in guidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in DSC [BuildOptions]." % (value, Tool)) + path = Platform.BuildOption[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, path)) + for Tool in Platform.ToolDefinition: + if 'GUID' in Platform.ToolDefinition[Tool]: + if 'PATH' in Platform.ToolDefinition[Tool]: + value = Platform.ToolDefinition[Tool]['GUID'] + if value in tooldefguidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in tools_def.txt." % (value, Tool)) + tooldefguidList.append(value) + if value in guidList: + # Already added by platform + continue + path = Platform.ToolDefinition[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, path)) # Sort by GuidTool name - sorted (guidAttribs, key=lambda x: x[1]) + guidAttribs = sorted (guidAttribs, key=lambda x: x[1]) # Write out GuidedSecTools.txt toolsFile = os.path.join(FvDir, 'GuidedSectionTools.txt') toolsFile = open(toolsFile, 'wt') -- 2.31.1.windows.1
|
|
Re: [edk2-test][Patch 1/1] ImageIndex need be corrected to range 1 ~ DescriptorCount.
Upstreamed by commit : https://github.com/tianocore/edk2-test/commit/da461e14fe86a5f4ee03ab64b412bf5f0bfe08e9
|
|
Re: [edk2-test][Patch 1/1] ImageIndex need be corrected to range 1 ~ DescriptorCount.
Reviewed-by: G Edhaya Chandran<edhaya.chandran@...>
|
|
Re: [edk2-sct PATCH] buildzip: Add CapsuleApp.efi to the SCT zip file
Upstreamed by commit id: https://github.com/tianocore/edk2-test/commit/9b6d2b1d15af785d87ecd2c4d29906a86957d545
toggle quoted messageShow quoted text
-----Original Message-----
|
|
回复: [edk2-devel] [PATCH 00/13] Add GHCBv2 macro and helpers
gaoliming
Brijesh:
toggle quoted messageShow quoted text
The changes in MdePkg is good to me. Reviewed-by: Liming Gao <gaoliming@...> One minor comment is in Patch2. Its title should be MdePkg/Register/Amd: xxxx to align other patches. Thanks Liming
-----邮件原件-----
|
|
回复: [PATCH v2 1/2] MdePkg/BaseRngLib: Add support for ARMv8.5 RNG instructions
gaoliming
Rebecca:
-----邮件原件-----No change is in BaseLib. RNDR and RNDRRS instructions are added into BaseRngLib. And, BaseRngLib only uses RNDR instruction to get random value. So, RNDRRS implementation is dead code. It is not required to be added. Thanks Liming registration. SmiHandlerProfileLib|Include/Library/SmiHandlerProfileLib.h+#-------------------------------------------------------------------------- ---- +#+#-------------------------------------------------------------------------- ---- ++;-------------------------------------------------------------------------- ---- +;+;-------------------------------------------------------------------------- ---- ++#-------------------------------------------------------------------------- ---- +#+#-------------------------------------------------------------------------- ---- ++;-------------------------------------------------------------------------- ---- +;+;-------------------------------------------------------------------------- ---- +
|
|
回复: [PATCH v2 2/2] SecurityPkg: Add support for RngDxe on AARCH64
gaoliming
Rebecca:
-----邮件原件-----This PCD value is GUID. So, its default value should be GUID (16 bytes) instead of {0} (1 byte). Thanks Liming [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]specification and has been removed.<BR>Spec. + //Spec. - //
|
|
TianoCore Meeting Minutes - May 2021
Revised minutes:
TianoCore Community Meeting May 6, 2021 EVENTS: UEFI Plugfest (update from Dick Wilkins): We are planning a plug fest during the week of April 4th during 2022 in Hillsboro, Oregon. Google Summer of Code (update from Nate Desimone) * Google has reviewed the project submissions and will communicate the decisions to those applicants on the accepted projects on May 17th. * Projects will begin from Jun 7 till Aug 16th. * Community Action: We encourage entire community to be involved, for getting your input/comments and supporting our mentors. The community can get involved in activities such as code reviews etc.. we need support from maintainers, reviewers. Be responsive on the mailing list. you can respond to students when they post questions on the mailing list. Stable Tag updates: o Up to date information: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning o Feature planning freeze scheduled for 5/10/2021 Stewards Meeting Download (Mike Kinney) * Limited attendance this month. o We are seeing an increase in EDK2 CI failure/coverage issues. Azure moved to Ubuntu 20 and we are still on Ubuntu 18. There are some gaps (such as emulator package) that we are addressing. There is a specific failure on emulator package that we need to disable temporarily. Ubuntu GCC IA32 EmulatorPkg - 32-bit X11 dependency conflicts. May need to consider adding text console support. o Action: Mike Kinney will submit an RFC * Bugzilla 988 (https://bugzilla.tianocore.org/show_bug.cgi?id=988) - performance issues in handles database. o DXE core implementation and performance issues on large number of handles. o Question to the Community: Can we drop EFI 1.02 driver compatibility support from DXE core? Removing the compatibility will help the performance issues, but not fully resolve them. Risk is extremely low for support. Simple change in DXE core. Base tools still have support for building EDK1 style modules. Action: Mike to start an RFC on this topic. Opens: Dick Wilkins - MSFT maintains the list of revoked code signatures for UEFI code modules and loaders for the UEFI Forum and produces binary files that contain revoked signatures for use by secure boot. MSFT has approved the latest update of revoked signatures list for general testing. They are posted at https://uefi.org/revocationlistfile. These files should only be used for testing at this time. Use of these files my cause systems to not boot and should not be used in shipping products without appropriate planning and testing. Regards, Soumya Soumya Guptha Firmware Ecosystem Enabling Manager, Intel Corporation
|
|
TianoCore Meeting Minutes - May 2021
TianoCore Community Meeting May 6, 2021
EVENTS: UEFI Plugfest (update from Dick Wilkins): We are planning a plug fest during the week of April 4th during 2022 in Hillsboro, Oregon.
Google Summer of Code (update from Nate Desimone)
Stable Tag updates: o Up to date information: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning o Feature planning freeze scheduled for 5/10/2021
Stewards Meeting Download (Mike Kinney) · Limited attendance this month. o We are seeing an increase in EDK2 CI failure/coverage issues. Azure moved to Ubuntu 20 and we are still on Ubuntu 18. There are some gaps (such as emulator package) that we are addressing. There is a specific failure on emulator package that we need to disable temporarily. Ubuntu GCC IA32 EmulatorPkg – 32-bit X11 dependency conflicts. May need to consider adding text console support. o Action: Mike Kinney will submit an RFC · Bugzilla 988 (https://bugzilla.tianocore.org/show_bug.cgi?id=988) – performance issues in handles database. o DXE core implementation and performance issues on large number of handles. o Question to the Community: Can we drop EFI 1.02 driver compatibility support from DXE core? Removing the compatibility will help the performance issues, but not fully resolve them. Risk is extremely low for support. Simple change in DXE core. Base tools still have support for building EDK1 style modules. Action: Mike to start an RFC on this topic.
Opens: Dick Wilkins - MSFT maintains the list of revoked code signatures for UEFI code modules and loaders for the UEFI Forum and produces binary files that contain revoked signatures for use by secure boot. MSFT has approved the latest update of revoked signatures list for general testing. They are posted at https://uefi.org/revocationlistfile. These files should only be used for testing at this time. Use of these files my cause systems to not boot and should not be used in shipping products without appropriate planning and testing.
Regards, Soumya
Soumya Guptha
|
|
[PATCH 13/13] OvmfPkg/BaseMemEncryptSevLib: remove Flush parameter
Brijesh Singh
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275
The Flush parameter is used to provide a hint whether the specified range is Mmio address. Now that we have a dedicated helper to clear the memory encryption mask for the Mmio address range, its safe to remove the Flush parameter from MemEncryptSev{Set,Clear}PageEncMask(). Cc: James Bottomley <jejb@...> Cc: Min Xu <min.m.xu@...> Cc: Jiewen Yao <jiewen.yao@...> Cc: Tom Lendacky <thomas.lendacky@...> Cc: Jordan Justen <jordan.l.justen@...> Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Laszlo Ersek <lersek@...> Cc: Erdem Aktas <erdemaktas@...> Signed-off-by: Brijesh Singh <brijesh.singh@...> --- OvmfPkg/Include/Library/MemEncryptSevLib.h | 10 ++---- .../BaseMemEncryptSevLib/X64/VirtualMemory.h | 10 ++---- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 3 +- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 6 ++-- .../Ia32/MemEncryptSevLib.c | 10 ++---- .../X64/MemEncryptSevLib.c | 16 +++------- .../X64/PeiDxeVirtualMemory.c | 32 +++++++++++-------- .../X64/SecVirtualMemory.c | 8 ++--- .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 3 +- OvmfPkg/PlatformPei/AmdSev.c | 3 +- 10 files changed, 35 insertions(+), 66 deletions(-) diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h index b91490d5d44d..76d06c206c8b 100644 --- a/OvmfPkg/Include/Library/MemEncryptSevLib.h +++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h @@ -100,8 +100,6 @@ MemEncryptSevIsEnabled ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -114,8 +112,7 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ); /** @@ -128,8 +125,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -142,8 +137,7 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ); diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h index 8dc39e647b90..21bbbd1c4f9c 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h @@ -58,8 +58,6 @@ InternalGetMemEncryptionAddressMask ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -72,8 +70,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ); /** @@ -85,8 +82,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -99,8 +94,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ); /** diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index 80831b81facf..41e4b291d070 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -120,8 +120,7 @@ AmdSevDxeEntryPoint ( Status = MemEncryptSevClearPageEncMask ( 0, // Cr3BaseAddress -- use current CR3 MapPagesBase, // BaseAddress - MapPagesCount, // NumPages - TRUE // Flush + MapPagesCount // NumPages ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: MemEncryptSevClearPageEncMask(): %r\n", diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c index 49ffa2448811..b30628078f73 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -252,8 +252,7 @@ IoMmuMap ( Status = MemEncryptSevClearPageEncMask ( 0, MapInfo->PlainTextAddress, - MapInfo->NumberOfPages, - TRUE + MapInfo->NumberOfPages ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { @@ -407,8 +406,7 @@ IoMmuUnmapWorker ( Status = MemEncryptSevSetPageEncMask ( 0, MapInfo->PlainTextAddress, - MapInfo->NumberOfPages, - TRUE + MapInfo->NumberOfPages ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c b/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c index 169d3118e44f..be260e0d1014 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c @@ -25,8 +25,6 @@ address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -39,8 +37,7 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { // @@ -59,8 +56,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -73,8 +68,7 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { // diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c index a2bf698bcde7..a57e8fd37fa7 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c @@ -27,8 +27,6 @@ address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -41,15 +39,13 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { return InternalMemEncryptSevSetMemoryDecrypted ( Cr3BaseAddress, BaseAddress, - EFI_PAGES_TO_SIZE (NumPages), - Flush + EFI_PAGES_TO_SIZE (NumPages) ); } @@ -63,8 +59,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -77,15 +71,13 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { return InternalMemEncryptSevSetMemoryEncrypted ( Cr3BaseAddress, BaseAddress, - EFI_PAGES_TO_SIZE (NumPages), - Flush + EFI_PAGES_TO_SIZE (NumPages) ); } diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c index a18d336a8789..ad1021bd3e43 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c @@ -555,8 +555,7 @@ EnableReadOnlyPageWriteProtect ( address of a memory region. @param[in] Length The length of memory region @param[in] Mode Set or Clear mode - @param[in] CacheFlush Flush the caches before applying the - encryption mask + @param[in] Mmio The physical address range is Mmio. @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -572,7 +571,7 @@ SetMemoryEncDec ( IN PHYSICAL_ADDRESS PhysicalAddress, IN UINTN Length, IN MAP_RANGE_MODE Mode, - IN BOOLEAN CacheFlush + IN BOOLEAN Mmio ) { PAGE_MAP_AND_DIRECTORY_POINTER *PageMapLevel4Entry; @@ -585,12 +584,23 @@ SetMemoryEncDec ( UINT64 AddressEncMask; BOOLEAN IsWpEnabled; RETURN_STATUS Status; + BOOLEAN CacheFlush; // // Set PageMapLevel4Entry to suppress incorrect compiler/analyzer warnings. // PageMapLevel4Entry = NULL; + // + // The cache need to flushed for the non-Mmio address range. + // + if (Mmio == TRUE) { + CacheFlush = FALSE; + } else { + CacheFlush = TRUE; + } + + // DEBUG (( DEBUG_VERBOSE, "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx Mode=%a CacheFlush=%u\n", @@ -828,8 +838,6 @@ SetMemoryEncDec ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -842,8 +850,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { @@ -852,7 +859,7 @@ InternalMemEncryptSevSetMemoryDecrypted ( PhysicalAddress, Length, ClearCBit, - Flush + FALSE ); } @@ -865,8 +872,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -879,8 +884,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { return SetMemoryEncDec ( @@ -888,7 +892,7 @@ InternalMemEncryptSevSetMemoryEncrypted ( PhysicalAddress, Length, SetCBit, - Flush + FALSE ); } @@ -921,6 +925,6 @@ InternalMemEncryptSevClearMmioPageEncMask ( PhysicalAddress, Length, ClearCBit, - FALSE + TRUE ); } diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c index bca5e3febb1b..24d19d3ca161 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c @@ -42,8 +42,6 @@ InternalGetMemEncryptionAddressMask ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -56,8 +54,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { // @@ -89,8 +86,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { // diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index fdf2380974fa..c7cc5b0389c8 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -283,8 +283,7 @@ SmmCpuFeaturesSmmRelocationComplete ( Status = MemEncryptSevSetPageEncMask ( 0, // Cr3BaseAddress -- use current CR3 MapPagesBase, // BaseAddress - MapPagesCount, // NumPages - TRUE // Flush + MapPagesCount // NumPages ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: MemEncryptSevSetPageEncMask(): %r\n", diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index dddffdebda4b..a8bf610022ba 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -72,8 +72,7 @@ AmdSevEsInitialize ( DecryptStatus = MemEncryptSevClearPageEncMask ( 0, GhcbBasePa + EFI_PAGES_TO_SIZE (PageCount), - 1, - TRUE + 1 ); ASSERT_RETURN_ERROR (DecryptStatus); } -- 2.17.1
|
|