Files
system76-edk2/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
Sebastien Boeuf e254c71e9e 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>
2022-12-16 02:37:56 +00:00

49 lines
1.0 KiB
C

/** @file
OVMF ACPI Platform Driver
Copyright (C) 2015, Red Hat, Inc.
Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
#include <Library/CcProbeLib.h> // CcProbe(), CcGuestTypeIntelTdx
#include "AcpiPlatform.h"
/**
Effective entrypoint of Acpi Platform driver.
@param ImageHandle
@param SystemTable
@return EFI_SUCCESS
@return EFI_LOAD_ERROR
@return EFI_OUT_OF_RESOURCES
**/
EFI_STATUS
EFIAPI
InstallAcpiTables (
IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
)
{
EFI_STATUS Status;
UINT16 HostBridgeDevId;
HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
if (HostBridgeDevId == CLOUDHV_DEVICE_ID) {
if (CcProbe () == CcGuestTypeIntelTdx) {
Status = InstallCloudHvTablesTdx (AcpiTable);
} else {
Status = InstallCloudHvTables (AcpiTable);
}
} else {
Status = InstallQemuFwCfgTables (AcpiTable);
}
return Status;
}