OvmfPkg/AcpiPlatformDxe: Differentiate TDX case for Cloud Hypervisor

Rely on CcProbe() to identify when running on TDX so that ACPI tables
can be retrieved differently for Cloud Hypervisor. Instead of relying on
the PVH structure to find the RSDP pointer, the tables are individually
passed through the HOB.

Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-12-15 23:10:04 +08:00
committed by mergify[bot]
parent 57162cb62d
commit e254c71e9e
6 changed files with 105 additions and 1 deletions

View File

@@ -9,6 +9,8 @@
#include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
#include <Library/CcProbeLib.h> // CcProbe(), CcGuestTypeIntelTdx
#include "AcpiPlatform.h"
/**
@@ -33,7 +35,11 @@ InstallAcpiTables (
HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
if (HostBridgeDevId == CLOUDHV_DEVICE_ID) {
Status = InstallCloudHvTables (AcpiTable);
if (CcProbe () == CcGuestTypeIntelTdx) {
Status = InstallCloudHvTablesTdx (AcpiTable);
} else {
Status = InstallCloudHvTables (AcpiTable);
}
} else {
Status = InstallQemuFwCfgTables (AcpiTable);
}