2015-02-20 00:45:57 +01:00
|
|
|
/** @file
|
2021-12-10 15:41:57 +01:00
|
|
|
OVMF ACPI Platform Driver
|
2015-02-20 00:45:57 +01:00
|
|
|
|
|
|
|
Copyright (C) 2015, Red Hat, Inc.
|
|
|
|
Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
|
|
|
|
|
2019-04-04 01:06:33 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2015-02-20 00:45:57 +01:00
|
|
|
**/
|
|
|
|
|
2021-12-10 15:41:58 +01:00
|
|
|
#include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
|
2022-12-22 14:11:55 +01:00
|
|
|
#include <ConfidentialComputingGuestAttr.h>
|
2023-06-21 09:31:15 +02:00
|
|
|
|
|
|
|
#include <Library/AcpiPlatformLib.h>
|
|
|
|
|
2015-02-20 00:45:57 +01:00
|
|
|
#include "AcpiPlatform.h"
|
|
|
|
|
|
|
|
/**
|
2021-12-10 15:41:57 +01:00
|
|
|
Effective entrypoint of Acpi Platform driver.
|
2015-02-20 00:45:57 +01:00
|
|
|
|
|
|
|
@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;
|
2021-12-10 15:41:58 +01:00
|
|
|
UINT16 HostBridgeDevId;
|
|
|
|
|
|
|
|
HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
|
|
|
|
if (HostBridgeDevId == CLOUDHV_DEVICE_ID) {
|
2022-12-22 14:11:55 +01:00
|
|
|
if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) {
|
2022-12-15 16:10:04 +01:00
|
|
|
Status = InstallCloudHvTablesTdx (AcpiTable);
|
|
|
|
} else {
|
|
|
|
Status = InstallCloudHvTables (AcpiTable);
|
|
|
|
}
|
2021-12-10 15:41:58 +01:00
|
|
|
} else {
|
|
|
|
Status = InstallQemuFwCfgTables (AcpiTable);
|
|
|
|
}
|
2015-02-20 00:45:57 +01:00
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|