mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
9ce95b3037
SMBIOS allows to pass down system information from the BIOS to the OS. Its information is used on Linux to construct modalias entries for the system in order to facilite module autoloading on specific hardware. Adding it also allows package management software to target specific packages when crosvm is used as the hypervisor (e.g. to pre-install the helper daemons or a special vTPM driver). This change has only been tested with Linux and implements the bare minimum necessary to make a crosvm hypervisor detectable through DMI data. As such it also skips over some required structures like BIOS information that do not technically apply. The result is a hodgepodge of standards: SMBIOS 3.0 provides a convenient 64-bit entrypoint that we implement. However the structures are cut short to SMBIOS 2.0 standards as most of the fields are skipped. Linux deals just fine with this, although some of the dmi/id files in sysfs will be empty as a result. The resulting modalias looks like this: dmi:bvncrosvm:bvr0:bd:svnChromiumOS:pncrosvm:pvr: The kernel prints this as part of startup: SMBIOS 3.2.0 present. DMI: ChromiumOS crosvm, BIOS 0 And for oops/panic: Hardware name: ChromiumOS crosvm, BIOS 0 dmidecode's view on the tables (which uses its own parser): Getting SMBIOS data from sysfs. SMBIOS 3.2.0 present. Table at 0x000F0018. Handle 0x0001, DMI type 0, 20 bytes BIOS Information Vendor: crosvm Version: 0 Release Date: Not Specified ROM Size: 64 kB Characteristics: PCI is supported System is a virtual machine Handle 0x0002, DMI type 1, 27 bytes System Information Manufacturer: ChromiumOS Product Name: crosvm Version: Not Specified Serial Number: Not Specified UUID: Not Settable Wake-up Type: Reserved SKU Number: Not Specified Family: Not Specified TEST=cargo test Change-Id: Ie27105711a9bc14941d387b720da350349dff265 Reviewed-on: https://chromium-review.googlesource.com/1571565 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
src | ||
build.rs | ||
Cargo.toml | ||
host_cpuid.c |