From bf02d73e74ec2825551126c780df726cc543cfb0 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 8 Sep 2021 11:01:13 +0200 Subject: [PATCH] OvmfPkg/Microvm: PlatformPei/Platform: add id. Add + set microvm id for PcdOvmfHostBridgePciDevId. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann Acked-by: Jiewen Yao --- OvmfPkg/Include/IndustryStandard/Microvm.h | 12 ++++++++++++ OvmfPkg/PlatformPei/Platform.c | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 OvmfPkg/Include/IndustryStandard/Microvm.h diff --git a/OvmfPkg/Include/IndustryStandard/Microvm.h b/OvmfPkg/Include/IndustryStandard/Microvm.h new file mode 100644 index 0000000000..c56547c4f2 --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/Microvm.h @@ -0,0 +1,12 @@ +/** @file + Various defines for qemu microvm + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef __MICROVM_H__ +#define __MICROVM_H__ + +#define MICROVM_PSEUDO_DEVICE_ID 0xfff1 + +#endif // __MICROVM_H__ diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index d425a5c429..aeb39595aa 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -364,6 +365,12 @@ MiscInitialization ( AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; + case 0xffff: /* microvm */ + DEBUG ((DEBUG_INFO, "%a: microvm\n", __FUNCTION__)); + PcdStatus = PcdSet16S (PcdOvmfHostBridgePciDevId, + MICROVM_PSEUDO_DEVICE_ID); + ASSERT_RETURN_ERROR (PcdStatus); + return; default: DEBUG ((DEBUG_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", __FUNCTION__, mHostBridgeDevId));