[edk2-devel] [PATCH 1/1] OvmfPkg/BhyveBhfPkg: add support for QemuFwCfg

2022-03-28 Thread Corvin Köhne
From: Corvin Köhne QemuFwCfg is much more powerful than BhyveFwCtl. Sadly, BhyveFwCtl decided to use the same IO ports as QemuFwCfg. It's not possible to use both interfaces simultaneously. So, prefer QemuFwCfg over BhyveFwCtl. Signed-off-by: Corvin Köhne CC: Ard Biesheuvel CC: Jiewen Yao CC

[edk2-devel] [PATCH 0/1] OvmfPkg/Bhyve: QemuFwCfg support

2022-03-28 Thread Corvin Köhne
Hi, I'm going to add QemuFwCfg support to bhyve. See https://reviews.freebsd.org/D31578. Therefore, this patch for OVMF is neccessary to work properly. There's one open point on that patch and hopefully one of you has more insights. Qemu has an item called FW_CFG_MAX_CPUS. It looks very similar

Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

2022-03-28 Thread Yuanhao Xie
Hi Guo, Sorry for the late response. Just as we discussed today, and also from the suggestions by Ray, in the new patch I will 1. changed "UNIVERSAL_PAYLOAD_ DEBUG_PRINT_ERROR_LEVEL" to "UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL", and 2. add a comment referencing Debuglib.h to declare bits for "Er

[edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

[edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

[edk2-devel] [PATCH v1 1/1] OvmfPkg: Add dependency of VariableSmm driver to make it work normally.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3861 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

Re: [edk2-devel] 回复: [PATCH v1 01/28] MdeModulePkg: Add a new GUID

2022-03-28 Thread Yao, Jiewen
Agree with Jian. I don’t understand this patch set and the feature. I request a design review in EDKII. Thank you Yao Jiewen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wang, Jian > J > Sent: Tuesday, March 29, 2022 2:12 PM > To: devel@edk2.groups.io; Gao, Liming ; Va

Re: [edk2-devel] 回复: [PATCH v1 01/28] MdeModulePkg: Add a new GUID

2022-03-28 Thread Wang, Jian J
Hi Judah, You could update the readme in edk2-staging or your own forked branch. Here's an example in edk2-staging repo: https://github.com/tianocore/edk2-staging/tree/ProtectedVariable/libs BTW, I didn't find the cover letter patch (the file with name starting with ). Please don't skip it

Re: [edk2-devel] [PATCH v1 02/28] SecurityPkg: Add new GUIDs

2022-03-28 Thread Wang, Jian J
Hi Judah, The commit message is too simple to be useful for reviewers and developers. Other patches have the same issue. Please add more descriptions to explain the changes made in each patch (why and how). Regards, Jian > -Original Message- > From: Vang, Judah > Sent: Saturday, March 2

[edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

[edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

[edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-03-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882 UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. VariableSmm driver need use SmmCpuRendezvousLi

Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-28 Thread Bob Feng
Hi Gerd, Could you provide a patch to fix this issue or revert the original commit? Thanks, Bob -Original Message- From: Rebecca Cran Sent: Tuesday, March 29, 2022 5:30 AM To: devel@edk2.groups.io; kra...@redhat.com Cc: Pawel Polawski ; Gao, Liming ; Chen, Christine ; Oliver Steffen

Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

2022-03-28 Thread Guo Dong
I replied in another email. It looks the comments are not addressed in this patch, especially on this comment: In the DebugPrintErrorLevel.h, ErrorLevel is defined as UINT32, but its usage is not clear for bootloaders ( so need add more info in the header file) Thanks, Guo -Original Messag

Re: [edk2-devel] [PATCH v1 01/28] MdeModulePkg: Add a new GUID

2022-03-28 Thread Wang, Jian J
Reviewed-by: Jian J Wang Regards, Jian > -Original Message- > From: Vang, Judah > Sent: Saturday, March 26, 2022 6:03 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Gao, Liming > ; Mistry, Nishant C > Subject: [PATCH v1 01/28] MdeModulePkg: Add a new GUID > > REF: https://bugzilla

Re: [edk2-devel] [PATCH v2 14/17] Silicon/Ampere: Update ArmPlatformLib to work with changed ARM_CORE_INFO

2022-03-28 Thread Nhi Pham via groups.io
On 27/03/2022 05:00, Leif Lindholm wrote: On Sat, Mar 26, 2022 at 16:12:07 +0700, Nhi Pham via groups.io wrote: Would you be happy for me to fold that into "AmpereAltraPkg, JadePkg: Add ACPI support", or would you be able to submit a v6 of that patch only? Best Regards, Leif Thanks much for t

Re: [edk2-devel] [PATCH] bRefClkFreq UFS card attribute need to be programmed after fDeviceInit

2022-03-28 Thread Wu, Hao A
Pushed via: PR - https://github.com/tianocore/edk2/pull/2701 Commit - https://github.com/tianocore/edk2/commit/7456990e8eebe3b935447253bb6d1d3129839122 Best Regards, Hao Wu > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, Hao A > Sent: Monday, March 28, 2022 8:30 AM >

[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - 03/29/2022 #cal-reminder

2022-03-28 Thread devel@edk2.groups.io Calendar
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Groups.io Inc//Groups.io Calendar//EN METHOD:PUBLISH REFRESH-INTERVAL;VALUE=DURATION:PT1H X-PUBLISHED-TTL:PT1H CALSCALE:GREGORIAN BEGIN:VTIMEZONE TZID:America/Los_Angeles LAST-MODIFIED:20220317T223602Z TZURL:http://tzurl.org/zoneinfo-outlook/America/Los_Angeles

[edk2-devel] Now: Tools, CI, Code base construction meeting series - 03/28/2022 #cal-notice

2022-03-28 Thread devel@edk2.groups.io Calendar
*Tools, CI, Code base construction meeting series* *When:* 03/28/2022 4:30pm to 5:30pm (UTC-07:00) America/Los Angeles *Where:* https://github.com/tianocore/edk2/discussions/2614 View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1463509 ) *Description:* TianoCore community, Micros

Re: 回复: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: PiSmmCore: Inspect memory guarded with pool headers

2022-03-28 Thread Kun Qin
Thanks, Liming. SMM owners/authors, Could you please also review the original issue and this patch to provide feedback? Thanks, Kun On 3/17/2022 6:20 PM, gaoliming wrote: Reviewed-by: Liming Gao -邮件原件- 发件人: devel@edk2.groups.io 代表 Kun Qin 发送时间: 2022年3月16日 12:00 收件人: devel@edk2.g

Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-28 Thread Rebecca Cran
This breaks building BaseTools with clang 13.1.6 on macOS: /Applications/Xcode.app/Contents/Developer/usr/bin/make -C DevicePath gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/AArch64/ -MD -fshort-wchar -fno-strict-alias

[edk2-devel] [PATCH 1/2] OvmfPkg/AmdSev: Reorder MEMFD pages to match the order in OvmfPkgX64.fdf

2022-03-28 Thread Dov Murik
Reorder the pages in the MEMFD section of AmdSevX64.fdf so that it matches the same order used in OvmfPkgX64.fdf. After this change, this is the difference in the MEMFD of the two targets: $ diff -u \ <(sed -ne '/FD.MEMFD/,/FV.SECFV/p' OvmfPkg/OvmfPkgX64.fdf) \ <(sed -ne '/FD.MEMFD/

[edk2-devel] [PATCH 0/2] OvmfPkg: Enable measured direct boot on AMD SEV-SNP

2022-03-28 Thread Dov Murik
AMD SEV and SEV-ES support measured direct boot with kernel/initrd/cmdline hashes injected by QEMU and verified by OVMF during boot. To enable the same approach for AMD SEV-SNP we make sure the page in which QEMU inserts the hashes of kernel/initrd/cmdline is not already pre-validated, as SNP does

[edk2-devel] [PATCH 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation

2022-03-28 Thread Dov Murik
In order to allow the VMM (such as QEMU) to add a page with hashes of kernel/initrd/cmdline for measured direct boot on SNP, this page must not be part of the SNP metadata list reported to the VMM. Check if that page is defined; if it is, skip it in the metadata list. In such case, VMM should fill

Re: [edk2-devel] Question about UEFI, AddressSanitizer and MMU mappings

2022-03-28 Thread Pedro Falcato
Hi Steven! Good to know you already have something. I removed your LLVM Optimizations suggestion that was about MPX, as Intel MPX is pretty dead (Intel is dropping it, compilers don't support it) as far as I know, and added a new suggestion for UBSan, ASAN, and possibly MSAN ( https://github.com/t

Re: 回复: [edk2-devel] [PATCH v1 00/41] Add PrmPkg

2022-03-28 Thread Michael Kubacki
Hi Liming, I updated Maintainers.txt in patch [40/41]. https://edk2.groups.io/g/devel/message/87882 Due to the email limit on the mailing list the last few patches had to be sent shortly after the initial series. Regards, Michael On 3/28/2022 4:48 AM, gaoliming wrote: Michael: Please als

[edk2-devel] [PATCH] Fix Setup numeric default value incorrect issue

2022-03-28 Thread Chen Lin Z
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

Re: [edk2-devel] Question about UEFI, AddressSanitizer and MMU mappings

2022-03-28 Thread Steven Shi
We enabled Asan and UBsan on edk2 DXE in 2017 after we introduced the CLANG38 build toolchain in edk2. It was quite useful to find dozens of code bugs. It is not difficult as it sounds, but we never finished all the scope, e.g., PEI, SMM. There are many limitations in current implementation, e.g

[edk2-devel] 回复: [PATCH v1 01/28] MdeModulePkg: Add a new GUID

2022-03-28 Thread gaoliming
Judah: Is there the detail information or wiki about the code design and usage for this feature? Thanks Liming > -邮件原件- > 发件人: Judah Vang > 发送时间: 2022年3月26日 6:03 > 收件人: devel@edk2.groups.io > 抄送: Jian J Wang ; Liming Gao > ; Nishant C Mistry > 主题: [PATCH v1 01/28] MdeModulePkg: Add a

回复: [edk2-devel] [PATCH v1 00/41] Add PrmPkg

2022-03-28 Thread gaoliming
Michael: Please also update Maintainers.txt to specify maintainer for new PrmPkg. Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io 代表 Michael > Kubacki > 发送时间: 2022年3月23日 0:19 > 收件人: devel@edk2.groups.io > 抄送: Andrew Fish ; Kang Gao ; > Michael D Kinney ; Michael Kubacki > ; Leif Lin

回复: [edk2-devel] [PATCH v1 00/17] *** SUBJECT HERE ***

2022-03-28 Thread gaoliming
Yu: Please submit one feature BZ to record this change. Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io 代表 Yu Pu > 发送时间: 2022年3月23日 19:48 > 收件人: devel@edk2.groups.io > 抄送: Yu Pu > 主题: [edk2-devel] [PATCH v1 00/17] *** SUBJECT HERE *** > > *** BLURB HERE *** > > Yu Pu (17): > Int

Re: [edk2-devel] [PATCH V11 14/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-28 Thread Ni, Ray
+ CopyMem (ProcessorInfoBuffer, &gTdxProcessorInformation, sizeof (EFI_PROCESSOR_INFORMATION)); Min, You may not directly copy the whole structure to ProcessorInfoBuffer. Because per the structure definition(below), ExtendedInformation is only filled when CPU_V2_EXTENDED_TOPOLOGY is set in Pro

[edk2-devel] [PATCH V11 39/47] OvmfPkg: Update PlatformPei to support Tdx guest

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 OvmfPkg/PlatformPei is updated to support Tdx guest. There are below major changes. - Set Tdx related PCDs - Publish Tdx RamRegions In this patch there is another new function BuildPlatformInfoHob (). This function builds EFI_HOB_PLATFORM

[edk2-devel] [PATCH V11 38/47] OvmfPkg: Update PlatformInitLib for Tdx guest

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 There are below changes in PlatformInitLib for Tdx guest: 1. Publish ram regions In Tdx guest, the system memory is passed in TdHob by host VMM. So the major task of PlatformTdxPublishRamRegions is to walk thru the TdHob list and transfer t

[edk2-devel] [PATCH V11 37/47] UefiCpuPkg: Update AddressEncMask in CpuPageTable

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 MMIO region in Tdx guest is set with PcdTdxSharedBitMask in TdxDxe's entry point. In SEV guest the page table entries is set with PcdPteMemoryEncryptionAddressOrMask when creating 1:1 identity table. So the AddressEncMask in GetPageTableEnt

[edk2-devel] [PATCH V11 36/47] MdeModulePkg: Add PcdTdxSharedBitMask

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Guest Physical Address (GPA) space in Td guest is divided into private and shared sub-spaces, determined by the SHARED bit of GPA. This PCD holds the shared bit mask. Its default value is 0 and it will be set in PlatformPei driver if it is o

[edk2-devel] [PATCH V11 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 If IA32_ERER.NXE has already been set, skip setting it again. Cc: Jian J Wang Cc: Hao A Wu Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Acked-by: Gerd Hoffmann Reviewed-by:

[edk2-devel] [PATCH V11 34/47] OvmfPkg: Check Tdx in QemuFwCfgPei to avoid DMA operation

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 If TDX is enabled then we do not support DMA operation in PEI phase. This is mainly because DMA in TDX guest requires using bounce buffer (which need to allocate dynamic memory and allocating a PAGE size'd buffer can be challenge in PEI phas

[edk2-devel] [PATCH V11 33/47] OvmfPkg: Update Sec to support Tdx

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 There are below major changes in this commit. 1. SecEntry.nasm In TDX BSP and APs goes to the same entry point in SecEntry.nasm. BSP initialize the temporary stack and then jumps to SecMain, just as legacy Ovmf does. APs spin in a modifie

[edk2-devel] [PATCH V11 32/47] OvmfPkg/Sec: Declare local variable as volatile in SecCoreStartupWithStack

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Declare the local variables in SecCoreStartupWithStack that actually move the data elements as volatile to prevent the optimizer from replacing this function with the intrinsic memcpy(). Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Si

[edk2-devel] [PATCH V11 31/47] OvmfPkg: Update PlatformInitLib to process Tdx hoblist

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 When host VMM create the Td guest, the system memory informations are stored in TdHob, which is a memory region described in Tdx metadata. The system memory region in TdHob should be accepted before it can be accessed. So the newly added fun

[edk2-devel] [PATCH V11 30/47] OvmfPkg/PlatformInitLib: Move functions to Platform.c

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 Move functions in PlatformPei/Platform.c to PlatformInitLib/Platform.c. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: Sebastien Boeuf

[edk2-devel] [PATCH V11 28/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 MiscInitialization is split into 2 functions: - PlatformMiscInitialization is for PlatformInitLib. - MiscInitialization calls PlatformMiscInitialization and then sets PCD. It is for PlatformPei. Cc: Ard Biesheuvel Cc: Jordan Justen Cc

[edk2-devel] [PATCH V11 27/47] OvmfPkg/PlatformPei: Refactor NoexecDxeInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 NoexecDxeInitialization is split into 2 functions: - PlatformNoexecDxeInitialization is for PlatformInitLib - NoexecDxeInitialization calls PlatformNoexecDxeInitialization and then sets PCD. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Br

[edk2-devel] [PATCH V11 26/47] OvmfPkg/PlatformPei: Refactor MemMapInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 MemMapInitialization is split into 2 functions: - PlatformMemMapInitialization is for PlatformInfoLib - MemMapInitialization calls PlatformMemMapInitialization and then sets PCDs. It is for PlatformPei. Cc: Ard Biesheuvel Cc: Jordan Ju

[edk2-devel] [PATCH V11 25/47] OvmfPkg/PlatformPei: Refactor InitializeRamRegions

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 InitializeRamRegions is refactored into 3 calls: - PlatformQemuInitializeRam - SevInitializeRam - PlatformQemuInitializeRamForS3 SevInitializeRam is not in PlatformInitLib. Because in the first stage PlatformInitLib only support the basic

[edk2-devel] [PATCH V11 24/47] OvmfPkg/PlatformPei: Refactor QemuUc32BaseInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 Rename QemuUc32BaseInitialization to PlatformQemuUc32BaseInitialization. This function is for PlatformInitLib. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky

[edk2-devel] [PATCH V11 23/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 MaxCpuCountInitialization is splitted into two: - PlatformMaxCpuCountInitialization is for PlatformInitLib - MaxCpuCountInitialization is for PlatformPei. It calls PlatformMaxCpuCountInitialization then sets PCDs. Cc: Ard Biesheuvel Cc

[edk2-devel] [PATCH V11 22/47] OvmfPkg/PlatformPei: Refactor AddressWidthInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 >From this patch we start to restruct the functions which set PCDs into two, one for PlatformInitLib, one for PlatformPei. AddressWidthInitialization is the first one. It is splitted into two: - PlatformAddressWidthInitialization is for Pla

[edk2-devel] [PATCH V11 20/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 In MiscInitialization Microvm looks a little weird. Other platforms call PcdSet16S to set the PcdOvmfHostBridgePciDevId with the value same as PlatformInfoHob->HostBridgeDevId. But Microvm doesn't follow this way. In switch-case 0x is Mic

[edk2-devel] [PATCH V11 21/47] OvmfPkg/PlatformPei: Refactor MiscInitialization for CloudHV

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 Refactor MiscInitialization for CloudHV to set PCD as other platforms do. Because in the following patch we will split the functions which set PCDs into two, one for PlatformInitLib, one for PlatformPei. Cc: Ard Biesheuvel Cc: Jordan Justen

[edk2-devel] [PATCH V11 19/47] OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 The intention of PlatformInitLib is to extract the common function used in OvmfPkg/PlatformPei. This lib will be used not only in PEI phase but also in SEC phase. SEC phase cannot use global variables between different functions. So PlatformI

[edk2-devel] [PATCH V11 18/47] OvmfPkg/PlatformInitLib: Add hob functions

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 In this patch of PlatformInitLib, below hob functions are introduced: - PlatformAddIoMemoryBaseSizeHob - PlatformAddIoMemoryRangeHob - PlatformAddMemoryBaseSizeHob - PlatformAddMemoryRangeHob - PlatformAddReservedMemoryBaseSizeHob They

[edk2-devel] [PATCH V11 17/47] OvmfPkg: Create initial version of PlatformInitLib

2022-03-28 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 There are 3 variants of PlatformPei in OvmfPkg: - OvmfPkg/PlatformPei - OvmfPkg/XenPlatformPei - OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf These PlatformPeis can share many common codes, such as Cmos / Hob / Memory / Platform related funct

[edk2-devel] [PATCH V11 15/47] OvmfPkg: Add IntelTdx.h in OvmfPkg/Include/IndustryStandard

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 IntelTdx.h defines the defition used by TDX in OvmfPkg: - Mailbox related defitions,such as the data structure, command code, AP relocation defitions. See Table 5.44 Multiprocessor Wakeup Mailbox Structure in below link. https://uefi.or

[edk2-devel] [PATCH V11 16/47] OvmfPkg: Add TdxMailboxLib

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 In Tdx BSP may issues commands to APs for some task, for example, to accept pages paralelly. BSP also need to wait until all the APs have done the task. TdxMailboxLib wraps these common funtions for BSP. Cc: Ard Biesheuvel Cc: Jordan Juste

[edk2-devel] [PATCH V11 14/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 In TDVF BSP and APs are simplified. BSP is the vCPU-0, while the others are treated as APs. So MP intialization is rather simple. The processor info is retrieved by TDCALL, ApWorker is not supported, BSP is always the working processor, whi

[edk2-devel] [PATCH V11 13/47] MdePkg: Add macro to check SEV / TDX guest

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Add macros CC_GUEST_IS_SEV / CC_GUEST_IS_TDX to check SEV / TDX guest. Cc: Michael Roth Cc: Ray Ni Cc: Rahul Kumar Cc: Eric Dong Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel C

[edk2-devel] [PATCH V11 12/47] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 MSR is accessed in BaseXApicX2ApicLib. In TDX some MSRs are accessed directly from/to CPU. Some should be accessed via explicit requests from the host VMM using TDCALL(TDG.VP.VMCALL). This is done by the help of TdxLib. Please refer to [TDX

[edk2-devel] [PATCH V11 11/47] MdePkg: Support IoRead/IoWrite for Tdx guest in BaseIoLibIntrinsic

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 This commit supports IoRead/IoWrite for SEV/TDX/Legacy guest in one binary. It checks the guest type in runtime and then call corresponding functions. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Brijesh Singh Cc: Erdem Akta

[edk2-devel] [PATCH V11 10/47] MdePkg: Support IoFifo for Tdx guest in BaseIoLibIntrinsic

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Previously IoFifo functions are in X64/IoFifoSev.nasm which supports both SEV guest and Legacy guest. IoLibFifo.c is introduced to support SEV/TDX/Legacy guest in one binary. It checks the guest type in runtime and call corresponding functio

[edk2-devel] [PATCH V11 09/47] MdePkg: Support mmio for Tdx guest in BaseIoLibIntrinsic

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 TDVF access MMIO with TDG.VP.VMCALL to invoke VMM provided emulation functions. If the access to MMIO fails, it fall backs to the direct access. BaseIoLibIntrinsic.inf is the IoLib used by other packages. It will not support I/O in Td guest

[edk2-devel] [PATCH V11 07/47] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Add base support to handle #VE exceptions. Update the common exception handlers to invoke the VmTdExitHandleVe () function of the VmgExitLib library when a #VE is encountered. A non-zero return code will propagate to the targeted exception h

[edk2-devel] [PATCH V11 08/47] MdePkg: Add helper functions for Tdx guest in BaseIoLibIntrinsic

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Intel TDX architecture does not prescribe a specific software convention to perform I/O from the guest TD. Guest TD providers have many choices to provide I/O to the guest. The common I/O models are emulated devices, para-virtualized devices

[edk2-devel] [PATCH V11 06/47] OvmfPkg: Extend VmgExitLib to handle #VE exception

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 The base VmgExitLib library provides a default limited interface to handle #VE exception. To provide full support, the OVMF version of VmgExitLib is extended to provide full support of #VE handler. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jo

[edk2-devel] [PATCH V11 05/47] UefiCpuPkg: Extend VmgExitLibNull to handle #VE exception

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 VmgExitLib performs the necessary processing to handle a #VC exception. VmgExitLibNull is a NULL instance of VmgExitLib which provides a default limited interface. In this commit VmgExitLibNull is extended to handle a #VE exception with a de

[edk2-devel] [PATCH V11 04/47] MdePkg: Add TdxLib to wrap Tdx operations

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 TdxLib is created with functions to perform the related Tdx operation. This includes functions for: - TdAcceptPages : Accept pending private pages and initialize the pages to all-0 using the TD ephemeral private key.

[edk2-devel] [PATCH V11 03/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Introduce basic Tdx functions in BaseLib: - TdCall () - TdVmCall () - TdIsEnabled () Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: G

[edk2-devel] [PATCH V11 02/47] MdePkg: Update Cpuid.h for Tdx

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Guest software can be designed to run either as a TD, as a legacy virtual machine, or directly on the CPU, based on enumeration of its run-time environment. [TDX-Module] Chap 10.2 defines the flow and the new CPUID leaf 0x21. [TDX-Module] A

[edk2-devel] [PATCH V11 00/47] Enable Intel TDX in OvmfPkg (Config-A)

2022-03-28 Thread Min Xu
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 T

[edk2-devel] [PATCH V11 01/47] MdePkg: Add Tdx.h

2022-03-28 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Tdx.h includes the Intel Trust Domain Extension definitions. Detailed information can be found in below document: https://software.intel.com/content/dam/develop/external/us/en/ documents/tdx-module-1eas-v0.85.039.pdf Cc: Michael D Kinney

Re: [edk2-devel] [PATCH V10 14/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-28 Thread Min Xu
On March 28, 2022 9:20 AM, Ni Ray wrote: > All look good! 3 minor comments: > 1. DxeMpLib.c may not need to include MpIntelTdx.h 2. You may use "ASSERT > (!ExcludeBsp)" in below code. Otherwise, it may confuse reader that when > ExcludeBsp is TRUE, SUCCESS is returned when ProcessorCount is 1 which

Re: [edk2-devel] [PATCH v1 27/28] OvmfPkg: Add ProtectedVariable reference

2022-03-28 Thread Boeuf, Sebastien
Acked-by: Sebastien Boeuf On Fri, 2022-03-25 at 16:28 -0700, Judah Vang wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594 > > Add reference for ProtectedVariableLib. > > Cc: Jian J Wang > Cc: Sebastien Boeuf > Cc: Nishant C Mistry > Signed-off-by: Judah Vang > --- >  OvmfPkg