patina_smbios: Use zerocopy::IntoBytes for SMBIOS record serialization#1451
Merged
kat-perez merged 1 commit intoOpenDevicePartnership:mainfrom Apr 6, 2026
Merged
Conversation
Contributor
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/23960751784 Boot Time to EFI Shell
Dependencies
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
b524c98 to
be8e6dd
Compare
os-d
reviewed
Apr 2, 2026
732fc76 to
4a0a26d
Compare
Javagedes
approved these changes
Apr 2, 2026
makubacki
reviewed
Apr 2, 2026
d10f11e to
a4bf89b
Compare
Replace the hardcoded type name list in the SmbiosRecord derive macro with zerocopy::IntoBytes::as_bytes(). Any type that implements IntoBytes can now be used as an SMBIOS record field without modifying the macro.
a4bf89b to
82b8f1c
Compare
makubacki
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace the primitive type whitelist in the
SmbiosRecordderive macro withzerocopy::IntoBytes::as_bytes(). The macro no longer validates field types at expansion time — instead, any type that implementsIntoBytesis accepted, with type checking deferred to the compiler.This means new SMBIOS field types (enums, bitfields, etc.) can be added by deriving
IntoByteswithout modifying the macro.Re-export
zerocopyfrompatina_smbiosso consuming crates don't need a direct dependency.How This Was Tested
cargo make allpassesIntegration Instructions
SMBIOS record fields must implement
zerocopy::IntoBytes. All primitive types already do. Custom types need#[derive(IntoBytes)]with an appropriate#[repr(...)].