diff options
author | Min M Xu <min.m.xu@intel.com> | 2022-05-07 09:36:22 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-05-11 08:40:53 +0000 |
commit | 73d6d41de0ceeadb49b05ba75ca39dea84ae799d (patch) | |
tree | b2b41f560d6cb6cc4a1531a8e329d0c5c0585cdf /OvmfPkg | |
parent | b63a49e056ea2ea64ff89d81da9583534f5e5117 (diff) | |
download | edk2-73d6d41de0ceeadb49b05ba75ca39dea84ae799d.zip edk2-73d6d41de0ceeadb49b05ba75ca39dea84ae799d.tar.gz edk2-73d6d41de0ceeadb49b05ba75ca39dea84ae799d.tar.bz2 |
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>
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/TdxDxe/TdxDxe.c | 22 | ||||
-rw-r--r-- | OvmfPkg/TdxDxe/TdxDxe.inf | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/OvmfPkg/TdxDxe/TdxDxe.c b/OvmfPkg/TdxDxe/TdxDxe.c index f092999..2318db9 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 2ec2ef2..a7e0abd 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
|