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 <ardb+tianocore@kernel.org> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
47 lines
1.0 KiB
C
47 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 <ConfidentialComputingGuestAttr.h>
|
|
#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 (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) {
|
|
Status = InstallCloudHvTablesTdx (AcpiTable);
|
|
} else {
|
|
Status = InstallCloudHvTables (AcpiTable);
|
|
}
|
|
} else {
|
|
Status = InstallQemuFwCfgTables (AcpiTable);
|
|
}
|
|
|
|
return Status;
|
|
}
|