[edk2-devel] [PATCH V8 40/47] OvmfPkg: Update AcpiPlatformDxe to alter MADT table

2022-03-11 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 In TDX the guest firmware is designed to publish a multiprocessor-wakeup structure to let the guest-bootstrap processor wake up guest-application processors with a mailbox. The mailbox is memory that the guest firmware can reserve so each gu

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

2022-03-11 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 V8 38/47] OvmfPkg: Update PlatformInitLib for Tdx guest

2022-03-11 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 V8 37/47] UefiCpuPkg: Update AddressEncMask in CpuPageTable

2022-03-11 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 V8 36/47] MdeModulePkg: Add PcdTdxSharedBitMask

2022-03-11 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 V8 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set

2022-03-11 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 Signed-off-b

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

2022-03-11 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 V8 33/47] OvmfPkg: Update Sec to support Tdx

2022-03-11 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 V8 32/47] OvmfPkg/Sec: Declare local variable as volatile in SecCoreStartupWithStack

2022-03-11 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 V8 31/47] OvmfPkg: Update PlatformInitLib to process Tdx hoblist

2022-03-11 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 V8 30/47] MdePkg: Add EFI_RESOURCE_MEMORY_UNACCEPTED defition

2022-03-11 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Add EFI_RESOURCE_MEMORY_UNACCEPTED definition in PiHob.h. This definition is for the unaccepted memory passed from Host VMM. This is proposed in https://github.com/microsoft/mu_basecore/pull/66/ files#diff-b20a11152d1ce9249c691be5690b4baf52

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

2022-03-11 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 V8 28/47] OvmfPkg/PlatformInitLib: Create MemDetect.c

2022-03-11 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 Move functions in PlatformPei\MemDetect.c to PlatformInitLib\MemDetect.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 Boeu

[edk2-devel] [PATCH V8 27/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-11 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 V8 26/47] OvmfPkg/PlatformPei: Refactor NoexecDxeInitialization

2022-03-11 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 V8 25/47] OvmfPkg/PlatformPei: Refactor MemMapInitialization

2022-03-11 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 V8 23/47] OvmfPkg/PlatformPei: Refactor QemuUc32BaseInitialization

2022-03-11 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 V8 22/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization

2022-03-11 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 V8 21/47] OvmfPkg/PlatformPei: Refactor AddressWidthInitialization

2022-03-11 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 V8 20/47] OvmfPkg/PlatformPei: Refactor MiscInitialization for CloudHV

2022-03-11 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 V8 19/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-11 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 V8 18/47] OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob

2022-03-11 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 V8 17/47] OvmfPkg/PlatformInitLib: Add hob functions

2022-03-11 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 V8 16/47] OvmfPkg: Create initial version of PlatformInitLib

2022-03-11 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 V8 15/47] OvmfPkg: Add TdxMailboxLib

2022-03-11 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 V8 14/47] OvmfPkg: Add IntelTdx.h in OvmfPkg/Include/IndustryStandard

2022-03-11 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 V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-11 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 V8 12/47] MdePkg: Add macro to check SEV / TDX guest

2022-03-11 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 V8 11/47] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2022-03-11 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 V8 10/47] MdePkg: Support IoRead/IoWrite for Tdx guest in BaseIoLibIntrinsic

2022-03-11 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 V8 09/47] MdePkg: Support IoFifo for Tdx guest in BaseIoLibIntrinsic

2022-03-11 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 V8 08/47] MdePkg: Support mmio for Tdx guest in BaseIoLibIntrinsic

2022-03-11 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 V8 07/47] MdePkg: Add helper functions for Tdx guest in BaseIoLibIntrinsic

2022-03-11 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 V8 06/47] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception

2022-03-11 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 V8 05/47] OvmfPkg: Extend VmgExitLib to handle #VE exception

2022-03-11 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 V8 04/47] UefiCpuPkg: Extend VmgExitLibNull to handle #VE exception

2022-03-11 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 V8 03/47] MdePkg: Add TdxLib to wrap Tdx operations

2022-03-11 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 V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-11 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 V8 01/47] MdePkg: Add Tdx.h

2022-03-11 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

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

2022-03-11 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][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/JunctionCity: Build ACPI content

2022-03-11 Thread Oram, Isaac W
Use source versions of AcpiTables, AcpiPlatform, and StaticSkuDataDxe. Cc: Nate DeSimone Cc: Chasel Chiu Cc: Manickavasakam Karpagavinayagam Signed-off-by: Isaac Oram --- Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf | 3 + Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/b

Re: [edk2-devel][edk2-platforms][PATCH V1 0/9] Add Whitley AcpiPlatform driver

2022-03-11 Thread Oram, Isaac W
Pushed as: 3c40bddded..7cd51aa3c1 -Original Message- From: Desimone, Nathaniel L Sent: Thursday, March 10, 2022 5:13 PM To: Oram, Isaac W ; devel@edk2.groups.io Cc: Chiu, Chasel Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 0/9] Add Whitley AcpiPlatform driver For the series...

[edk2-devel] [PATCH v1] MdeModulePkg/DxeIpl: Create 5-level page table for long mode

2022-03-11 Thread Jason Lou
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2008 Correct the logic about whether 5-level paging is supported. Signed-off-by: Jason Lou Cc: Ray Ni Cc: Dandan Bi Cc: Liming Gao --- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

Re: [edk2-devel] [edk2][PATCH V1 1/1] ArmPkg: Handle warm reboot request correctly

2022-03-11 Thread Sami Mujawar
Hi Pranav, Please see my response inline marked [SAMI]. Regards, Sami Mujawar On 11/03/2022 06:06 AM, Pranav Madhu wrote: Hi Sami, Thanks for your comments. Please find my reply inline. Regards, Pranav -Original Message- From: Sami Mujawar Sent: Thursday, March 10, 2022 9:01 PM

[edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

2022-03-11 Thread Sean Rhodes
From: Guo Dong On windows build, need add -DPLATFORMX64_ENABLE=TRUE in the build command line beside -DNETWORK_DRIVER_ENABLE=TRUE in order build network features. So set PLATFORMX64_ENABLE to TRUE when need build network feature. On Linux build, DSC file should not have PcdAllowHttpConnections wh

Re: [edk2-devel] [PATCH v1 1/1] DynamicTablesPkg: Fix serial port namespace path in DBG2

2022-03-11 Thread PierreGondois
Hi Sami, The patch looks good to me: Reviewed-by: Pierre Gondois On 3/10/22 18:39, Sami Mujawar wrote: According to the Debug Port Table 2 (DBG2) specification, February 17, 2021, the NamespaceString is a NULL terminated ASCII string that consists of a fully qualified reference to the object t

Re: [edk2-devel] [PATCH EDK2 v1 1/1] RedfishPkg: fix memory leak issue

2022-03-11 Thread wenyi,xie via groups.io
Hi Abner, Thank you for your reviewing, here is the link to the PR. https://github.com/tianocore/edk2/pull/2612 Regards Wenyi On 2022/3/11 15:03, Chang, Abner (HPS SW/FW Technologist) wrote: > Hi Wenyi, > Please add my RB in the commit message and create the PR against edk2, let me  > know the l