vmm: plumb legacy SMBIOS config

Add a small SMBIOS config that carries serial_number, uuid,
and OEM strings, and pass it from platform config into
x86_64 setup.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This commit is contained in:
Leander Kohler
2026-02-09 15:34:16 +01:00
committed by Rob Bradford
parent 0141635a5c
commit e097d7d495
4 changed files with 39 additions and 46 deletions
+15
View File
@@ -149,6 +149,21 @@ pub struct PlatformConfig {
pub vfio_p2p_dma: bool,
}
#[cfg(target_arch = "x86_64")]
impl PlatformConfig {
/// Returns `None` if no SMBIOS-relevant platform fields are set, otherwise
/// `Some` with a [`SmbiosConfig`] built from the populated fields.
pub fn smbios_config(&self) -> Option<arch::x86_64::SmbiosConfig> {
let smbios = arch::x86_64::SmbiosConfig {
serial_number: self.serial_number.clone(),
uuid: self.uuid.clone(),
oem_strings: self.oem_strings.clone().unwrap_or_default(),
};
(!smbios.is_empty()).then_some(smbios)
}
}
pub const DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT: u32 = 1;
fn default_pci_segment_aperture_weight() -> u32 {