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
+3 -18
View File
@@ -31,6 +31,7 @@ use linux_loader::loader::elf::start_info::{
hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info,
};
use log::{debug, error, info};
pub use smbios::SmbiosConfig;
use thiserror::Error;
use vm_memory::{
Address, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
@@ -1059,9 +1060,7 @@ pub fn configure_system(
_num_cpus: u32,
setup_header: Option<setup_header>,
rsdp_addr: Option<GuestAddress>,
serial_number: Option<&str>,
uuid: Option<&str>,
oem_strings: Option<&[String]>,
smbios: Option<&SmbiosConfig>,
topology: Option<(u16, u16, u16, u16)>,
) -> super::Result<()> {
// Write EBDA address to location where ACPICA expects to find it
@@ -1069,13 +1068,7 @@ pub fn configure_system(
.write_obj((layout::EBDA_START.0 >> 4) as u16, layout::EBDA_POINTER)
.map_err(Error::EbdaSetup)?;
let size = smbios::setup_smbios(
guest_mem,
serial_number,
uuid,
oem_strings.unwrap_or_default(),
)
.map_err(Error::SmbiosSetup)?;
let size = smbios::setup_smbios(guest_mem, smbios).map_err(Error::SmbiosSetup)?;
// Place the MP table after the SMIOS table aligned to 16 bytes
let offset = GuestAddress(layout::SMBIOS_START).unchecked_add(size);
@@ -1620,8 +1613,6 @@ mod unit_tests {
Some(layout::RSDP_POINTER),
None,
None,
None,
None,
);
config_err.unwrap_err();
@@ -1644,8 +1635,6 @@ mod unit_tests {
None,
None,
None,
None,
None,
)
.unwrap();
@@ -1673,8 +1662,6 @@ mod unit_tests {
None,
None,
None,
None,
None,
)
.unwrap();
@@ -1688,8 +1675,6 @@ mod unit_tests {
None,
None,
None,
None,
None,
)
.unwrap();
}