[edk2-devel] [PATCH 13/17] OvmfPkg/Microvm: PlatformPei/Platform misc tweaks

Gerd Hoffmann kraxel at redhat.com
Tue Aug 31 09:57:10 UTC 2021


Add + set microvm id for PcdOvmfHostBridgePciDevId.

Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 OvmfPkg/Include/IndustryStandard/Microvm.h | 6 ++++++
 OvmfPkg/PlatformPei/Platform.c             | 7 +++++++
 2 files changed, 13 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 000000000000..ba5ce3ecfb98
--- /dev/null
+++ b/OvmfPkg/Include/IndustryStandard/Microvm.h
@@ -0,0 +1,6 @@
+#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 d425a5c429c6..aeb39595aa28 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -31,6 +31,7 @@
 #include <Library/ResourcePublicationLib.h>
 #include <Ppi/MasterBootMode.h>
 #include <IndustryStandard/I440FxPiix4.h>
+#include <IndustryStandard/Microvm.h>
 #include <IndustryStandard/Pci22.h>
 #include <IndustryStandard/Q35MchIch9.h>
 #include <IndustryStandard/QemuCpuHotplug.h>
@@ -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));
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79997): https://edk2.groups.io/g/devel/message/79997
Mute This Topic: https://groups.io/mt/85272568/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list