Skip to content

Propagate SMBIOS fields for sysinfo and chassis#78

Merged
Coffeeri merged 5 commits into
cyberus-technology:gardenlinuxfrom
Coffeeri:feat/smbios-system-chassis
Feb 10, 2026
Merged

Propagate SMBIOS fields for sysinfo and chassis#78
Coffeeri merged 5 commits into
cyberus-technology:gardenlinuxfrom
Coffeeri:feat/smbios-system-chassis

Conversation

@Coffeeri
Copy link
Copy Markdown

@Coffeeri Coffeeri commented Feb 9, 2026

Wire SMBIOS data through the stack: extend System Information fields, add chassis info, and pass a structured SMBIOS config from --platform into arch setup. This unifies legacy serial/uuid handling with the new system_* keys and keeps OEM strings supported. The naming of platform options is based on dmidecode -s <field>.

Also wire new system_* SMBIOS fields and chassis asset tag through CLI/API, while still accepting legacy serial_number/uuid (deprecation follow-up).

Fields:

  • system_manufacturer
  • system_product_name
  • system_version
  • system_family
  • system_serial_number
  • system_uuid
  • chassis_asset_tag

On-behalf-of: SAP leander.kohler@sap.com

Related PRs:

Comment thread arch/src/x86_64/smbios.rs
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch from 12af9dc to 9b969db Compare February 9, 2026 10:41
@Coffeeri Coffeeri changed the title vmm: platform: add structured SMBIOS config WIP: Propagate SMBIOS fields for sysinfo and chassis Feb 9, 2026
@Coffeeri Coffeeri changed the title WIP: Propagate SMBIOS fields for sysinfo and chassis Propagate SMBIOS fields for sysinfo and chassis Feb 9, 2026
@Coffeeri Coffeeri marked this pull request as ready for review February 9, 2026 12:49
Copy link
Copy Markdown
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please find a way to split the refeactorings and the additions into at least two, possibly more, commits? This will simplify review a lot :)

Comment thread arch/src/x86_64/mod.rs
Comment thread arch/src/x86_64/smbios.rs
Comment thread arch/src/x86_64/smbios.rs
Comment thread arch/src/x86_64/smbios.rs Outdated
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch 5 times, most recently from 94c2023 to 46b0207 Compare February 10, 2026 07:35
Copy link
Copy Markdown
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a few nits.

Further: Please evaluate if you can create a meaningul unit test for the table construction

Comment thread arch/src/x86_64/smbios.rs Outdated
Comment thread arch/src/x86_64/smbios.rs Outdated
Comment thread vmm/src/vm_config.rs Outdated
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch from 46b0207 to 477aabf Compare February 10, 2026 10:27
Copy link
Copy Markdown

@olivereanderson olivereanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread arch/src/x86_64/smbios.rs Outdated
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch from 477aabf to 8d47337 Compare February 10, 2026 12:34
Comment thread arch/src/x86_64/smbios.rs
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch 2 times, most recently from 328eb98 to 2040259 Compare February 10, 2026 12:58
@phip1611
Copy link
Copy Markdown
Member

phip1611 commented Feb 10, 2026

great first contribution to (our fork of) CHV!

@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch from 2040259 to af4afc3 Compare February 10, 2026 13:14
Split the System Information write into helper functions and
reuse the string writer so the table layout and inputs are
unchanged.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
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>
Extend SMBIOS System Information with manufacturer, product,
version, family, sku, serial, and uuid fields, add a chassis
asset tag, and pass a structured SMBIOS config from --platform
into arch setup. Keep OEM strings and legacy serial_number/uuid
options working for compatibility. The platform option naming
follows `dmidecode -s <field>`.

Fields:
  - system_manufacturer
  - system_product_name
  - system_version
  - system_family
  - system_serial_number
  - system_uuid
  - chassis_asset_tag

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
Mark serial_number/uuid as deprecated in the OpenAPI schema and emit
warnings when those legacy --platform keys are used, while continuing to
accept them for compatibility.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
Add unit tests that walk the SMBIOS binary layout in guest memory and
verify structure ordering, string-set encoding, and error paths.

Tests added:
  - smbios_chassis_empty_string_set_has_double_null: verify that
    a chassis with no strings emits the double-NUL terminator required
    by SMBIOS DSP0134 §6.1.3.
  - smbios_chassis_oem_strings_layout: verify the full chain
    (BIOS → System → Chassis → OEM → End) when a chassis asset tag and
    OEM strings are configured.
  - smbios_strings_terminators_default: verify the default table chain
    (BIOS → System → End) and check that string indices and string-set
    contents match for both structures.
  - smbios_strings_too_many: exercise alloc_index up to the u8 limit
    (255 strings) and verify the 256th is rejected.
  - smbios_uuid_invalid_rejected: ensure a malformed UUID string is
    rejected with Error::ParseUuid.
  - smbios_uuid_written_le: ensure the UUID is stored in little-endian
    byte order as required by SMBIOS Spec 7.2.1.
  - smbios_write_fails_with_too_small_memory: verify that setup_smbios
    fails with Error::WriteData when guest memory is too small to hold
    anything beyond the entry point.

All tests also succeed when run with miri:
  cargo +nightly miri test -p arch smbios

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
@Coffeeri Coffeeri force-pushed the feat/smbios-system-chassis branch from 2cee9fa to 602510f Compare February 10, 2026 13:39
@Coffeeri Coffeeri enabled auto-merge (rebase) February 10, 2026 13:40
@Coffeeri Coffeeri merged commit 2ea9d6a into cyberus-technology:gardenlinux Feb 10, 2026
11 checks passed
@Coffeeri Coffeeri deleted the feat/smbios-system-chassis branch February 10, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants