OvmfPkg/TdxDxe: Install MpInitLibDepLib protocols
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3918 In Td guest CpuDxe driver uses the MpInitLibUp, the other guest type use the MpInitLib. So we install different Protocols according to the current working guest type. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Tested-by: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
@ -23,6 +23,7 @@
|
|||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
#include <Protocol/Cpu.h>
|
#include <Protocol/Cpu.h>
|
||||||
|
#include <Protocol/MpInitLibDepProtocols.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <ConfidentialComputingGuestAttr.h>
|
#include <ConfidentialComputingGuestAttr.h>
|
||||||
#include <IndustryStandard/Tdx.h>
|
#include <IndustryStandard/Tdx.h>
|
||||||
@ -250,13 +251,32 @@ TdxDxeEntryPoint (
|
|||||||
|
|
||||||
if (!TdIsEnabled ()) {
|
if (!TdIsEnabled ()) {
|
||||||
//
|
//
|
||||||
// If it is Non-Td guest, we're done.
|
// If it is Non-Td guest, we install gEfiMpInitLibMpDepProtocolGuid so that
|
||||||
|
// MpInitLib will be used in CpuDxe driver.
|
||||||
//
|
//
|
||||||
|
gBS->InstallProtocolInterface (
|
||||||
|
&ImageHandle,
|
||||||
|
&gEfiMpInitLibMpDepProtocolGuid,
|
||||||
|
EFI_NATIVE_INTERFACE,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMmioSharedBit ();
|
SetMmioSharedBit ();
|
||||||
|
|
||||||
|
//
|
||||||
|
// It is Td guest, we install gEfiMpInitLibUpDepProtocolGuid so that
|
||||||
|
// MpInitLibUp will be used in CpuDxe driver.
|
||||||
|
//
|
||||||
|
gBS->InstallProtocolInterface (
|
||||||
|
&ImageHandle,
|
||||||
|
&gEfiMpInitLibUpDepProtocolGuid,
|
||||||
|
EFI_NATIVE_INTERFACE,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Call TDINFO to get actual number of cpus in domain
|
// Call TDINFO to get actual number of cpus in domain
|
||||||
//
|
//
|
||||||
|
@ -50,6 +50,8 @@
|
|||||||
gQemuAcpiTableNotifyProtocolGuid ## CONSUMES
|
gQemuAcpiTableNotifyProtocolGuid ## CONSUMES
|
||||||
gEfiAcpiSdtProtocolGuid ## CONSUMES
|
gEfiAcpiSdtProtocolGuid ## CONSUMES
|
||||||
gEfiAcpiTableProtocolGuid ## CONSUMES
|
gEfiAcpiTableProtocolGuid ## CONSUMES
|
||||||
|
gEfiMpInitLibMpDepProtocolGuid
|
||||||
|
gEfiMpInitLibUpDepProtocolGuid
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase
|
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase
|
||||||
|
Reference in New Issue
Block a user