summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/TdxDxe
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/TdxDxe')
-rw-r--r--OvmfPkg/TdxDxe/TdxDxe.c22
-rw-r--r--OvmfPkg/TdxDxe/TdxDxe.inf2
2 files changed, 23 insertions, 1 deletions
diff --git a/OvmfPkg/TdxDxe/TdxDxe.c b/OvmfPkg/TdxDxe/TdxDxe.c
index f092999823..2318db9897 100644
--- a/OvmfPkg/TdxDxe/TdxDxe.c
+++ b/OvmfPkg/TdxDxe/TdxDxe.c
@@ -23,6 +23,7 @@
#include <Library/UefiLib.h>
#include <Library/HobLib.h>
#include <Protocol/Cpu.h>
+#include <Protocol/MpInitLibDepProtocols.h>
#include <Library/UefiBootServicesTableLib.h>
#include <ConfidentialComputingGuestAttr.h>
#include <IndustryStandard/Tdx.h>
@@ -250,14 +251,33 @@ TdxDxeEntryPoint (
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;
}
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
//
Status = TdCall (TDCALL_TDINFO, 0, 0, 0, &TdReturnData);
diff --git a/OvmfPkg/TdxDxe/TdxDxe.inf b/OvmfPkg/TdxDxe/TdxDxe.inf
index 2ec2ef2ed5..a7e0abda15 100644
--- a/OvmfPkg/TdxDxe/TdxDxe.inf
+++ b/OvmfPkg/TdxDxe/TdxDxe.inf
@@ -50,6 +50,8 @@
gQemuAcpiTableNotifyProtocolGuid ## CONSUMES
gEfiAcpiSdtProtocolGuid ## CONSUMES
gEfiAcpiTableProtocolGuid ## CONSUMES
+ gEfiMpInitLibMpDepProtocolGuid
+ gEfiMpInitLibUpDepProtocolGuid
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase