Skip to content

patina_smbios: Add SMBIOS types#1501

Merged
kat-perez merged 3 commits into
OpenDevicePartnership:majorfrom
kat-perez:smbios-types-cr-finish
May 12, 2026
Merged

patina_smbios: Add SMBIOS types#1501
kat-perez merged 3 commits into
OpenDevicePartnership:majorfrom
kat-perez:smbios-types-cr-finish

Conversation

@kat-perez
Copy link
Copy Markdown
Contributor

@kat-perez kat-perez commented May 6, 2026

Description

Define types for SMBIOS records according the SMBIOS specs 3.0+ and update records to use types. These structs/enums/bitfields force typing when creating SMBIOS records.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

cargo make all, plus patina-dxe-core-qemu integration: ported the Q35 and
SBSA SMBIOS platform components onto the new typed records, booted Q35 in
QEMU, and confirmed q35_smbios_ffi_test passes against the published SMBIOS
table.

Integration Instructions

Downstream consumers of patina_smbios Type 0 / 1 / 2 / 3 / 4 / 7 / 16 / 17 /
19 records must construct fields with the new types instead of raw integers
(e.g. BiosCharacteristics::from_bits(0x08), WakeUpType::PowerSwitch,
BootUpState::Safe). For Type 4, set processor_family: u8 = 0xFE and put
the typed value in processor_family2.

Co-Authored-By: Ansley Thompson ansley.thompson@dell.com

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented May 6, 2026

QEMU Validation Failed

QEMU validation did not complete successfully or did not shutdown as expected.

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/25705078406

⚠️ Build Failure Detected

The Setup and Build patina-dxe-core-qemu step failed in the following job(s):

  • Run Patina QEMU Validation / Validate QEMU Q35 (Windows)
  • Run Patina QEMU Validation / Validate QEMU - SBSA (Linux)
  • Run Patina QEMU Validation / Validate QEMU - Q35 (Linux)

Build logs are available in the workflow run artifacts:

Download the log artifacts from the workflow run to review the build output and
determine whether the error is expected.

Is this expected? If the PR introduces breaking changes to patina that
require a corresponding update to patina-dxe-core-qemu,
the build failure is expected.

Contact a repo admin or PR reviewer to override the Patina QEMU PR Validation status check.

Job Results

Job Result
Gather Incoming PR Metadata
Run Patina QEMU Validation / Preflight Checks
Run Patina QEMU Validation / Post In-Progress Notification
Run Patina QEMU Validation / Get Constants / Get Repository Constants
Run Patina QEMU Validation / Validate QEMU Q35 (Windows)
Run Patina QEMU Validation / Validate QEMU - SBSA (Linux)
Run Patina QEMU Validation / Validate QEMU - Q35 (Linux)
Run Patina QEMU Validation / Emit PR Metadata

Error Details

qemu-validation-logs-Windows-Q35/q35-windows.log (14 error/warning sections)
… (truncated)
error[E0308]: mismatched types
  --> src\q35\component\service\smbios_platform.rs:97:27
   |
97 |             wake_up_type: 0x06, // Power Switch
   |                           ^^^^ expected `WakeUpType`, found integer


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:122:27
    |
122 |             bootup_state: 0x03,
    |                           ^^^^ expected `BootUpState`, found integer


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:123:33
    |
123 |             power_supply_state: 0x03,
    |                                 ^^^^ expected `PowerSupplyState`, found integer


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:124:28
    |
124 |             thermal_state: 0x03,
    |                            ^^^^ expected `ThermalState`, found integer


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:125:30
    |
125 |             security_status: 0x02,
    |                              ^^^^ expected `SecurityStatus`, found integer


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:155:28
    |
155 |             feature_flags: 0x01, // Board is a hosting board
    |                            ^^^^ expected `FeatureFlags`, found integer
    |
help: call `Into::into` on this expression to convert `{integer}` into `FeatureFlags`
    |
155 |             feature_flags: 0x01.into(), // Board is a hosting board
    |                                +++++++


error[E0308]: mismatched types
   --> src\q35\component\service\smbios_platform.rs:158:25
    |
158 |             board_type: 0x0A, // Motherboard
    |                         ^^^^ expected `BoardType`, found integer

For more information about this error, try `rustc --explain E0308`.

error: could not compile `qemu_dxe_core` (lib) due to 11 previous errors

warning: build failed, waiting for other jobs to finish...

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Linux-SBSA/sbsa-linux.log (14 error/warning sections)
… (truncated)
error[E0308]: mismatched types
  --> src/q35/component/service/smbios_platform.rs:97:27
   |
97 |             wake_up_type: 0x06, // Power Switch
   |                           ^^^^ expected `WakeUpType`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:122:27
    |
122 |             bootup_state: 0x03,
    |                           ^^^^ expected `BootUpState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:123:33
    |
123 |             power_supply_state: 0x03,
    |                                 ^^^^ expected `PowerSupplyState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:124:28
    |
124 |             thermal_state: 0x03,
    |                            ^^^^ expected `ThermalState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:125:30
    |
125 |             security_status: 0x02,
    |                              ^^^^ expected `SecurityStatus`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:155:28
    |
155 |             feature_flags: 0x01, // Board is a hosting board
    |                            ^^^^ expected `FeatureFlags`, found integer
    |
help: call `Into::into` on this expression to convert `{integer}` into `FeatureFlags`
    |
155 |             feature_flags: 0x01.into(), // Board is a hosting board
    |                                +++++++


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:158:25
    |
158 |             board_type: 0x0A, // Motherboard
    |                         ^^^^ expected `BoardType`, found integer

For more information about this error, try `rustc --explain E0308`.

error: could not compile `qemu_dxe_core` (lib) due to 11 previous errors

warning: build failed, waiting for other jobs to finish...

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Linux-Q35/q35-linux.log (14 error/warning sections)
… (truncated)
error[E0308]: mismatched types
  --> src/q35/component/service/smbios_platform.rs:97:27
   |
97 |             wake_up_type: 0x06, // Power Switch
   |                           ^^^^ expected `WakeUpType`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:122:27
    |
122 |             bootup_state: 0x03,
    |                           ^^^^ expected `BootUpState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:123:33
    |
123 |             power_supply_state: 0x03,
    |                                 ^^^^ expected `PowerSupplyState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:124:28
    |
124 |             thermal_state: 0x03,
    |                            ^^^^ expected `ThermalState`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:125:30
    |
125 |             security_status: 0x02,
    |                              ^^^^ expected `SecurityStatus`, found integer


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:155:28
    |
155 |             feature_flags: 0x01, // Board is a hosting board
    |                            ^^^^ expected `FeatureFlags`, found integer
    |
help: call `Into::into` on this expression to convert `{integer}` into `FeatureFlags`
    |
155 |             feature_flags: 0x01.into(), // Board is a hosting board
    |                                +++++++


error[E0308]: mismatched types
   --> src/q35/component/service/smbios_platform.rs:158:25
    |
158 |             board_type: 0x0A, // Motherboard
    |                         ^^^^ expected `BoardType`, found integer

For more information about this error, try `rustc --explain E0308`.

error: could not compile `qemu_dxe_core` (lib) due to 11 previous errors

warning: build failed, waiting for other jobs to finish...

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101

Dependencies

Repository Ref
patina f90974a
patina-dxe-core-qemu 6daf784
patina-fw-patcher 6d365f9
patina-qemu firmware v3.0.0
patina-qemu build script e0231b7

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact impact:testing Affects testing labels May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 94.81481% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
components/patina_smbios/src/smbios_types.rs 0.00% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kat-perez
Copy link
Copy Markdown
Contributor Author

@makubacki Can I please get help with overriding the QEMU PR validation? This is expected to fail and a follow-up PR will be opened in patina-dxe-core-qemu to address the breaking changes

@kat-perez kat-perez mentioned this pull request May 6, 2026
5 tasks
@kat-perez kat-perez marked this pull request as ready for review May 6, 2026 22:47
@kat-perez kat-perez force-pushed the smbios-types-cr-finish branch from e5edd4b to 24df4cf Compare May 7, 2026 15:33
Comment thread components/patina_smbios/src/service.rs Outdated
Comment thread components/patina_smbios/src/smbios_record.rs Outdated
@makubacki
Copy link
Copy Markdown
Collaborator

@makubacki Can I please get help with overriding the QEMU PR validation? This is expected to fail and a follow-up PR will be opened in patina-dxe-core-qemu to address the breaking changes

We can do that. This would probably be a better target for the major branch instead of main though so we can pull it into a single release with other pending breaking changes.

@kat-perez kat-perez changed the base branch from main to major May 7, 2026 19:04
ansleythompson and others added 2 commits May 7, 2026 15:25
Define types for SMBIOS records according the SMBIOS specs 3.0+ and update records to use types.
These structs/enums/bitfields force typing when creating SMBIOS records
- Migrate bitfields to bitfield-struct and derive zerocopy::IntoBytes
- Tag enums with repr(u8/u16) and derive IntoBytes
- Fix BootUpState and PowerSupplyState per SMBIOS spec Table 17
- Use workspace bitfield-struct in patina_smbios

Co-Authored-By: Ansley Thompson <ansley.thompson@dell.com>
@kat-perez kat-perez force-pushed the smbios-types-cr-finish branch from dfe6ff3 to d4fb98b Compare May 7, 2026 19:26
@kat-perez
Copy link
Copy Markdown
Contributor Author

We can do that. This would probably be a better target for the major branch instead of main though so we can pull it into a single release with other pending breaking changes.

Thanks, retargeted for major

Comment thread components/patina_smbios/src/smbios_types.rs
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
Comment thread cspell.yml Outdated
Comment thread cspell.yml
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
Comment thread components/patina_smbios/src/smbios_types.rs Outdated
@kat-perez kat-perez force-pushed the smbios-types-cr-finish branch from d4fb98b to e8d3f73 Compare May 11, 2026 23:08
@kat-perez kat-perez requested a review from makubacki May 11, 2026 23:11
@kat-perez kat-perez force-pushed the smbios-types-cr-finish branch from e8d3f73 to 96c2a2f Compare May 11, 2026 23:58
- Use fluent with_*() chains in tests instead of from_bits magic numbers
- Drop redundant trailing comments now that variant names self-describe
@kat-perez kat-perez force-pushed the smbios-types-cr-finish branch from 96c2a2f to f90974a Compare May 12, 2026 00:01
@kat-perez kat-perez merged commit f87a756 into OpenDevicePartnership:major May 12, 2026
12 of 13 checks passed
@kat-perez kat-perez deleted the smbios-types-cr-finish branch May 12, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact impact:testing Affects testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants