patina_smbios: Add SMBIOS types#1501
Conversation
QEMU Validation FailedQEMU validation did not complete successfully or did not shutdown as expected. Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/25705078406
|
| 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.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
b36436b to
e5edd4b
Compare
|
@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 |
e5edd4b to
24df4cf
Compare
We can do that. This would probably be a better target for the |
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>
dfe6ff3 to
d4fb98b
Compare
Thanks, retargeted for |
d4fb98b to
e8d3f73
Compare
e8d3f73 to
96c2a2f
Compare
- Use fluent with_*() chains in tests instead of from_bits magic numbers - Drop redundant trailing comments now that variant names self-describe
96c2a2f to
f90974a
Compare
f87a756
into
OpenDevicePartnership:major
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.
How This Was Tested
cargo make all, plus patina-dxe-core-qemu integration: ported the Q35 andSBSA SMBIOS platform components onto the new typed records, booted Q35 in
QEMU, and confirmed
q35_smbios_ffi_testpasses against the published SMBIOStable.
Integration Instructions
Downstream consumers of
patina_smbiosType 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, setprocessor_family: u8 = 0xFEand putthe typed value in
processor_family2.Co-Authored-By: Ansley Thompson ansley.thompson@dell.com