On February 22, 2022 9:10 PM, Gerd Hoffmann wrote: > > > > Add null instance of PlatformInitLib. > > What is this library needed for? > In #25 (OvmfPkg: Update PlatformInitLib to process Tdx hoblist) ProcessTdxHobList is added in PlatformInitLib to process the Tdx HobList. This function is called in OvmfPkg/Sec/SecMain.c (#28 OvmfPkg: Update Sec to support Tdx). ProcessTdxHobList is called by OvmfPkg/IntelTdx/Sec/SecMain.c as well. See https://edk2.groups.io/g/devel/message/86120
OvmfPkg/Sec/SecMain.c is used by OvmfXen.dsc/AmdSevX64.dsc/BhyveX64.dsc/CloudHvX64.dsc/MicrovmX64.dsc. So PlatformInitLibNull is needed by these platforms. There is another option which can reduce the changes in dscs. 1. Define a macro (for example: TDX_GUEST_SUPPORTED) in OvmfPkgX64.dsc MSFT:*_*_*_CC_FLAGS = /D TDX_GUEST_SUPPORTED INTEL:*_*_*_CC_FLAGS = /D TDX_GUEST_SUPPORTED GCC:*_*_*_CC_FLAGS = -D TDX_GUEST_SUPPORTED 2. TDX_GUEST_SUPPORTED wrap the tdx specific code in SecMain.c #if defined (TDX_GUEST_SUPPORTED) if (TdIsEnabled ()) { if (ProcessTdxHobList () != EFI_SUCCESS) { CpuDeadLoop (); } } #endif What's your thought? Thanks Min -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86871): https://edk2.groups.io/g/devel/message/86871 Mute This Topic: https://groups.io/mt/89252053/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-