Increase Patina GUID Usage [Rebase & FF]#1391
Merged
makubacki merged 4 commits intoOpenDevicePartnership:mainfrom Mar 16, 2026
Merged
Increase Patina GUID Usage [Rebase & FF]#1391makubacki merged 4 commits intoOpenDevicePartnership:mainfrom
makubacki merged 4 commits intoOpenDevicePartnership:mainfrom
Conversation
Contributor
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/23165210991 Boot Time to EFI Shell
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! |
8ff4f4c to
0f3d4b6
Compare
os-d
approved these changes
Mar 13, 2026
kuqin12
approved these changes
Mar 13, 2026
vineelko
approved these changes
Mar 16, 2026
5 tasks
0f3d4b6 to
8827e7a
Compare
This function wraps `efi::Guid::from_bytes()` which is const. It is made const as well. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Add Ord and PartialOrd derives to BinaryGuid, enabling its use as a BTreeMap key. Adds a test to verify BinaryGuid's derived ordering matches Guid<'a>'s byte-order comparison for a set of GUID pairs. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This change adds a few standard GUID definitions. This is to pave way for later usage in rust supervisor.
Converts all GUID constants, trait associated types, struct fields, and other uses to Patina GUID types across the codebase. Key changes: - GUID constants mostly use `BinaryGuid::from_string()` since strings are more readable than fields. In some cases, a field may have been a simple numbering sequence like "123456...", in which case it may have been left as `from_fields`. - Changed `ProtocolInterface::PROTOCOL_GUID` changed to use `BinaryGuid`, eliminating duplicated GUID values in implementations. - Updated `FromHob::HOB_GUID` and `HobParser`s `BTreeMap` key to `BinaryGuid`. - Updated `#[repr(C)]` struct fields (GuidHob, FV/FFS headers, MM communicate header) to use `BinaryGuid` since it provides binary-compatible GUID storage. - Updated the `FromHob` proc macro to use `BinaryGuid::from_string()`. - Updated a lot of code to use Patina GUID types instead of the r-efi GUID type. There were a few places, particularly in UEFI Spec FFI interfaces, where the `efi::Guid` type is still used. This is intentional to potentially simplify the r-efi 6.0.0 integration. In code that interacts with those interfaces, `From` and `Into` functions are used to simply convert between `BinaryGuid` and `efi::Guid`. Some code that exclusively interacts with those interfaces, might also use `efi::Guid` for local GUID definitions instead of Patina GUID types. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
8827e7a to
c66ba2b
Compare
Collaborator
Author
|
Note: Patina QEMU PR Validation boot failure is expected until a patina-qemu release that fixes the issue described in OpenDevicePartnership/patina-dxe-core-qemu#142 is made. |
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
A series of commits to increase adoption of Patina GUID types in the codebase.
sdk: Make BinaryGuid::from_bytes() const
This function wraps
efi::Guid::from_bytes()which is const. It ismade const as well.
BinaryGuid: Derive Ord and PartialOrd
Add Ord and PartialOrd derives to BinaryGuid, enabling its use as a
BTreeMap key.
Adds a test to verify BinaryGuid's derived ordering matches Guid<'a>'s
byte-order comparison for a set of GUID pairs.
guid: Convert GUID types to BinaryGuid
Resolves #1105
Converts all GUID constants, trait associated types, struct fields,
and other uses to Patina GUID types across the codebase.
Key changes:
BinaryGuid::from_string()since stringsare more readable than fields. In some cases, a field may have been
a simple numbering sequence like "123456...", in which case it may
have been left as
from_fields.ProtocolInterface::PROTOCOL_GUIDchanged to useBinaryGuid, eliminating duplicated GUID values in implementations.FromHob::HOB_GUIDandHobParsersBTreeMapkey toBinaryGuid.#[repr(C)]struct fields (GuidHob, FV/FFS headers,MM communicate header) to use
BinaryGuidsince it providesbinary-compatible GUID storage.
FromHobproc macro to useBinaryGuid::from_string().GUID type.
There were a few places, particularly in UEFI Spec FFI interfaces,
where the
efi::Guidtype is still used. This is intentional topotentially simplify the r-efi 6.0.0 integration. In code that
interacts with those interfaces,
FromandIntofunctions are usedto simply convert between
BinaryGuidandefi::Guid. Some codethat exclusively interacts with those interfaces, might also use
efi::Guidfor local GUID definitions instead of Patina GUID types.How This Was Tested
cargo make allIntegration Instructions