From 8cb4b429a251cd95d43e50bcba51072be9295373 Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Thu, 22 Dec 2022 21:11:55 +0800 Subject: [PATCH] OvmfPkg/AcpiPlatformDxe: Check PcdConfidentialComputingGuestAttr PcdConfidentialComputingGuestAttr can be used to check the cc guest type, including td-guest or sev-guest. CcProbe() can do the same thing but CcProbeLib should be included in the dsc which uses AcpiPlatformDxe. The difference between PcdConfidentialComputingGuestAttr and CcProbe() is that PcdConfidentialComputingGuestAttr cannot be used in multi-processor scenario but CcProbe() can. But there is no such issue in AcpiPlatformDxe. So we use PcdConfidentialComputingGuestAttr instead of CcProbeLib so that it is simpler. Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 6 ++---- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c index 0cc3d958be..b446bb4872 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -8,9 +8,7 @@ **/ #include // CLOUDHV_DEVICE_ID - -#include // CcProbe(), CcGuestTypeIntelTdx - +#include #include "AcpiPlatform.h" /** @@ -35,7 +33,7 @@ InstallAcpiTables ( HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); if (HostBridgeDevId == CLOUDHV_DEVICE_ID) { - if (CcProbe () == CcGuestTypeIntelTdx) { + if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { Status = InstallCloudHvTablesTdx (AcpiTable); } else { Status = InstallCloudHvTables (AcpiTable); diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index 1647a90add..8939dde425 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -46,7 +46,6 @@ UefiBootServicesTableLib UefiDriverEntryPoint HobLib - CcProbeLib [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED @@ -62,6 +61,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize + gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr [Depex] gEfiAcpiTableProtocolGuid