Re: [PATCH] Fix Setup numeric default value incorrect issue
Hi All,
Any comments about patch ?
Thanks, Lin
toggle quoted messageShow quoted text
-----Original Message----- From: Chen, Lin Z <lin.z.chen@...> Sent: Monday, March 28, 2022 9:27 PM To: Wang, Jian J <jian.j.wang@...>; Gao, Liming <gaoliming@...>; Bi, Dandan <dandan.bi@...>; Dong, Eric <eric.dong@...>; devel@edk2.groups.io Cc: Li, Zhuangzhi <zhuangzhi.li@...>; Zhang, Di <di.zhang@...>; Chen, Lin Z <lin.z.chen@...> Subject: [PATCH] Fix Setup numeric default value incorrect issue
When default/manufacturing flag get removed from numeric varid, it can't get default value from StructurePcd in 'UpdateDefaultSettingInFormPackage' function since there is no EFI_IFR_DEFAULT_OP opcode in IFR file. Add a chance to get numeric default value from StructurePcd in the case that numeric minimum value will be used as default value.
Signed-off-by: Chen Lin Z <lin.z.chen@...> Signed-off-by: Dandan Bi <dandan.bi@...> --- .../Universal/HiiDatabaseDxe/ConfigRouting.c | 14 +++++++++++ .../Universal/HiiDatabaseDxe/HiiDatabase.h | 23 +++++++++++++++++++ 2 files changed, 37 insertions(+)
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 2f792d2965..8bfa0f4bf1 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -2171,6 +2171,7 @@ ParseIfrData ( UINTN PackageOffset; EFI_IFR_VARSTORE *IfrVarStore; EFI_IFR_VARSTORE_EFI *IfrEfiVarStore;+ EFI_IFR_VARSTORE_EFI *IfrEfiVarStoreTmp; EFI_IFR_OP_HEADER *IfrOpHdr; EFI_IFR_ONE_OF *IfrOneOf; EFI_IFR_REF4 *IfrRef;@@ -2187,6 +2188,7 @@ ParseIfrData ( IFR_BLOCK_DATA *BlockData; CHAR16 *VarStoreName; UINTN NameSize;+ UINTN NvDefaultStoreSize; UINT16 VarWidth; UINT16 VarDefaultId; BOOLEAN FirstOneOfOption;@@ -2303,6 +2305,14 @@ ParseIfrData ( } AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, VarStoreName, NameSize);+ IfrEfiVarStoreTmp = AllocatePool (IfrEfiVarStore->Header.Length + AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name));+ if (IfrEfiVarStoreTmp == NULL) {+ Status = EFI_OUT_OF_RESOURCES;+ goto Done;+ }++ CopyMem (IfrEfiVarStoreTmp, IfrEfiVarStore, IfrEfiVarStore->Header.Length);+ AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 *)&(IfrEfiVarStoreTmp->Name[0]), AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name) * sizeof (CHAR16)); if (IsThisVarstore (&IfrEfiVarStore->Guid, VarStoreName, ConfigHdr)) { //@@ -2502,9 +2512,13 @@ ParseIfrData ( // // Set default value base on the DefaultId list get from IFR data. //+ NvDefaultStoreSize = PcdGetSize (PcdNvStoreDefaultValueBuffer); for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) { DefaultDataPtr = BASE_CR (LinkData, IFR_DEFAULT_DATA, Entry); DefaultData.DefaultId = DefaultDataPtr->DefaultId;+ if (NvDefaultStoreSize > sizeof (PCD_NV_STORE_DEFAULT_BUFFER_HEADER)) {+ FindQuestionDefaultSetting (DefaultData.DefaultId, IfrEfiVarStoreTmp, &(IfrOneOf->Question), &DefaultData.Value, VarWidth, QuestionReferBitField);+ } InsertDefaultValue (BlockData, &DefaultData); } }diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h index c4ca6ad6ee..421c293cfc 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h @@ -2308,6 +2308,29 @@ HiiGetConfigRespInfo ( IN CONST EFI_HII_DATABASE_PROTOCOL *This ); +/**+ Find question default value from PcdNvStoreDefaultValueBuffer++ @param DefaultId Default store ID+ @param EfiVarStore Point to EFI VarStore header+ @param IfrQuestionHdr Point to Question header+ @param ValueBuffer Point to Buffer includes the found default setting+ @param Width Width of the default value+ @param BitFieldQuestion Whether the Question is stored in Bit field.++ @retval EFI_SUCCESS Question default value is found.+ @retval EFI_NOT_FOUND Question default value is not found.+**/+EFI_STATUS+FindQuestionDefaultSetting (+ IN UINT16 DefaultId,+ IN EFI_IFR_VARSTORE_EFI *EfiVarStore,+ IN EFI_IFR_QUESTION_HEADER *IfrQuestionHdr,+ OUT VOID *ValueBuffer,+ IN UINTN Width,+ IN BOOLEAN BitFieldQuestion+ );+ // // Global variables //-- 2.25.1
|
|
Re: [PATCH 2/2] OvmfPkg: Fix PciHostBridgeLibScan
On Wed, 30 Mar 2022 at 20:29, Sean Rhodes <sean@...> wrote: From: Patrick Rudolph <patrick.rudolph@...>
Don't assume a 64bit register always holds an address greater than 4GB. Check the value in the register and decide which Aperature it should be assigned to.
The same code caused an issue on real hardware. It's unclear if this is an issue here as well, as it's intended to run on emulated hardware only.
Do you have a link to such a supported issue? Or could you elaborate? Does it have to do with running out of 64-bit BAR space for resource that could be located in a 32-bit region as well? Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Jiewen Yao <jiewen.yao@...> Cc: Jordan Justen <jordan.l.justen@...> Cc: Gerd Hoffmann <kraxel@...> Signed-off-by: Patrick Rudolph <patrick.rudolph@...> --- .../PciHostBridgeLibScan/ScanForRootBridges.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c b/OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c index 5fb02a89b9..1ff96be57f 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c @@ -331,14 +331,18 @@ ScanForRootBridges ( Base = ((UINT32)Pci.Bridge.PrefetchableMemoryBase & 0xfff0) << 16; Limit = (((UINT32)Pci.Bridge.PrefetchableMemoryLimit & 0xfff0) << 16) | 0xfffff; - MemAperture = &Mem; if (Value == BIT0) { - Base |= LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32); - Limit |= LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32); - MemAperture = &MemAbove4G; + Base |= LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32); + Limit |= LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32); }
if (Base < Limit) { + if (Base < BASE_4GB) { + MemAperture = &Mem; + } else { + MemAperture = &MemAbove4G; + } + if (MemAperture->Base > Base) { MemAperture->Base = Base; } -- 2.32.0
------------ Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88266): https://edk2.groups.io/g/devel/message/88266 Mute This Topic: https://groups.io/mt/90138165/5717338 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [ardb+tianocore@...] ------------
|
|
Re: [PATCH 3/3] UefiPayloadPkg: Add --quiet argument to Universal Payload build script
Reviewed-by: Ray Ni <ray.ni@...>
toggle quoted messageShow quoted text
-----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean Rhodes Sent: Wednesday, March 30, 2022 4:32 AM To: devel@edk2.groups.io Cc: Rhodes, Sean <sean@...> Subject: [edk2-devel] [PATCH 3/3] UefiPayloadPkg: Add --quiet argument to Universal Payload build script Signed-off-by: Sean Rhodes <sean@...> --- UefiPayloadPkg/UniversalPayloadBuild.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py index 1b99eeff34..61423e5908 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -54,6 +54,7 @@ def BuildUniversalPayload(Args, MacroList): BuildTarget = Args.Target ToolChain = Args.ToolChain BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64" + Quiet = "-q" if Args.Quiet else " " ElfToolChain = 'CLANGDWARF' EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") @@ -82,13 +83,13 @@ def BuildUniversalPayload(Args, MacroList): # # Building DXE core and DXE drivers as DXEFV. # - BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath}" + BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}" BuildPayload += Defines RunCommand(BuildPayload) # # Building Universal Payload entry. # - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}" + BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath} {Quiet}" BuildModule += Defines RunCommand(BuildModule) @@ -120,6 +121,7 @@ def main(): parser.add_argument('-a', '--Arch', choices=['IA32', 'X64'], help='Specify the ARCH for payload entry module. Default build X64 image.', default ='X64') parser.add_argument("-D", "--Macro", action="append", default=["UNIVERSAL_PAYLOAD=TRUE"]) parser.add_argument('-i', '--ImageId', type=str, help='Specify payload ID (16 bytes maximal).', default ='UEFI') + parser.add_argument('-q', "--Quiet", help="Less verbose output", action='store_true') MacroList = {} args = parser.parse_args() if args.Macro is not None: -- 2.32.0 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88205): https://edk2.groups.io/g/devel/message/88205Mute This Topic: https://groups.io/mt/90117696/1712937Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@...] -=-=-=-=-=-=
|
|
Re: [PATCH 2/3] UefiPayloadPkg: Fix build on IA32
Reviewed-by: Ray Ni <ray.ni@...>
toggle quoted messageShow quoted text
-----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean Rhodes Sent: Wednesday, March 30, 2022 4:32 AM To: devel@edk2.groups.io Cc: Rhodes, Sean <sean@...> Subject: [edk2-devel] [PATCH 2/3] UefiPayloadPkg: Fix build on IA32 Signed-off-by: Sean Rhodes <sean@...> --- UefiPayloadPkg/UniversalPayloadBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py index ac965766c7..1b99eeff34 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -60,7 +60,7 @@ def BuildUniversalPayload(Args, MacroList): DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc") BuildDir = os.path.join(os.environ['WORKSPACE'], os.path.normpath("Build/UefiPayloadPkgX64")) FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv")) - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) + EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", f"{Args.Arch}", os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin") -- 2.32.0 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88204): https://edk2.groups.io/g/devel/message/88204Mute This Topic: https://groups.io/mt/90117695/1712937Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@...] -=-=-=-=-=-=
|
|
Re: [Patch V3 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance
+} UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL; + +#pragma pack() + +#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION 1
Please change above macro to UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION.
|
|
回复: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Christine: Can you try the option -Wno-unknown-warning to see whether it disables the warning about an unrecognized command line option? Thanks Liming -----邮件原件----- 发件人: Chen, Christine <yuwei.chen@...> 发送时间: 2022年3月31日 10:47 收件人: devel@edk2.groups.io; Chen, Christine <yuwei.chen@...>; Gerd Hoffmann <kraxel@...>; Kinney, Michael D <michael.d.kinney@...>; Sean Brogan <sean.brogan@...>; Gao, Liming <gaoliming@...>; Shi, Steven <steven.shi@...>; Feng, Bob C <bob.c.feng@...> 抄送: Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...> 主题: RE: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Since the gcc12 has the incompatible change from GCC5.4, I'd also suggest we could create a new TOOL CHAIN for gcc12. The error reports I collected show in gcc5.4 , "-Wno-error=stringop-overflow" is an unrecognized command line option which is available in gcc12.
Thanks, Christine (Yuwei)
-----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yuwei Chen Sent: Thursday, March 31, 2022 8:51 AM To: Gerd Hoffmann <kraxel@...>; devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...>; Gao, Liming <gaoliming@...> Subject: Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Hi Hoffmann,
I received some reports that some platforms are using gcc5.4. With this patch,
these platform builds are still broken. Would you like to revert the original commits?
Thanks, Christine (Yuwei)
-----Original Message----- From: Gerd Hoffmann <kraxel@...> Sent: Tuesday, March 29, 2022 4:38 PM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...>; Chen, Christine <yuwei.chen@...>;
Gao, Liming <gaoliming@...>; Gerd Hoffmann <kraxel@...> Subject: [PATCH v2 1/1] Basetools: fix gcc workaround
Apply the workaround only in case the compiler is gcc. Fixes builds with clang.
Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning") Reported-by: Rebecca Cran <rebecca@...> Signed-off-by: Gerd Hoffmann <kraxel@...> --- BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile index b05d2bddfa68..6323e7355cc8 100644 --- a/BaseTools/Source/C/DevicePath/GNUmakefile +++ b/BaseTools/Source/C/DevicePath/GNUmakefile @@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
+ifneq ($(CXX), llvm) # gcc 12 trips over device path handling BUILD_CFLAGS += -Wno- error=stringop-overflow +endif
LIBS = -lCommon ifeq ($(CYGWIN), CYGWIN) -- 2.35.1
|
|
[GSoC 2022] Introducing myself & seeking for project ideas

Théo Jehl
Hello, I’m Théo, a French 1st year master’s student, specialized in embedded systems engineering. I’m interested in joining EDK II development as part of the Google Summer of Code program. I’ve learnt operating system structures in uni, I know how to write C/C++ and I started learning x86 ASM. I also worked with uni on a disk driver and virtual memory mapping. Currently I have little to no experience in firmware/UEFI as I’m only starting in this field. I wanted to ask if any important project ideas were available that would fit my skills. I have checked the task list provided and I feel like it’s outdated, like the audio output project [1] which was completed a year ago. Thanks in advance. Théo [1] https://github.com/tianocore/tianocore.github.io/wiki/Tasks#Audio_Output_device_support
|
|
Re: [PATCH V12 00/47] Enable Intel TDX in OvmfPkg (Config-A)
Thanks Min Series: Reviewed-by: Jiewen Yao <Jiewen.yao@...>
toggle quoted messageShow quoted text
-----Original Message----- From: Xu, Min M <min.m.xu@...> Sent: Wednesday, March 30, 2022 7:46 AM To: devel@edk2.groups.io Cc: Xu, Min M <min.m.xu@...>; Brijesh Singh <brijesh.singh@...>; Dong, Eric <eric.dong@...>; Aktas, Erdem <erdemaktas@...>; Wu, Hao A <hao.a.wu@...>; Wang, Jian J <jian.j.wang@...>; James Bottomley <jejb@...>; Yao, Jiewen <jiewen.yao@...>; Gao, Liming <gaoliming@...>; Kinney, Michael D <michael.d.kinney@...>; Ni, Ray <ray.ni@...>; Kumar, Rahul1 <rahul1.kumar@...>; Tom Lendacky <thomas.lendacky@...>; Liu, Zhiguang <zhiguang.liu@...>; Gerd Hoffmann <kraxel@...> Subject: [PATCH V12 00/47] Enable Intel TDX in OvmfPkg (Config-A)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3249
Intel's Trust Domain Extensions (Intel TDX) refers to an Intel technology that extends Virtual Machines Extensions (VMX) and Multi-Key Total Memory Encryption (MKTME) with a new kind of virutal machines guest called a Trust Domain (TD). A TD is desinged to run in a CPU mode that protects the confidentiality of TD memory contents and the TD's CPU state from other software, including the hosting Virtual-Machine Monitor (VMM), unless explicitly shared by the TD itself.
There are 2 configurations for TDVF to upstream. See below link for the definitions of the 2 configurations. https://edk2.groups.io/g/devel/message/76367
This patch-set is to enable Config-A in OvmfPkg. - Merge the *basic* TDVF feature to existing OvmfX64Pkg.dsc. (Align with existing SEV) - Threat model: VMM is NOT out of TCB. (We don’t make things worse.) - The OvmfX64Pkg.dsc includes SEV/TDX/normal OVMF basic boot capability. The final binary can run on SEV/TDX/normal OVMF - No changes to existing OvmfPkgX64 image layout. - No need to add additional security features if they do not exist today - No need to remove features if they exist today. - RTMR is not supported - PEI phase is NOT skipped in either Td or Non-Td
Patch 01 - 33 are changes in SEC phase. Also some libraries in these patches are workable in SEC/PEI/DXE.
Patch 16 - 29 extract the common codes from OvmfPkg/PlatformPei to a new PlatformInitLib. After that OvmfPkg/PlatformPei is refactored with this lib. These 14 patches are currently reviewed in another separate patch-set. https://edk2.groups.io/g/devel/message/87327
Patch 34 - 39 are changes in PEI phase.
Patch 40 - 44 are changes in DXE phase.
Patch 45 - 47 are for local Apic timer DXE driver.
[TDX]: https://software.intel.com/content/dam/develop/external/us/en/ documents/tdx-whitepaper-final9-17.pdf
[TDX-Module]: https://software.intel.com/content/dam/develop/external/ us/en/documents/tdx-module-1.0-public-spec-v0.931.pdf
[TDVF]: https://software.intel.com/content/dam/develop/external/us/en/ documents/tdx-virtual-firmware-design-guide-rev-1.pdf
[GCHI]: https://software.intel.com/content/dam/develop/external/us/en/ documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426- 002.pdf
Code is at https://github.com/mxu9/edk2/tree/tdvf_wave2.v12
v12 changes: - Update MpInitLib based on the review feedbacks. Please see https://edk2.groups.io/g/devel/message/88173. - Update the code base to 2b4b8013fe45.
v11 changes: - Update MpInitlib based on the review comments. Please see https://edk2.groups.io/g/devel/message/88089 - Update the code base to 3ef2071927fa.
v10 changes: - Update MpInitLib based on the review comments. Please see the discussion: https://edk2.groups.io/g/devel/message/87902 - Update the code base to ec0b54849b23.
v9 changes: - Move the definition of EFI_RESOURCE_MEMORY_UNACCEPTED from MdePkg to OvmfPkg as in internal implementation. Because it has not been added in PI spec. After the definition is added in PI spec, it can be moved to MdePkg. - Add definition of new CPUID leaf 0x21 in MdePkg/Include/Register/Intel/Cpuid.h. - Use switch-case to hanle VC/VE handling together in CpuExceptionHandlerLib. - Refactor changes for Tdx guest in MpInitLib. - Refine the comments in BaseLib and PlatformInitLib. - Other minor updates and changes.
v8 changes: - Based on the comments of PlatformInitLib and OvmfPkg/PlatformPei, a separte patch-set is created for the changes. It is now under review https://edk2.groups.io/g/devel/message/87327 - Based on the comments, TdCall/TdVmCall/TdIsEnabled is wrapped with MDE_CPU_IA32 and MDE_CPU_X64. - EFI_RESOURCE_ATTRIBUTE_ENCRYPTED is removed based on the TDVF Spec update. Instead EFI_RESOURCE_MEMORY_UNACCEPTED is added to indicate the memory which to be accepted in TDVF. The corresponding logic of AcceptMemory is updated as well. Please see Patch 31. - PcdIa32EferChangeAllowed is deleted. Because for Td guest IA32_EFER.NXE is set by default. So we only need check whether it has been set before it is to be set again. See Patch 35. - Based on comments PcdTdxSharedBitMask is defined in [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] - Delete un-necessary header files in TdxLib.h. - Other minor updates and changes.
v7 changes: - Based on the comments from last review, 8 PlatformInitLib patches are squashed into 4 patches (#17-#20). These 4 patches are not related to Tdx guest. Tdx related codes of PlatformInitLib is in #21. - gUefiOvmfPkgTdxPlatformGuid is renamed as gUefiOvmfPkgPlatformInfoGuid. Because this GUID is used not only by Tdx guest, but also by Legacy guest. - PlatformInitLibNull is deleted. - In PlatformPei Pml4Entries is cap at 512 entries when mPhysMemAddressWidth > 48.
v7 not-addressed comments - Comments in MpInitLib have not been addressed yet. It will be addressed in the following version. - Thanks much for your understanding.
v6 changes: - PlatformInitLib and OvmfPkg/PlatformPei refactoring are covered in patch from 17 - 24. These patches are not related to Tdx guest. Tdx related codes of PlatformInitLib is in patch 25. - In the previous patch-sets, TdHob is processed in OvmfPkg/Sec/IntelTdx.c. Per Gerd's suggestion they are now moved to PlatformInitLib/IntelTdx.c. So that they can be reused in Config-B. - The default Accept page size is changed from 4K to 2M. - The BspAcceptMemoryResourceRange is refactored according to Gerd's comment. - In ApRunLoop.nasm command field is set to zero as acknowledgement. This is a fix based on the ACPI Spec v6.4,Sec titled "Multiprocessor Wakeup Structure".
v6 not-addressed comments - Comments in MpInitLib have not been addressed yet. It will be addressed in the following version. - Thanks much for your understanding.
v5 changes: - PlatformInitLib is introduced which wraps the common functions in OvmfPkg/PlatformPei. It is because there are a lot of duplicated codes for Platform initialization in PEI phase and there are at least 3 variants of PlatformPei. Another reason is that in TDVF Config-B PEI-less boot needs the similar initiliazation as PlatformPei. Based on the discussion with the community, PlatformInitLib is introduced. As the first stage OvmfPkg/PlatformPei is refactored with this lib. In the future the other 2 PlatformPei variants will be refactored as well. - PcdIgnoreVeHalt is deprecated. - Add spec link for Mailbox. - Other minor changes, such as comments, uncrustify formats, etc.
v5 not-addressed comments - Comments in MpInitLib have not been addressed yet. It will be addressed in the following version. - Some comments may be missed. I will re-visit the review emails. - Thanks much for your understanding.
v4 changes: - Split the TdxLib into 2 libraries. The TDX basic functions (TdCall / TdVmCall / TdIsEnabled) are moved to BaseLib (#2). The other functions are in TdxLib. (#3) - Based on above changes (TdCall/TdVmCall/TdIsEnabled in BaseLib) the TdxLib.inf is not necessary in some Pkgs, such as UefiPayloadPkg. The duplicated source code are deleted (BaseIoLib is the sample). - Drop the Accepting pages with TDX MP service. Instead only BSP accepts pages. There maybe boot performance issue. There are some mitigations to it, such as 2M accept page size, lazy accept, etc. We will re-visit this issue in a separate patch-set. - Relocate Mailbox in TdxDxe driver instead of in PlatformPei. This is to keep consistence with Config-B (PEI is skipped in Config-B). - SetMmioSharedBit in TdxDxe driver instead of in DxeIplPeim after CreateIdentityMappingPageTables. This is to keep consistence with Config-B (PEI is skipped in Config-B). - Some other minor changes, such as switch-case indention. - Rebase the code base (commit: 8c06c53b585a) and update the code with uncrustify.
v4 not-addressed comments: - Comments in MpInitLib have not been addressed yet. It will be addressed in the next version. - BaseMemEncryptTdxLib is suggested to be merged with BaseMemEncryptSevLib. It will be addressed in the next version. - Gerd suggests a generic page table walker which is able to set and clear bits for a given memory range in both SEV and TDX guest. This suggestion will be addressed in the next version. - Some comments may be missed. I will re-visit the review emails. - Thanks much for your understanding.
v3 changes: - LocalApicTimerDxe is split out to be a separate patch-series. - VmTdExitLibNull/VmgExitLib are removed. Instead the VmgExitLib is extended to handle #VE exception. (Patch 3-5) - Split the Tdx support of base IoLib into 4 commits. (Patch 6-9) - Alter of MADT table is updated. In previous version it was created from scratch. Now it gets the installed table, copy it to a larger buffer and append the ACPI_MADT_MPWK to it. (Patch 25) - Changes in BaseXApicX2ApicLib is refined based on the feedbacks. (Add spec link of MSR access definition, rename some funtion name, etc.) (Patch 11) - Use PcdConfidentialComputingGuestAttr to probe TDX guest instead of CPUID. But in some cases PcdConfidentialComputingGuestAttr cannot be used because it has not been set yet. - Some other minor changes.
v3 not-addressed comments: - Some of the comments have not been addressed. This is because I need more time to consider how to address these comments. At the same time I want to submit a new version based on the above changes so that community can review in a more efficient way. (v2 is the version one month ago). - Comments in MpInitLib have not been addressed yet. It will be addressed in v4. - BaseMemEncryptTdxLib should be merged with BaseMemEncryptSevLib. It will be addressed in v4. - Some comments may be missed. I will re-visit the review emails. - Thanks much for your understanding.
v2 changes: - Remove TdxProbeLib. It is to reduce the depencies of the lib. - In v1 a new function (AllocatePagesWithMemoryType) is added in PeiMemoryAllocationLib. This function is not necessary. It can be replaced by PeiServicesAllocatePages. - IoLibFifo.c is added in BaseIoLibIntrinsic. This file includes the functions of read/write of I/O port fifo. These functions will call TdIoReadFifo or SevIoReadFifo by checking TDX or SEV in run-time. - DXE related patches are added. (Patch 22-28) - Fix typo in commit/comment message, or some minor changes. - Rebase the edk2 code base. (4cc1458dbe00)
Cc: Brijesh Singh <brijesh.singh@...> Cc: Eric Dong <eric.dong@...> Cc: Erdem Aktas <erdemaktas@...> Cc: Hao A Wu <hao.a.wu@...> Cc: Jian J Wang <jian.j.wang@...> Cc: James Bottomley <jejb@...> Cc: Jiewen Yao <jiewen.yao@...> Cc: Liming Gao <gaoliming@...> Cc: Michael D Kinney <michael.d.kinney@...> Cc: Ray Ni <ray.ni@...> Cc: Rahul Kumar <rahul1.kumar@...> Cc: Tom Lendacky <thomas.lendacky@...> Cc: Zhiguang Liu <zhiguang.liu@...> Cc: Gerd Hoffmann <kraxel@...> Signed-off-by: Min Xu <min.m.xu@...>
Min Xu (47): MdePkg: Add Tdx.h MdePkg: Update Cpuid.h for Tdx MdePkg: Introduce basic Tdx functions in BaseLib MdePkg: Add TdxLib to wrap Tdx operations UefiCpuPkg: Extend VmgExitLibNull to handle #VE exception OvmfPkg: Extend VmgExitLib to handle #VE exception UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception MdePkg: Add helper functions for Tdx guest in BaseIoLibIntrinsic MdePkg: Support mmio for Tdx guest in BaseIoLibIntrinsic MdePkg: Support IoFifo for Tdx guest in BaseIoLibIntrinsic MdePkg: Support IoRead/IoWrite for Tdx guest in BaseIoLibIntrinsic UefiCpuPkg: Support TDX in BaseXApicX2ApicLib MdePkg: Add macro to check SEV / TDX guest UefiCpuPkg: Enable Tdx support in MpInitLib OvmfPkg: Add IntelTdx.h in OvmfPkg/Include/IndustryStandard OvmfPkg: Add TdxMailboxLib OvmfPkg: Create initial version of PlatformInitLib OvmfPkg/PlatformInitLib: Add hob functions OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob OvmfPkg/PlatformPei: Refactor MiscInitialization OvmfPkg/PlatformPei: Refactor MiscInitialization for CloudHV OvmfPkg/PlatformPei: Refactor AddressWidthInitialization OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization OvmfPkg/PlatformPei: Refactor QemuUc32BaseInitialization OvmfPkg/PlatformPei: Refactor InitializeRamRegions OvmfPkg/PlatformPei: Refactor MemMapInitialization OvmfPkg/PlatformPei: Refactor NoexecDxeInitialization OvmfPkg/PlatformPei: Refactor MiscInitialization OvmfPkg/PlatformInitLib: Create MemDetect.c OvmfPkg/PlatformInitLib: Move functions to Platform.c OvmfPkg: Update PlatformInitLib to process Tdx hoblist OvmfPkg/Sec: Declare local variable as volatile in SecCoreStartupWithStack OvmfPkg: Update Sec to support Tdx OvmfPkg: Check Tdx in QemuFwCfgPei to avoid DMA operation MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set MdeModulePkg: Add PcdTdxSharedBitMask UefiCpuPkg: Update AddressEncMask in CpuPageTable OvmfPkg: Update PlatformInitLib for Tdx guest OvmfPkg: Update PlatformPei to support Tdx guest OvmfPkg: Update AcpiPlatformDxe to alter MADT table OvmfPkg/BaseMemEncryptTdxLib: Add TDX helper library OvmfPkg: Add TdxDxe driver OvmfPkg/QemuFwCfgLib: Support Tdx in QemuFwCfgDxe OvmfPkg: Update IoMmuDxe to support TDX OvmfPkg: Rename XenTimerDxe to LocalApicTimerDxe UefiCpuPkg: Setting initial-count register as the last step OvmfPkg: Switch timer in build time for OvmfPkg
.../Core/DxeIplPeim/X64/VirtualMemory.c | 8 +- MdeModulePkg/MdeModulePkg.dec | 4 + .../Include/ConfidentialComputingGuestAttr.h | 3 + MdePkg/Include/IndustryStandard/Tdx.h | 203 ++++ MdePkg/Include/Library/BaseLib.h | 66 ++ MdePkg/Include/Library/TdxLib.h | 92 ++ MdePkg/Include/Register/Intel/Cpuid.h | 35 +- .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 2 + .../BaseIoLibIntrinsicSev.inf | 7 + MdePkg/Library/BaseIoLibIntrinsic/IoLib.c | 81 +- MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c | 217 ++++ MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 51 +- .../BaseIoLibIntrinsic/IoLibInternalTdx.c | 674 +++++++++++++ .../BaseIoLibIntrinsic/IoLibInternalTdxNull.c | 497 +++++++++ MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c | 73 +- MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h | 166 +++ MdePkg/Library/BaseIoLibIntrinsic/IoLibTdx.h | 410 ++++++++ .../BaseIoLibIntrinsic/X64/IoFifoSev.nasm | 34 +- MdePkg/Library/BaseLib/BaseLib.inf | 4 + MdePkg/Library/BaseLib/IntelTdxNull.c | 83 ++ MdePkg/Library/BaseLib/X64/TdCall.nasm | 85 ++ MdePkg/Library/BaseLib/X64/TdProbe.c | 63 ++ MdePkg/Library/BaseLib/X64/TdVmcall.nasm | 145 +++ MdePkg/Library/TdxLib/AcceptPages.c | 181 ++++ MdePkg/Library/TdxLib/Rtmr.c | 84 ++ MdePkg/Library/TdxLib/TdInfo.c | 115 +++ MdePkg/Library/TdxLib/TdxLib.inf | 37 + MdePkg/Library/TdxLib/TdxLibNull.c | 106 ++ MdePkg/MdePkg.dec | 3 + MdePkg/MdePkg.dsc | 1 + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 14 +- OvmfPkg/AmdSev/AmdSevX64.dsc | 11 +- OvmfPkg/AmdSev/AmdSevX64.fdf | 3 +- OvmfPkg/Bhyve/BhyveX64.dsc | 5 + OvmfPkg/CloudHv/CloudHvX64.dsc | 8 +- OvmfPkg/CloudHv/CloudHvX64.fdf | 2 +- OvmfPkg/Include/IndustryStandard/IntelTdx.h | 67 ++ OvmfPkg/Include/Library/MemEncryptTdxLib.h | 81 ++ OvmfPkg/Include/Library/PlatformInitLib.h | 237 +++++ OvmfPkg/Include/Library/TdxMailboxLib.h | 76 ++ .../Include/Protocol/QemuAcpiTableNotify.h | 27 + OvmfPkg/Include/TdxCommondefs.inc | 51 + OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 103 +- OvmfPkg/IoMmuDxe/AmdSevIoMmu.h | 6 +- OvmfPkg/IoMmuDxe/IoMmuDxe.c | 6 +- OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 5 + .../BaseMemEncryptTdxLib.inf | 44 + .../BaseMemEncryptTdxLibNull.inf | 35 + .../BaseMemoryEncryptionNull.c | 90 ++ .../BaseMemEncryptTdxLib/MemoryEncryption.c | 948 ++++++++++++++++++ .../BaseMemEncryptTdxLib/VirtualMemory.h | 181 ++++ .../PlatformInitLib}/Cmos.c | 32 +- OvmfPkg/Library/PlatformInitLib/IntelTdx.c | 563 +++++++++++ .../Library/PlatformInitLib/IntelTdxNull.c | 46 + OvmfPkg/Library/PlatformInitLib/MemDetect.c | 856 ++++++++++++++++ OvmfPkg/Library/PlatformInitLib/Platform.c | 573 +++++++++++ .../PlatformInitLib/PlatformInitLib.inf | 98 ++ OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c | 9 +- .../Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf | 1 + .../QemuFwCfgLib/QemuFwCfgLibInternal.h | 11 + OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c | 32 + .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf | 2 + OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c | 141 +++ .../Library/TdxMailboxLib/TdxMailboxLib.inf | 52 + .../Library/TdxMailboxLib/TdxMailboxNull.c | 85 ++ OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf | 3 +- OvmfPkg/Library/VmgExitLib/VmTdExitHandler.h | 32 + .../Library/VmgExitLib/VmTdExitVeHandler.c | 559 +++++++++++ OvmfPkg/Library/VmgExitLib/VmgExitLib.inf | 2 + .../Library/VmgExitLib/X64/TdVmcallCpuid.nasm | 146 +++ .../LocalApicTimerDxe.c} | 4 +- .../LocalApicTimerDxe.h} | 4 +- .../LocalApicTimerDxe.inf} | 7 +- OvmfPkg/Microvm/MicrovmX64.dsc | 8 +- OvmfPkg/Microvm/MicrovmX64.fdf | 2 +- OvmfPkg/OvmfPkg.dec | 17 + OvmfPkg/OvmfPkgIa32.dsc | 15 +- OvmfPkg/OvmfPkgIa32.fdf | 8 +- OvmfPkg/OvmfPkgIa32X64.dsc | 15 +- OvmfPkg/OvmfPkgIa32X64.fdf | 8 +- OvmfPkg/OvmfPkgX64.dsc | 32 +- OvmfPkg/OvmfPkgX64.fdf | 11 +- OvmfPkg/OvmfXen.dsc | 7 +- OvmfPkg/OvmfXen.fdf | 2 +- OvmfPkg/PlatformPei/AmdSev.c | 8 +- OvmfPkg/PlatformPei/Cmos.h | 48 - OvmfPkg/PlatformPei/FeatureControl.c | 7 +- OvmfPkg/PlatformPei/Fv.c | 4 +- OvmfPkg/PlatformPei/IntelTdx.c | 51 + OvmfPkg/PlatformPei/MemDetect.c | 889 ++-------------- OvmfPkg/PlatformPei/MemTypeInfo.c | 2 +- OvmfPkg/PlatformPei/Platform.c | 631 ++---------- OvmfPkg/PlatformPei/Platform.h | 97 +- OvmfPkg/PlatformPei/PlatformPei.inf | 6 +- OvmfPkg/Sec/SecMain.c | 44 +- OvmfPkg/Sec/SecMain.inf | 3 + OvmfPkg/Sec/X64/SecEntry.nasm | 82 ++ OvmfPkg/TdxDxe/TdxAcpiTable.c | 213 ++++ OvmfPkg/TdxDxe/TdxAcpiTable.h | 60 ++ OvmfPkg/TdxDxe/TdxDxe.c | 261 +++++ OvmfPkg/TdxDxe/TdxDxe.inf | 64 ++ OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 90 ++ UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 + UefiCpuPkg/CpuDxe/CpuPageTable.c | 3 + UefiCpuPkg/Include/Library/VmgExitLib.h | 28 + .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 170 +++- .../PeiDxeSmmCpuException.c | 53 +- .../SecPeiCpuException.c | 57 +- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 3 + UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h | 69 ++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 63 +- UefiCpuPkg/Library/MpInitLib/MpLibTdx.c | 106 ++ UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c | 69 ++ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 3 + .../Library/VmgExitLibNull/VmTdExitNull.c | 38 + .../Library/VmgExitLibNull/VmgExitLibNull.inf | 1 + 117 files changed, 10472 insertions(+), 1666 deletions(-) create mode 100644 MdePkg/Include/IndustryStandard/Tdx.h create mode 100644 MdePkg/Include/Library/TdxLib.h create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdxNull.c create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibTdx.h create mode 100644 MdePkg/Library/BaseLib/IntelTdxNull.c create mode 100644 MdePkg/Library/BaseLib/X64/TdCall.nasm create mode 100644 MdePkg/Library/BaseLib/X64/TdProbe.c create mode 100644 MdePkg/Library/BaseLib/X64/TdVmcall.nasm create mode 100644 MdePkg/Library/TdxLib/AcceptPages.c create mode 100644 MdePkg/Library/TdxLib/Rtmr.c create mode 100644 MdePkg/Library/TdxLib/TdInfo.c create mode 100644 MdePkg/Library/TdxLib/TdxLib.inf create mode 100644 MdePkg/Library/TdxLib/TdxLibNull.c create mode 100644 OvmfPkg/Include/IndustryStandard/IntelTdx.h create mode 100644 OvmfPkg/Include/Library/MemEncryptTdxLib.h create mode 100644 OvmfPkg/Include/Library/PlatformInitLib.h create mode 100644 OvmfPkg/Include/Library/TdxMailboxLib.h create mode 100644 OvmfPkg/Include/Protocol/QemuAcpiTableNotify.h create mode 100644 OvmfPkg/Include/TdxCommondefs.inc create mode 100644 OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTdxLib.inf create mode 100644 OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTdxLibNull.inf create mode 100644 OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemoryEncryptionNull.c create mode 100644 OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c create mode 100644 OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h rename OvmfPkg/{PlatformPei => Library/PlatformInitLib}/Cmos.c (61%) create mode 100644 OvmfPkg/Library/PlatformInitLib/IntelTdx.c create mode 100644 OvmfPkg/Library/PlatformInitLib/IntelTdxNull.c create mode 100644 OvmfPkg/Library/PlatformInitLib/MemDetect.c create mode 100644 OvmfPkg/Library/PlatformInitLib/Platform.c create mode 100644 OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf create mode 100644 OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c create mode 100644 OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf create mode 100644 OvmfPkg/Library/TdxMailboxLib/TdxMailboxNull.c create mode 100644 OvmfPkg/Library/VmgExitLib/VmTdExitHandler.h create mode 100644 OvmfPkg/Library/VmgExitLib/VmTdExitVeHandler.c create mode 100644 OvmfPkg/Library/VmgExitLib/X64/TdVmcallCpuid.nasm rename OvmfPkg/{XenTimerDxe/XenTimerDxe.c => LocalApicTimerDxe/LocalApicTimerDxe.c} (95%) rename OvmfPkg/{XenTimerDxe/XenTimerDxe.h => LocalApicTimerDxe/LocalApicTimerDxe.h} (96%) rename OvmfPkg/{XenTimerDxe/XenTimerDxe.inf => LocalApicTimerDxe/LocalApicTimerDxe.inf} (80%) delete mode 100644 OvmfPkg/PlatformPei/Cmos.h create mode 100644 OvmfPkg/PlatformPei/IntelTdx.c create mode 100644 OvmfPkg/TdxDxe/TdxAcpiTable.c create mode 100644 OvmfPkg/TdxDxe/TdxAcpiTable.h create mode 100644 OvmfPkg/TdxDxe/TdxDxe.c create mode 100644 OvmfPkg/TdxDxe/TdxDxe.inf create mode 100644 OvmfPkg/TdxDxe/X64/ApRunLoop.nasm create mode 100644 UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h create mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdx.c create mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c create mode 100644 UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c
-- 2.29.2.windows.2
|
|
Re: [PATCH v2 1/1] Basetools: fix gcc workaround
Since the gcc12 has the incompatible change from GCC5.4, I'd also suggest we could create a new TOOL CHAIN for gcc12. The error reports I collected show in gcc5.4 , "-Wno-error=stringop-overflow" is an unrecognized command line option which is available in gcc12.
Thanks, Christine (Yuwei)
toggle quoted messageShow quoted text
-----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yuwei Chen Sent: Thursday, March 31, 2022 8:51 AM To: Gerd Hoffmann <kraxel@...>; devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...>; Gao, Liming <gaoliming@...> Subject: Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Hi Hoffmann,
I received some reports that some platforms are using gcc5.4. With this patch, these platform builds are still broken. Would you like to revert the original commits?
Thanks, Christine (Yuwei)
-----Original Message----- From: Gerd Hoffmann <kraxel@...> Sent: Tuesday, March 29, 2022 4:38 PM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...>; Chen, Christine <yuwei.chen@...>;
Gao, Liming <gaoliming@...>; Gerd Hoffmann <kraxel@...> Subject: [PATCH v2 1/1] Basetools: fix gcc workaround
Apply the workaround only in case the compiler is gcc. Fixes builds with clang.
Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning") Reported-by: Rebecca Cran <rebecca@...> Signed-off-by: Gerd Hoffmann <kraxel@...> --- BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile index b05d2bddfa68..6323e7355cc8 100644 --- a/BaseTools/Source/C/DevicePath/GNUmakefile +++ b/BaseTools/Source/C/DevicePath/GNUmakefile @@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
+ifneq ($(CXX), llvm) # gcc 12 trips over device path handling BUILD_CFLAGS += -Wno- error=stringop-overflow +endif
LIBS = -lCommon ifeq ($(CYGWIN), CYGWIN) -- 2.35.1
|
|
回复: [edk2-devel] [PATCH v1 00/41] Add PrmPkg
Acked-by: Liming Gao <gaoliming@...> -----邮件原件----- 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sinha, Ankit 发送时间: 2022年3月30日 0:29 收件人: devel@edk2.groups.io; mikuback@... 抄送: Andrew Fish <afish@...>; Gao, Kang <kang.gao@...>; Kinney, Michael D <michael.d.kinney@...>; Kubacki, Michael <michael.kubacki@...>; Leif Lindholm <leif@...>; You, Benjamin <benjamin.you@...>; Liu, Yun Y <yun.y.liu@...>; Desimone, Nathaniel L <nathaniel.l.desimone@...> 主题: Re: [edk2-devel] [PATCH v1 00/41] Add PrmPkg
Reviewed-by: Ankit Sinha <ankit.sinha@...>
-----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki Sent: Tuesday, March 22, 2022 9:19 AM To: devel@edk2.groups.io Cc: Andrew Fish <afish@...>; Gao, Kang <kang.gao@...>; Kinney, Michael D <michael.d.kinney@...>; Kubacki, Michael <michael.kubacki@...>; Leif Lindholm <leif@...>; You,
Benjamin <benjamin.you@...>; Liu, Yun Y <yun.y.liu@...>; Sinha, Ankit <ankit.sinha@...>; Desimone, Nathaniel L <nathaniel.l.desimone@...> Subject: [edk2-devel] [PATCH v1 00/41] Add PrmPkg
From: Michael Kubacki <michael.kubacki@...>
This patch series adds a new package called PrmPkg. An RFC was sent to the edk2 mailing list on January 28, 2022 detailing the proposal, see https://edk2.groups.io/g/devel/message/86181.
Platform Runtime Mechanism (PRM) is a new firmware solution that has been developed in edk2-staging/PlatformRuntimeMechanism.
This patch series has been organized to greatly condense the history
from the edk2-staging branch but to preserve important decisions and changes
in history that help establish context of changes and will serve as
valuable references for future development.
Interest in PRM has increased across various vendors and we believe it
is beneficial to make the source code more widely available for the
following reasons:
1. PRM specification adoption 2. Feature completeness 3. Overall validation coverage 4. Interest from the community and future collaboration
The technical details of PRM are covered in the PRM Specification in addition
to the Readme.md file located in the root of PrmPkg in this patch
series. 1. PRM specification adoption
Intel and Microsoft have worked together to standardize PRM in the ACPI Specification and the PRM Specification hosted on uefi.org.
* ACPI 6.4 Specification: https://uefi.org/node/4149
* PRM Specification:
https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mec hanism%20-%20with%20legal%20notice.pdf
2. Feature completeness
PrmPkg implements the full firmware functionality described in the PRM Specification and there are no significant changes to functionality
planned at this time.
Though we are very much interested in evolving PRM based on feedback.
3. Overall validation coverage
PrmPkg has been integrated and tested on client and server systems in addition to virtual platforms (OvmfPkg/QEMU).
Platform integration is simple and a demonstration of this integration
for OvmfPkg is available in the following branch: https://github.com/makubacki/edk2/tree/ovmf_prmpkg_integration
The code has been built with: * MSFT VS2015, VS2017, and VS2019 * GCC5 (see https://bugzilla.tianocore.org/show_bug.cgi?id=3802) * iASL compiler (20200528 - https://acpica.org/node/181)
The Linux kernel currently includes the following PRM support: * _OSC PRM bit - allows FW to know determine the OS is PRM-capable and can redirect _DSM method from alternate triggers (such as SMI) to PRM. * PRM invocation via _DSM, includes PRM module and handler parsing from ACPI PRMT table, and also the PRM operation region handler for runtime PRM service invocation. * An OS configuration for PRM enabling, PRM support can be disabled during OS image build.
Note that upstream Linux does not currently support the following: * Ability for the OS driver to call a PRM handler directly, it has to be via ACPI _DSM. * Run time update PRM module and handler via PE/COFF PRM image.
This commit provides additional context of the changes in Linux:
https://github.com/torvalds/linux/commit/cefc7ca46235f01d5233e3abd4b79
452af01d9e9
Windows 11 (https://www.microsoft.com/software-download/windows11) and Windows Server 2022 (https://docs.microsoft.com/en-us/windows- hardware/drivers/download-the-wdk) include the PRM functionality noted above in addition to PRM direct call
and PRM runtime updates.
PRM has been tested on IA32, X64, and AARCH64 targets.
4. Interest from the community and future collaboration
PRM has been presented at several industry conferences:
* OSFC 2020 - "PRM: SMM Goes on a Diet" https://cfp.osfc.io/osfc2020/talk/MCJASB/
* OCP Summit 2019 - "Case Study Alternatives for SMM Usage in Intel Platforms" https://www.youtube.com/watch?v=mu3DRLM1dPA
In addition, Microsoft plans to publish the Windows PRM driver interface and
a WDF sample driver that uses the interface to the Windows Driver
Samples GitHub repository (https://github.com/microsoft/Windows-driver-samples).
We believe a PrmPkg in edk2 can increase accessibility to PRM and ease collaboration.
PrmPkg ------ PrmPkg contains the common functionality needed to enable PRM on any system. It does not contain platform-specific code such as PRM modules (and
by extension PRM handlers). Other than sample modules, PrmPkg will only contain code needed to provide PRM feature functionality as defined in
the PRM Specification.
PrmPkg is scoped to continue to only contain platform-agnostic
functionality in the future.
The proposed maintainers of PrmPkg are: * Michael Kubacki <mikuback@...> * Nate DeSimone <nathaniel.l.desimone@...>
The proposed reviewers of PrmPkg are: * Ankit Sinha <ankit.sinha@...>
Cc: Andrew Fish <afish@...> Cc: Kang Gao <kang.gao@...> Cc: Michael D Kinney <michael.d.kinney@...> Cc: Michael Kubacki <michael.kubacki@...> Cc: Leif Lindholm <leif@...> Cc: Benjamin You <benjamin.you@...> Cc: Liu Yun <yun.y.liu@...> Cc: Ankit Sinha <ankit.sinha@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Signed-off-by: Michael Kubacki <michael.kubacki@...>
Liu (2): PrmPkg: Publish PRM operation region to support PRM ACPI _DSM invocation PrmPkg: Export major/minor version in PRM module PE COFF header
Liu Yun Y (1): PrmPkg: Update PRM OpRegion
Michael Kubacki (38): PrmPkg: Add package and include headers PrmPkg: Add PrmConfig protocol interface PrmPkg/PrmContextBufferLib: Add initial library instance PrmPkg/PrmConfigDxe: Add initial driver PrmPkg: Add initial PrmSamplePrintModule PrmPkg: Add initial PrmSampleMemoryAllocationModule PrmPkg: Add initial PrmSampleHardwareAccessModule PrmPkg: Add initial PrmSampleContextBufferModule PrmPkg: Add initial package DSC file Readme.md: Add initial content PrmPkg: Add ALLOCATE_CONTEXT_BUFFER_IN_FW build option PrmPkg: Enable variable growth for the PRM_MODULE_EXPORT macro PrmPkg: Add initial PrmSsdtInstallDxe module PrmPkg: Remove PRM Module Update Lock PrmPkg: Remove ALLOCATE_CONTEXT_BUFFER_IN_FW build flag PrmPkg/PrmContextBuffer.h: Add ACPI parameter support structures PrmPkg/PrmLoaderDxe: Add ACPI parameter buffer support PrmPkg/PrmSampleContextBufferModule: Remove OS debug print requirement PrmPkg/PrmSampleHardwareAccessModule: Add non-print PRM handlers
PrmPkg/SampleAcpiParameterBufferModule: Add initial module PrmPkg/HardwareAccessModuleConfigLib: Add initial library PrmPkg/Samples/Readme.md: Add initial file PrmPkg: Refactor some PrmLoaderDxe functionality into libraries PrmPkg/Application/PrmInfo: Add initial application PrmPkg: Enforce stricter types PrmPkg/Test/PrmPkgHostTest.dsc: Add initial file PrmPkg/Test/UnitTest/Library: Add initial UEFI Boot Services test lib PrmPkg/Library/DxePrmContextBufferLib: Add host-based unit tests PrmPkg/DxePrmModuleDiscoveryLib: Add initial host-based unit tests PrmPkg: Add PlatformGuid Readme.md: Add iASL note and QEMU sample link PrmPkg: Replace PcdPrmPlatformGuid with EDKII_DSC_PLATFORM_GUID
PrmPkg/Samples: Remove PrmSampleMemoryAllocationModule PrmPkg/Samples: Remove PrmSamplePrintModule PrmPkg: Remove the concept of OS services Readme.md: Add a link to PRM Specification PrmPkg: Changes for edk2 repo transition PrmPkg: Apply uncrustify changes
PrmPkg/Application/PrmInfo/PrmInfo.c | 732 +++++++++ PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c | 199 +++
PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLi bUnitTest.c | 649 ++++++++ PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
| 386 +++++
PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDisco veryLibUnitTest.c | 210 +++
PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c | 417 +++++ PrmPkg/PrmConfigDxe/PrmConfigDxe.c | 512 ++++++ PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c | 377 +++++ PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c | 110 ++
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/Library/DxeAcpiP
arameterBufferModuleConfigLib/DxeAcpiParameterBufferModuleConfigLib. c | 127 ++
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiP arameterBufferModule.c | 78 +
PrmPkg/Samples/PrmSampleContextBufferModule/Library/DxeContextBuff erModuleConfigLib/DxeContextBufferModuleConfigLib.c | 218
+++
PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBuff erModule.c | 84 +
PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardware
AccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c |
108 ++
PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardware AccessModule.c | 335 ++++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.c | 119 ++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestEventTimer.c | 180 +++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestImage.c | 163 ++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestMemory.c | 145 ++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestMisc.c | 198 +++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestProtocol.c | 1650
++++++++++++++++++++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestTpl.c | 43 +
.azurepipelines/templates/pr-gate-build-job.yml | 2 +- .pytool/CISettings.py | 1 + Maintainers.txt | 8 + PrmPkg/Application/PrmInfo/PrmInfo.h | 49 + PrmPkg/Application/PrmInfo/PrmInfo.inf | 66 + PrmPkg/Application/PrmInfo/PrmInfo.uni | 11 + PrmPkg/Application/PrmInfo/PrmInfoExtra.uni | 12 + PrmPkg/Application/PrmInfo/PrmInfoStrings.uni | 132 ++ PrmPkg/Include/Library/PrmContextBufferLib.h | 99 ++ PrmPkg/Include/Library/PrmModuleDiscoveryLib.h | 60 + PrmPkg/Include/Library/PrmPeCoffLib.h | 111 ++ PrmPkg/Include/Prm.h | 46 + PrmPkg/Include/PrmContextBuffer.h | 171 ++ PrmPkg/Include/PrmDataBuffer.h | 50 + PrmPkg/Include/PrmExportDescriptor.h | 109 ++ PrmPkg/Include/PrmMmio.h | 45 + PrmPkg/Include/PrmModule.h | 47 + PrmPkg/Include/PrmModuleImageContext.h | 28 + PrmPkg/Include/Protocol/PrmConfig.h | 31 + PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.inf | 35 +
PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLi bUnitTestHost.inf | 46 +
PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.in f | 41 +
PrmPkg/Library/DxePrmModuleDiscoveryLib/PrmModuleDiscovery.h | 39 +
PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDisco veryLibUnitTestHost.inf | 39 +
PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.inf | 32 + PrmPkg/PrmConfigDxe/PrmConfigDxe.inf | 48 + PrmPkg/PrmLoaderDxe/PrmAcpiTable.h | 96 ++ PrmPkg/PrmLoaderDxe/PrmLoaderDxe.inf | 61 + PrmPkg/PrmPkg.ci.yaml | 110 ++ PrmPkg/PrmPkg.dec | 67 + PrmPkg/PrmPkg.dsc | 142 ++ PrmPkg/PrmPkg.uni | 10 + PrmPkg/PrmSsdtInstallDxe/Prm.asl | 115 ++ PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.inf | 52 + PrmPkg/Readme.md | 264 ++++
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/Library/DxeAcpiP
arameterBufferModuleConfigLib/DxeAcpiParameterBufferModuleConfigLib. inf | 39 +
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiP arameterBufferModule.inf | 41 +
PrmPkg/Samples/PrmSampleContextBufferModule/Include/StaticData.h | 24 +
PrmPkg/Samples/PrmSampleContextBufferModule/Library/DxeContextBuff erModuleConfigLib/DxeContextBufferModuleConfigLib.inf | 39 +
PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBuff erModule.inf | 44 +
PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h | 108 ++
PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardware
AccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.inf |
39 +
PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardware AccessModule.inf | 43 +
PrmPkg/Samples/Readme.md | 146 ++ PrmPkg/Test/PrmPkgHostTest.dsc | 39 +
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibTest.uni | 12 +
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.h | 1042 ++++++++++++
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.inf | 46 +
PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestProtocol.h | 120 ++
71 files changed, 11096 insertions(+), 1 deletion(-) create mode
100644 PrmPkg/Application/PrmInfo/PrmInfo.c create mode 100644 PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c create mode 100644 PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLi bUnitTest.c create mode 100644 PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c create mode 100644 PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDisco veryLibUnitTest.c create mode 100644 PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
create mode 100644 PrmPkg/PrmConfigDxe/PrmConfigDxe.c create mode 100644 PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c create mode 100644 PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c create mode 100644
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/Library/DxeAcpiP
arameterBufferModuleConfigLib/DxeAcpiParameterBufferModuleConfigLib. c create mode 100644 PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiP arameterBufferModule.c create mode 100644 PrmPkg/Samples/PrmSampleContextBufferModule/Library/DxeContextBuff erModuleConfigLib/DxeContextBufferModuleConfigLib.c create mode 100644 PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBuff erModule.c create mode 100644
PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardware
AccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c create mode 100644 PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardware AccessModule.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestEventTimer.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestImage.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestMemory.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestMisc.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestProtocol.c create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestTpl.c create mode 100644 PrmPkg/Application/PrmInfo/PrmInfo.h create mode 100644 PrmPkg/Application/PrmInfo/PrmInfo.inf create mode 100644 PrmPkg/Application/PrmInfo/PrmInfo.uni create mode 100644 PrmPkg/Application/PrmInfo/PrmInfoExtra.uni create mode 100644 PrmPkg/Application/PrmInfo/PrmInfoStrings.uni create mode 100644 PrmPkg/Include/Library/PrmContextBufferLib.h create mode 100644 PrmPkg/Include/Library/PrmModuleDiscoveryLib.h create mode 100644 PrmPkg/Include/Library/PrmPeCoffLib.h create mode 100644 PrmPkg/Include/Prm.h create mode 100644 PrmPkg/Include/PrmContextBuffer.h create mode 100644 PrmPkg/Include/PrmDataBuffer.h create mode 100644 PrmPkg/Include/PrmExportDescriptor.h create mode 100644 PrmPkg/Include/PrmMmio.h create mode 100644 PrmPkg/Include/PrmModule.h create mode 100644 PrmPkg/Include/PrmModuleImageContext.h create mode 100644 PrmPkg/Include/Protocol/PrmConfig.h create mode 100644 PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.inf create mode 100644 PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLi bUnitTestHost.inf create mode 100644 PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.in f create mode 100644 PrmPkg/Library/DxePrmModuleDiscoveryLib/PrmModuleDiscovery.h create mode 100644 PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDisco veryLibUnitTestHost.inf create mode 100644 PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.inf create mode 100644 PrmPkg/PrmConfigDxe/PrmConfigDxe.inf create mode 100644 PrmPkg/PrmLoaderDxe/PrmAcpiTable.h create mode 100644 PrmPkg/PrmLoaderDxe/PrmLoaderDxe.inf create mode 100644 PrmPkg/PrmPkg.ci.yaml create mode 100644 PrmPkg/PrmPkg.dec create mode 100644 PrmPkg/PrmPkg.dsc create mode
100644 PrmPkg/PrmPkg.uni create mode 100644 PrmPkg/PrmSsdtInstallDxe/Prm.asl create mode 100644 PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.inf create mode 100644 PrmPkg/Readme.md create mode 100644
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/Library/DxeAcpiP
arameterBufferModuleConfigLib/DxeAcpiParameterBufferModuleConfigLib. inf create mode 100644 PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiP arameterBufferModule.inf create mode 100644 PrmPkg/Samples/PrmSampleContextBufferModule/Include/StaticData.h create mode 100644 PrmPkg/Samples/PrmSampleContextBufferModule/Library/DxeContextBuff erModuleConfigLib/DxeContextBufferModuleConfigLib.inf create mode 100644 PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBuff erModule.inf create mode 100644 PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h create mode 100644
PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardware
AccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.inf create mode 100644 PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardware AccessModule.inf create mode 100644 PrmPkg/Samples/Readme.md create mode 100644
PrmPkg/Test/PrmPkgHostTest.dsc create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibTest.uni create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.h create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTest.inf create mode 100644 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootS ervicesTableLibUnitTestProtocol.h
-- 2.28.0.windows.1
-=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87842): https://edk2.groups.io/g/devel/message/87842
Mute This Topic: https://groups.io/mt/89955942/1772825 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [ankit.sinha@...]
-=-=-=-=-=-=
|
|
回复: [edk2-devel] [PATCH v1 00/15] Merge UefiCpuLib to CpuLib
The change in MdePkg is good to me. Reviewed-by: Liming Gao <gaoliming@...>
toggle quoted messageShow quoted text
-----邮件原件----- 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Yu Pu 发送时间: 2022年3月29日 14:37 收件人: devel@edk2.groups.io 抄送: Yu Pu <yu.pu@...> 主题: [edk2-devel] [PATCH v1 00/15] Merge UefiCpuLib to CpuLib
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3394
Today lots of duplicated code call CPUID and calculates the address
mask. Adding an API named GetPhysicalAddressBits in UefiCpuLib can
solve this problem, but at the same time cause MdeModulePkg depend
on UefiCpuPkg which does not meet the design spec. So merge UefiCpuLib
to CpuLib is a good way to sovle these problems. To minimize the impact,
this operation is divided into four steps.
Yu Pu (15): IntelFsp2Pkg: Add CpuLib to module INFs that depend on UefiCpuLib IntelFsp2WrapperPkg: Add CpuLib to module INFs that depend on UefiCpuLib. MdePkg: Add CpuLib to module INFs that depend on UefiCpuLib. OvmfPkg: Add CpuLib to module INFs that depend on UefiCpuLib. UefiCpuPkg: Add CpuLib to module INFs that depend on UefiCpuLib. UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib. MdePkg: Move API and implementation from UefiCpuLib to CpuLib UefiCpuPkg: Move API and implementation from UefiCpuLib to CpuLib IntelFsp2Pkg: Remove UefiCpuLib from module INFs. OvmfPkg: Remove UefiCpuLib from module INFs. PcAtChipsetPkg: Remove UefiCpuLib from module INFs. SourceLevelDebugPkg: Remove UefiCpuLib from module INFs. UefiCpuPkg: Remove UefiCpuLib from module INFs. UefiPayloadPkg: Remove UefiCpuLib from module INFs. UefiCpuLib: Remove UefiCpuLib.
MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c | 122 ++++++++++++++++++++ OvmfPkg/Sec/SecMain.c | 2 +- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c | 81 ------------- UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c | 2 +- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 2 +- IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf | 2 +- IntelFsp2Pkg/FspSecCore/SecMain.h | 2 +- IntelFsp2Pkg/IntelFsp2Pkg.dsc | 1 - IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 1 - IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf | 2 +- IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf | 2 +- IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 - MdePkg/Include/Library/CpuLib.h | 65 +++++++++++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 6 + {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/Ia32/InitializeFpu.nasm | 0 {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/X64/InitializeFpu.nasm | 0 MdePkg/MdeLibs.dsc.inc | 1 + OvmfPkg/AmdSev/AmdSevX64.dsc | 1 - OvmfPkg/Bhyve/BhyveX64.dsc | 1 - OvmfPkg/CloudHv/CloudHvX64.dsc | 1 - OvmfPkg/Microvm/MicrovmX64.dsc | 1 - OvmfPkg/OvmfPkgIa32.dsc | 1 - OvmfPkg/OvmfPkgIa32X64.dsc | 1 - OvmfPkg/OvmfPkgX64.dsc | 1 - OvmfPkg/OvmfXen.dsc | 1 - OvmfPkg/Sec/SecMain.inf | 2 +- PcAtChipsetPkg/PcAtChipsetPkg.dsc | 1 - SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 1 - UefiCpuPkg/CpuDxe/CpuDxe.h | 1 - UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 - UefiCpuPkg/Include/Library/UefiCpuLib.h | 65 ----------- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf | 41 ------- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.uni | 16 --- UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf | 2 +- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 - UefiCpuPkg/Library/MpInitLib/MpLib.h | 1 - UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h | 1 - UefiCpuPkg/SecCore/SecCore.inf | 2 +- UefiCpuPkg/SecCore/SecCoreNative.inf | 2 +- UefiCpuPkg/SecCore/SecMain.h | 2 +- UefiCpuPkg/UefiCpuPkg.dec | 5 - UefiCpuPkg/UefiCpuPkg.dsc | 2 - UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h | 2 +- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf | 2 +- UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 2 +- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 - 50 files changed, 211 insertions(+), 248 deletions(-) create mode 100644 MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c rename {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/Ia32/InitializeFpu.nasm (100%) rename {UefiCpuPkg/Library/BaseUefiCpuLib => MdePkg/Library/BaseCpuLib}/X64/InitializeFpu.nasm (100%) delete mode 100644 UefiCpuPkg/Include/Library/UefiCpuLib.h delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf delete mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.uni
-- 2.30.0.windows.2
-=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88187): https://edk2.groups.io/g/devel/message/88187 Mute This Topic: https://groups.io/mt/90116960/4905953 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [gaoliming@...] -=-=-=-=-=-=
|
|
Re: [PATCH v2 1/1] Basetools: fix gcc workaround
Hi Hoffmann,
I received some reports that some platforms are using gcc5.4. With this patch, these platform builds are still broken. Would you like to revert the original commits?
Thanks, Christine (Yuwei)
toggle quoted messageShow quoted text
-----Original Message----- From: Gerd Hoffmann <kraxel@...> Sent: Tuesday, March 29, 2022 4:38 PM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran <rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver Steffen <osteffen@...>; Chen, Christine <yuwei.chen@...>; Gao, Liming <gaoliming@...>; Gerd Hoffmann <kraxel@...> Subject: [PATCH v2 1/1] Basetools: fix gcc workaround
Apply the workaround only in case the compiler is gcc. Fixes builds with clang.
Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning") Reported-by: Rebecca Cran <rebecca@...> Signed-off-by: Gerd Hoffmann <kraxel@...> --- BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile index b05d2bddfa68..6323e7355cc8 100644 --- a/BaseTools/Source/C/DevicePath/GNUmakefile +++ b/BaseTools/Source/C/DevicePath/GNUmakefile @@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
+ifneq ($(CXX), llvm) # gcc 12 trips over device path handling BUILD_CFLAGS += -Wno- error=stringop-overflow +endif
LIBS = -lCommon ifeq ($(CYGWIN), CYGWIN) -- 2.35.1
|
|
[Patch V3 2/2] UefiPayloadPkg: Consume the new added DebugPrintErrorLevelLib instance
Change the DebugPrintErrorLevelLib instance in UefiPayloadPkg.dsc to allow bootloader to config DebugPrintErrorLevel.
Cc: Guo Dong <guo.dong@...> Cc: Ray Ni <ray.ni@...> Cc: Maurice Ma <maurice.ma@...> Cc: Benjamin You <benjamin.you@...> Cc: Sean Rhodes <sean@...>
Signed-off-by: Yuanhao Xie <yuanhao.xie@...> --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index 14a8d157a2..49563e3d87 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -239,7 +239,7 @@ # # Misc # - DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + DebugPrintErrorLevelLib|UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf !if $(SOURCE_DEBUG_ENABLE) == TRUE PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf -- 2.30.0.windows.1
|
|
[Patch V3 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance
It consumes the HOB defined in UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader to config DebugPrintErrorLevel.
Cc: Guo Dong <guo.dong@...> Cc: Ray Ni <ray.ni@...> Cc: Maurice Ma <maurice.ma@...> Cc: Benjamin You <benjamin.you@...> Cc: Sean Rhodes <sean@...>
Signed-off-by: Yuanhao Xie <yuanhao.xie@...> --- UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h | 31 +++++++++++++++++++++++++++++++ UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf | 39 +++++++++++++++++++++++++++++++++++++++ UefiPayloadPkg/UefiPayloadPkg.dec | 2 +- 4 files changed, 148 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h new file mode 100644 index 0000000000..5bc84039db --- /dev/null +++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h @@ -0,0 +1,31 @@ +/** @file + Define the structure for Debug Print Error Level Guid Hob. + +Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_ +#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_ + +#include <Uefi.h> +#include <UniversalPayload/UniversalPayload.h> + +#pragma pack (1) +// +// ErrorLevel: The error level of the debug message. +// Bits for ErrorLevel is declared in +// edk2\MdePkg\Include\Library\DebugLib.h +// +typedef struct { + UNIVERSAL_PAYLOAD_GENERIC_HEADER Header; + UINT32 ErrorLevel; +} UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL; + +#pragma pack() + +#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION 1 + +extern GUID gEdkiiDebugPrintErrorLevelGuid; +#endif diff --git a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c new file mode 100644 index 0000000000..a098aef10d --- /dev/null +++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c @@ -0,0 +1,77 @@ +/** @file + Debug Print Error Level library instance that retrieves + the DebugPrintErrorLevel from bootloader. + + Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Base.h> +#include <Uefi.h> +#include <PiDxe.h> +#include <Library/PcdLib.h> +#include <Library/HobLib.h> +#include <Guid/DebugPrintErrorLevel.h> +#include <Library/DebugPrintErrorLevelLib.h> +#include <UniversalPayload/UniversalPayload.h> + +STATIC UINT32 gDebugPrintErrorLevel; +STATIC BOOLEAN gDebugPrintErrorLevelInitialized = FALSE; +/** + Returns the debug print error level mask for the current module. + + @return Debug print error level mask for the current module. + +**/ +UINT32 +EFIAPI +GetDebugPrintErrorLevel ( + VOID + ) +{ + VOID *GuidHob; + UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader; + UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *DebugPrintErrorLevel; + + if (!gDebugPrintErrorLevelInitialized) { + gDebugPrintErrorLevelInitialized = TRUE; + gDebugPrintErrorLevel = PcdGet32(PcdDebugPrintErrorLevel); + GuidHob = GetFirstGuidHob (&gEdkiiDebugPrintErrorLevelGuid); + if (GuidHob != NULL) { + GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA (GuidHob); + if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) < GET_GUID_HOB_DATA_SIZE (GuidHob)) + && (GenericHeader->Length <= GET_GUID_HOB_DATA_SIZE (GuidHob))) { + if (GenericHeader->Revision == UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) { + DebugPrintErrorLevel = (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *)GET_GUID_HOB_DATA (GuidHob); + if (DebugPrintErrorLevel->Header.Length > UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, ErrorLevel)) { + gDebugPrintErrorLevel = DebugPrintErrorLevel->ErrorLevel; + } + } + } + } + } + return gDebugPrintErrorLevel; +} + +/** + Sets the global debug print error level mask fpr the entire platform. + + @param ErrorLevel Global debug print error level. + + @retval TRUE The debug print error level mask was sucessfully set. + @retval FALSE The debug print error level mask could not be set. + +**/ +BOOLEAN +EFIAPI +SetDebugPrintErrorLevel ( + UINT32 ErrorLevel + ) +{ + // + // This library uinstance does not support setting the global debug print error + // level mask. + // + return FALSE; +} diff --git a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf new file mode 100644 index 0000000000..0845b5a2f4 --- /dev/null +++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf @@ -0,0 +1,39 @@ +## @file +# Debug Print Error Level library instance that retrieves +# the DebugPrintErrorLevel from bootloader. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DebugPrintErrorLevelLibHob + FILE_GUID = c3fead6d-bd4c-4131-bd5f-4bbceecc0fef + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = DebugPrintErrorLevelLib + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + DebugPrintErrorLevelLibHob.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiPayloadPkg/UefiPayloadPkg.dec + +[LibraryClasses] + PcdLib + HobLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel + +[Guids] + gEdkiiDebugPrintErrorLevelGuid diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec index 4051172caf..5c1aeb8235 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -31,7 +31,7 @@ ##include/Guid/BootManagerMenu.h gEdkiiBootManagerMenuFileGuid = { 0xdf939333, 0x42fc, 0x4b2a, { 0xa5, 0x9e, 0xbb, 0xae, 0x82, 0x81, 0xfe, 0xef }} - + gEdkiiDebugPrintErrorLevelGuid = { 0xad82f436, 0x75c5, 0x4aa9, { 0x92, 0x93, 0xc5, 0x55, 0x0a, 0x7f, 0xf9, 0x71 }} gUefiAcpiBoardInfoGuid = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}} gUefiSerialPortInfoGuid = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 0x8d, 0x62, 0xde, 0x87, 0xf1 } } gLoaderMemoryMapInfoGuid = { 0xa1ff7424, 0x7a1a, 0x478e, { 0xa9, 0xe4, 0x92, 0xf3, 0x57, 0xd1, 0x28, 0x32 } } -- 2.30.0.windows.1
|
|
Re: [Patch V2 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance
This patch has both UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL and UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL. Please double check this patch if it could pass build.
Thanks, Guo
toggle quoted messageShow quoted text
-----Original Message----- From: Xie, Yuanhao <yuanhao.xie@...> Sent: Wednesday, March 30, 2022 2:17 AM To: devel@edk2.groups.io Cc: Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Maurice Ma <maurice.ma@...>; You, Benjamin <benjamin.you@...>; Rhodes, Sean <sean@...> Subject: [Patch V2 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance
It consumes the HOB defined in UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader to config DebugPrintErrorLevel.
Cc: Guo Dong <guo.dong@...> Cc: Ray Ni <ray.ni@...> Cc: Maurice Ma <maurice.ma@...> Cc: Benjamin You <benjamin.you@...> Cc: Sean Rhodes <sean@...>
Signed-off-by: Yuanhao Xie <yuanhao.xie@...> --- UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h | 31 +++++++++++++++++++++++++++++++ UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf | 39 +++++++++++++++++++++++++++++++++++++++ UefiPayloadPkg/UefiPayloadPkg.dec | 2 +- 4 files changed, 148 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h new file mode 100644 index 0000000000..5bc84039db --- /dev/null +++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h @@ -0,0 +1,31 @@ +/** @file + Define the structure for Debug Print Error Level Guid Hob. + +Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_ +#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_ + +#include <Uefi.h> +#include <UniversalPayload/UniversalPayload.h> + +#pragma pack (1) +// +// ErrorLevel: The error level of the debug message. +// Bits for ErrorLevel is declared in +// edk2\MdePkg\Include\Library\DebugLib.h +// +typedef struct { + UNIVERSAL_PAYLOAD_GENERIC_HEADER Header; + UINT32 ErrorLevel; +} UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL; + +#pragma pack() + +#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION 1 + +extern GUID gEdkiiDebugPrintErrorLevelGuid; #endif diff --git a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c new file mode 100644 index 0000000000..7f087e5c06 --- /dev/null +++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL +++ evelLibHob.c @@ -0,0 +1,77 @@ +/** @file + Debug Print Error Level library instance that retrieves + the DebugPrintErrorLevel from bootloader. + + Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Base.h> +#include <Uefi.h> +#include <PiDxe.h> +#include <Library/PcdLib.h> +#include <Library/HobLib.h> +#include <Guid/DebugPrintErrorLevel.h> +#include <Library/DebugPrintErrorLevelLib.h> +#include <UniversalPayload/UniversalPayload.h> + +STATIC UINT32 gDebugPrintErrorLevel; +STATIC BOOLEAN gDebugPrintErrorLevelInitialized = FALSE; +/** + Returns the debug print error level mask for the current module. + + @return Debug print error level mask for the current module. + +**/ +UINT32 +EFIAPI +GetDebugPrintErrorLevel ( + VOID + ) +{ + VOID *GuidHob; + UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader; + UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *DebugPrintErrorLevel; + + if (!gDebugPrintErrorLevelInitialized) { + gDebugPrintErrorLevelInitialized = TRUE; + gDebugPrintErrorLevel = PcdGet32(PcdDebugPrintErrorLevel); + GuidHob = GetFirstGuidHob (&gEdkiiDebugPrintErrorLevelGuid); + if (GuidHob != NULL) { + GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA (GuidHob); + if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) < GET_GUID_HOB_DATA_SIZE (GuidHob)) + && (GenericHeader->Length <= GET_GUID_HOB_DATA_SIZE (GuidHob))) { + if (GenericHeader->Revision == UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) { + DebugPrintErrorLevel = (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *)GET_GUID_HOB_DATA (GuidHob); + if (DebugPrintErrorLevel->Header.Length > UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, ErrorLevel)) { + gDebugPrintErrorLevel = DebugPrintErrorLevel->ErrorLevel; + } + } + } + } + } + return gDebugPrintErrorLevel; +} + +/** + Sets the global debug print error level mask fpr the entire platform. + + @param ErrorLevel Global debug print error level. + + @retval TRUE The debug print error level mask was sucessfully set. + @retval FALSE The debug print error level mask could not be set. + +**/ +BOOLEAN +EFIAPI +SetDebugPrintErrorLevel ( + UINT32 ErrorLevel + ) +{ + // + // This library uinstance does not support setting the global debug +print error + // level mask. + // + return FALSE; +} diff --git a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf new file mode 100644 index 0000000000..0845b5a2f4 --- /dev/null +++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL +++ evelLibHob.inf @@ -0,0 +1,39 @@ +## @file +# Debug Print Error Level library instance that retrieves # the +DebugPrintErrorLevel from bootloader. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> # # +SPDX-License-Identifier: BSD-2-Clause-Patent # ## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DebugPrintErrorLevelLibHob + FILE_GUID = c3fead6d-bd4c-4131-bd5f-4bbceecc0fef + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = DebugPrintErrorLevelLib + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + DebugPrintErrorLevelLibHob.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiPayloadPkg/UefiPayloadPkg.dec + +[LibraryClasses] + PcdLib + HobLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel + +[Guids] + gEdkiiDebugPrintErrorLevelGuid diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec index 4051172caf..5c1aeb8235 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -31,7 +31,7 @@ ##include/Guid/BootManagerMenu.h gEdkiiBootManagerMenuFileGuid = { 0xdf939333, 0x42fc, 0x4b2a, { 0xa5, 0x9e, 0xbb, 0xae, 0x82, 0x81, 0xfe, 0xef }} - + gEdkiiDebugPrintErrorLevelGuid = { 0xad82f436, 0x75c5, 0x4aa9, { + 0x92, 0x93, 0xc5, 0x55, 0x0a, 0x7f, 0xf9, 0x71 }} gUefiAcpiBoardInfoGuid = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}} gUefiSerialPortInfoGuid = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 0x8d, 0x62, 0xde, 0x87, 0xf1 } } gLoaderMemoryMapInfoGuid = { 0xa1ff7424, 0x7a1a, 0x478e, { 0xa9, 0xe4, 0x92, 0xf3, 0x57, 0xd1, 0x28, 0x32 } } -- 2.30.0.windows.1
|
|
Re: [PATCH 1/2] UefiPayloadPkg: Fix PciHostBridgeLib
Reviewed-by: Guo Dong <guo.dong@...>
toggle quoted messageShow quoted text
-----Original Message----- From: Sean Rhodes <sean@...> Sent: Wednesday, March 30, 2022 11:29 AM To: devel@edk2.groups.io Cc: Tan, Lean Sheng <sheng.tan@...>; Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma, Maurice <maurice.ma@...>; You, Benjamin <benjamin.you@...>; Rhodes, Sean <sean@...>; Patrick Rudolph <patrick.rudolph@...> Subject: [PATCH 1/2] UefiPayloadPkg: Fix PciHostBridgeLib
From: Lean Sheng Tan <sheng.tan@...>
Don't assume a 64bit register always holds an address greater than 4GB. Check the value in the register and decide which Aperature it should be assigned to.
Fixes assertion "ASSERT [PciHostBridgeDxe] Bridge->MemAbove4G.Base >= 0x0000000100000000ULL".
Tested with coreboot as bootloader on platforms that have PCI resource above 4GiB and on platforms that don't have resource above 4GiB.
Cc: Guo Dong <guo.dong@...> Cc: Ray Ni <ray.ni@...> Cc: Maurice Ma <maurice.ma@...> Cc: Benjamin You <benjamin.you@...> Cc: Sean Rhodes <sean@...> Signed-off-by: Patrick Rudolph <patrick.rudolph@...> --- .../Library/PciHostBridgeLib/PciHostBridgeSupport.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c index 8a890b6b53..e1faa24ae7 100644 --- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c +++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c @@ -354,14 +354,19 @@ ScanForRootBridges ( Base = ((UINT32)Pci.Bridge.PrefetchableMemoryBase & 0xfff0) << 16; Limit = (((UINT32)Pci.Bridge.PrefetchableMemoryLimit & 0xfff0) << 16) | 0xfffff;- MemAperture = &Mem;+ if (Value == BIT0) {- Base |= LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32);- Limit |= LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32);- MemAperture = &MemAbove4G;+ Base |= LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32);+ Limit |= LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32); } if ((Base > 0) && (Base < Limit)) {+ if (Base < BASE_4GB) {+ MemAperture = &Mem;+ } else {+ MemAperture = &MemAbove4G;+ }+ if (MemAperture->Base > Base) { MemAperture->Base = Base; }-- 2.32.0
|
|
Does anyone know why the measured boot log seems to be recording the hash of PEIFV wrongly?
When I do a measured boot of OVMF, I get a load of records including the two EV_EFI_PLATFORM_FIRMWARE_BLOB events, which, according to the code in Tcg2Pei.c are supposed to be measuring PEIFV and DXEFV from the uncompressed MEMFD. However, when I compare the hashes against the build artifacts, the DXEFV matches, so is correctly measured. However the PEIFV doesn't match ... it's like something modified the contents before the Tcg2Pei.c measurement is taken.
Does anyone know what this modification to PEIFV is? My next step would be to go digging in the PEIFV at the time of measurement to see if I can find the change, but I figured that asking first might be a lot less work ...
Thanks,
James
|
|
Re: [GSoC 2022] How to begin contributing?
Marvin Häuser <mhaeuser@...>
toggle quoted messageShow quoted text
On 18.03.22 00:21, Tejesh Anand wrote: Hello all, My name is Tejesh Anand, a first year computer engineering student. I'm interested applying for the task of writing more unit tests for edk2. I wanted to ask if anyone had any advice for a first issue to begin to contribute with?
Thanks in advance!
|
|
Re: [PATCH 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation
On 30/03/2022 22:35, Brijesh Singh wrote:
On 3/30/22 14:31, Dov Murik wrote:
On 30/03/2022 22:27, Brijesh Singh wrote:
On 3/30/22 01:04, Dov Murik wrote:
On 30/03/2022 8:20, Gerd Hoffmann wrote:
Hi,
Check if that page is defined; if it is, skip it in the metadata list. In such case, VMM should fill the page with the hashes content, or explicitly update it as a zero page (if kernel hashes are not used). Is it an option to just skip the page unconditionally?
I think in the OvmfPkgX64 build the page is not used, so it probably doesn't matter whenever it is included or not, and it would make things a bit less confusing ...
Brijesh,
What would happen if we change this:
%define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)
to:
%define SNP_SEC_MEM_BASE_DESC_3 (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase))
in OvmfPkg/ResetVector/ResetVector.nasmb ?
It means that the page starting at MEMFD_BASE_ADDRESS+0x00F000 (that is, the page that follows the SNP CPUID page) will not be pre-validated by QEMU.
Lets look at the OvmfPkgX64.fdf is
...
0x00E000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize
0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
0x020000|0x0E0000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
...
If you change SNP_SEC_MEM_BASE_DESC_3 to start from PcdOvmfPeiMemFvBase then who will validate the range for PcdOvmfSecPeiTempRamBase - PcdOvmfPeiMemFvBase ? The SEC phase (Sec/X64/SecEntry.nasm) uses the PcdOvmfSecPeiTempRamBase. If the memory is not validated prior to use then it will result in #VC (page-not-validated) and crash the guest BIOS boot.
Gerd actually wants to change SNP_SEC_MEM_BASE_DESC_3 to start from PcdOvmfSecPeiTempRamBase, which is 0x010000.
Supposedly no one uses the single page at 0x00F000 . Yes, that should be alright as long as the SNP_SEC_MEM_BASE_DESC_3 start from PcdOvmfSecPeiTempRamBase. In PEI phase, we validate all the unvalidated range. So, as long as SEC phase is not using 800F000 - 8010000 we should be good. The PEI will validate that page.
How does the PEI phase know that this page in the middle is still unvalidated? I see this code: STATIC SNP_PRE_VALIDATED_RANGE mPreValidatedRange[] = { // The below address range was part of the SEV OVMF metadata, and range // should be pre-validated by the Hypervisor. { FixedPcdGet32 (PcdOvmfSecPageTablesBase), FixedPcdGet32 (PcdOvmfPeiMemFvBase), }, // The below range is pre-validated by the Sec/SecMain.c { FixedPcdGet32 (PcdOvmfSecValidatedStart), FixedPcdGet32 (PcdOvmfSecValidatedEnd) }, }; As the comment says, it assumes the entire range from PcdOvmfSecPageTablesBase (= 0x800000) to PcdOvmfPeiMemFvBase (= 0x820000) is pre-validated by the Hypervisor. How will it know to actually validate that page at 0x80F000 ? -Dov
|
|
Re: [PATCH 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation
On 3/30/22 14:31, Dov Murik wrote: On 30/03/2022 22:27, Brijesh Singh wrote:
On 3/30/22 01:04, Dov Murik wrote:
On 30/03/2022 8:20, Gerd Hoffmann wrote:
Hi,
Check if that page is defined; if it is, skip it in the metadata list. In such case, VMM should fill the page with the hashes content, or explicitly update it as a zero page (if kernel hashes are not used). Is it an option to just skip the page unconditionally?
I think in the OvmfPkgX64 build the page is not used, so it probably doesn't matter whenever it is included or not, and it would make things a bit less confusing ...
Brijesh,
What would happen if we change this:
%define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)
to:
%define SNP_SEC_MEM_BASE_DESC_3 (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase))
in OvmfPkg/ResetVector/ResetVector.nasmb ?
It means that the page starting at MEMFD_BASE_ADDRESS+0x00F000 (that is, the page that follows the SNP CPUID page) will not be pre-validated by QEMU.
Lets look at the OvmfPkgX64.fdf is
...
0x00E000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize
0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
0x020000|0x0E0000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
...
If you change SNP_SEC_MEM_BASE_DESC_3 to start from PcdOvmfPeiMemFvBase then who will validate the range for PcdOvmfSecPeiTempRamBase - PcdOvmfPeiMemFvBase ? The SEC phase (Sec/X64/SecEntry.nasm) uses the PcdOvmfSecPeiTempRamBase. If the memory is not validated prior to use then it will result in #VC (page-not-validated) and crash the guest BIOS boot.
Gerd actually wants to change SNP_SEC_MEM_BASE_DESC_3 to start from PcdOvmfSecPeiTempRamBase, which is 0x010000. Supposedly no one uses the single page at 0x00F000 . Yes, that should be alright as long as the SNP_SEC_MEM_BASE_DESC_3 start from PcdOvmfSecPeiTempRamBase. In PEI phase, we validate all the unvalidated range. So, as long as SEC phase is not using 800F000 - 8010000 we should be good. The PEI will validate that page. thanks
|
|