ArmVirtPkg/ArmVirtCloudHv: Add SMBIOS support

Wire MdeModulePkg/SmbiosDxe and OvmfPkg/SmbiosPlatformDxe into the
ArmVirtCloudHv platform so that aarch64 Cloud Hypervisor guests get
SMBIOS tables, matching the existing X64 CloudHv behavior.
aarch64 cloud-hypervisor side change can be found at [1] and [2].
They are still open at the moment.

The initial guest memory layout is as follows.

Memory layout without the cloud-hypervisor patch series:
---------------------------- FDT_START = RAM_START = 0x4000_0000
FDT size = 0x20_0000
---------------------------- ACPI_START = 0x4020_0000
ACPI table size = 0x20_0000
---------------------------- KERNEL_START = 0x4040_0000
the kernel

Memory layout with the cloud-hypervisor patch series:
---------------------------- FDT_START = RAM_START = 0x4000_0000
FDT size = 0x20_0000
---------------------------- ACPI_START = 0x4020_0000
ACPI table size = 0x20_0000 - 0x1_0000
---------------------------- SMBIOS_START = 0x403F_0000
SMBIOS 3.0 entry point/table size = 0x1_0000
---------------------------- KERNEL_START = 0x4040_0000
the kernel

The ACPI table size reduction is made by the cloud-hypervisor side [1].
This layout keeps the compatibility with the EDK2 without this
patch. The existing EDK2 CloudHV binary should keep working (with the
empty SMBIOS in the guest). The updated size for ACPI table for 2MiB -
64KiB and SMBIOS for 64KiB would be enough at this point because the
size for SMBIOS for x86 is 64KiB (0xf0000 segment). The alternative is
to allocate, say 0x20_0000 region for SMBIOS and push KERNEL_START. In
such case, the existing EDK2 CloudHv binary doesn't work with the new
memory layout.

There are several change points in the ArmVirtCloudHv.dsc:

SMBIOS base address: override PcdCloudHvSmbiosBaseAddress = 0x403F0000,
the PCD introduced by the previous patch.  This is ABI between
cloud-hypervisor and guest firmware.

QEMU fw-cfg: Use the QemuFwCfgLibNull mapping as cloud-hypervisor
doesn't provide qemu fw-cfg by default. (It's required to link
SmbiosPlatformDxe/Qemu.c).

Host bridge device id: Statically set PcdOvmfHostBridgePciDevId =
CLOUDHV_DEVICE_ID (0x0D57) because ArmVirtCloudHv has no host bus
probe by construction unlike X64 runtime probe by OvmfPkg/PlatformPei.
Without this statically setting, the execution path goes to QEMU
fw_cfg path which isn't supported.

SMBIOS version/DocRev: Followed ArmVirtQemu (0x0300) rather than the
X64 CloudHv (0x0208). 37baf06b44 for x86 changed the version for the
pre-2015 guest, but aarch64 doesn't have such guest predating SMBIOS
3.0.  c98da3345a kept 0x0300 for ArmVirtQemu.

Verified on a aarch64 host: the guest reports "SMBIOS 3.0.0 present."
and "DMI: Cloud Hypervisor cloud-hypervisor"; without the
PcdSmbiosVersion pin it reports 3.3.0.

[1] https://github.com/cloud-hypervisor/cloud-hypervisor/pull/8786
[2] https://github.com/cloud-hypervisor/cloud-hypervisor/issues/8716

Signed-off-by: Isaku Yamahata <iyamahata@crusoe.ai>
This commit is contained in:
Isaku Yamahata 2026-08-26 10:50:01 -07:00
parent 9425ba0fd4
commit ec2ce7a329
No known key found for this signature in database
2 changed files with 34 additions and 0 deletions

View file

@ -47,6 +47,9 @@
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
ArmTransferListLib|ArmPkg/Library/ArmTransferListLib/ArmTransferListLib.inf
# Required by OvmfPkg/SmbiosPlatformDxe (compiled for all archs; unused on ARM)
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf
!include MdePkg/MdeLibs.dsc.inc
[LibraryClasses.common.PEIM]
@ -82,6 +85,11 @@
# Rsdp base address in Cloud Hypervisor
gArmVirtTokenSpaceGuid.PcdCloudHvAcpiRsdpBaseAddress|0x40200000
# Smbios base address in Cloud Hypervisor. Must match the aarch64 SMBIOS
# staging address used by cloud-hypervisor
# ABI between cloud-hypervisor and firmware.
gUefiOvmfPkgTokenSpaceGuid.PcdCloudHvSmbiosBaseAddress|0x403F0000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x4000000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x40000
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
@ -180,6 +188,20 @@
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
# ArmVirtCloudHv is by construction the Cloud Hypervisor platform. On X64
# this PCD is discovered at runtime by OvmfPkg/PlatformPei probing the host
# bridge. As there is no such probe on aarch64, define it statically.
# OvmfPkg/SmbiosPlatformDxe uses this bridge device id.
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0x0D57
#
# SMBIOS entry point version. Follow ArmVirtQemu rather than the X64
# CloudHv platform: OvmfPkg/CloudHv/CloudHvX64.dsc pins 0x0208 for
# pre-2015 x86 guests. AArch64 does not have such a concern.
#
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0300
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
[PcdsDynamicHii]
gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gOvmfVariableGuid|0x0|FALSE|NV,BS
@ -249,6 +271,12 @@
#
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
#
# SMBIOS Support
#
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
#
# ACPI Support
#

View file

@ -180,6 +180,12 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
#
# SMBIOS Support
#
INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
#
# ACPI Support
#