patina-v10.0.0
What's Changed
-
chore: Release v9.0.0 @makubacki (#798)
Change Details
## Description
Version update for the 9.0.0 release.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A
Integration Instructions
N/A
⚠️ Breaking Changes
-
Add Patina GUID Type [Rebase \& FF] @makubacki (#788)
Change Details
## Description
Closes #787
patina_sdk: Rename guid module to guids
Place GUID constants in a
guidsmodule instead ofguid.This prepares for a Patina SDK GUID type by clarifying the type of
GUID content in the crate namespace and is more natural to use when
refering to these constants.
patina_sdk: Move guid::FmtGuid to base::guid::Guid
Moves the existing
FmtGuidtype under thebasemodule. Re-exports
the type aspatina_sdk::Guidso it is simpler to refer to and
simply viewed at the "Patina SDK GUID type".
patina_sdk: Add Patina GUID type
The Patina GUID type is essentially a wrapper around the
r_efiGUID
type that is opinionated, more featured, and easier to use. It is
recommended to use the Patina SDK GUID type for all Patina code
moving forward.There are two new GUID types (1)
Guid<'a>for borrowed GUIDs and
(2)OwnedGuidfor owned GUIDs with static lifetime.- Flexible construction: Support for creating GUIDs from both
efi::Guidreferences and validated string representations - String support: Handles multiple input formats such as hyphenated,
compact (non-hyphenated), and case-insensitive strings without
validation that returns a customGuidErrortype - Performance benchmarks: Benchmarks are added to compare Patina GUID
operations againstr_efi - Examples: An examples file is added to to demonstrate how to use
the Patina GUID in common scenarios
String formats supported:
- "Standard" hyphenated format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - "Compact" format without hyphens:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Note: Strings are case insensitive and whitespace is cleaned up.
C interoperability with r_efi types is maintained while providing
easier-to-use Rust APIs. GUID operations do not use heap allocations.
patina_sdk: Use the Patina GUID
Updates several locations in patina_sdk to use the new Patina GUID
type.
Benchmark Data
Benchmark Implementation Time Outliers guid_creation patina_from_ref 1.0672 ns - 1.0733 ns 13/100 (4 high mild, 9 high severe) guid_creation patina_try_from_string 72.601 ns - 75.601 ns 15/100 (4 high mild, 11 high severe) guid_creation r_efi_direct 4.0607 ns - 4.0680 ns 13/100 (1 low severe, 1 low mild, 3 high mild, 8 high severe) guid_display patina_format 550.20 ns - 558.39 ns 16/100 (6 high mild, 10 high severe) guid_display r_efi_manual_format 466.87 ns - 544.24 ns 19/100 (1 high mild, 18 high severe) guid_comparison patina_eq_same 3.1442 ns - 3.1607 ns 16/100 (6 high mild, 10 high severe) guid_comparison patina_eq_different 3.1512 ns - 3.1968 ns 9/100 (9 high severe) guid_comparison r_efi_eq_same 313.05 ps - 314.69 ps 8/100 (1 high mild, 7 high severe) guid_comparison r_efi_eq_different 312.94 ps - 315.12 ps 20/100 (1 low severe, 2 low mild, 4 high mild, 13 high severe) guid_complex_operations patina_complex_10 7.2226 µs - 7.3132 µs 13/100 (1 high mild, 12 high severe) guid_complex_operations patina_complex_100 73.048 µs - 74.131 µs 14/100 (3 high mild, 11 high severe) guid_complex_operations patina_complex_1000 721.02 µs - 729.48 µs 14/100 (2 high mild, 12 high severe) guid_complex_operations r_efi_complex_10 4.8560 µs - 4.8733 µs 10/100 (2 high mild, 8 high severe) guid_complex_operations r_efi_complex_100 48.444 µs - 48.676 µs 11/100 (5 high mild, 6 high severe) guid_complex_operations r_efi_complex_1000 481.68 µs - 485.30 µs 18/100 (8 low mild, 1 high mild, 9 high severe) Note: I've already optimized some operations in the Patina GUID implementation to get to these numbers. Since this is a wrapper type, it will always be more computationally expensive. The benchmark was added to get to "reasonable" numbers for now, but also to improve and track perf of the implementation moving forward.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all- Benchmark
- Example execution
- Documentation review
- QEMU Q35 boot to EFI shell
Integration Instructions
- Update any references to
patina_sdk::guidto use the constants now located inpatina_sdk::guids - Use the Patina SDK GUID in Patina code
- Flexible construction: Support for creating GUIDs from both
-
Remove `FunctionComponent` implementation @Javagedes (#744)
Change Details
## Description
Reference implementation for #741
This commit removes the
FunctionComponentstruct, associated blanket
IntoComponentimplementation for functions, tests, and examples.
Additionally, it updates all relevant documentation to reflect this
change.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
CI
Integration Instructions
Remove any usage of function components. They can easily be made into struct components in the follwoing example:
fn reference_function_component(Config<MyConfig>) ->Result<()> { Ok(()) } // Struct component keeping the same name #[derive(IntoComponent)] #[entry_point(path = Self::reference_function_component)] struct NewComponent; impl NewComponent { fn reference_function_component(&self, Config<MyConfig>) ->Result<()> { Ok(()) } } // Struct component changing the name #[derive(IntoComponent)] struct NewComponent; impl NewComponent { fn entry_point(&self, Config<MyConfig>) ->Result<()> { Ok(()) } }
</blockquote> <hr> </details>
🚀 Features & ✨ Enhancements
-
Add Patina GUID Type [Rebase \& FF] @makubacki (#788)
Change Details
## Description
Closes #787
patina_sdk: Rename guid module to guids
Place GUID constants in a
guidsmodule instead ofguid.This prepares for a Patina SDK GUID type by clarifying the type of
GUID content in the crate namespace and is more natural to use when
refering to these constants.
patina_sdk: Move guid::FmtGuid to base::guid::Guid
Moves the existing
FmtGuidtype under thebasemodule. Re-exports
the type aspatina_sdk::Guidso it is simpler to refer to and
simply viewed at the "Patina SDK GUID type".
patina_sdk: Add Patina GUID type
The Patina GUID type is essentially a wrapper around the
r_efiGUID
type that is opinionated, more featured, and easier to use. It is
recommended to use the Patina SDK GUID type for all Patina code
moving forward.There are two new GUID types (1)
Guid<'a>for borrowed GUIDs and
(2)OwnedGuidfor owned GUIDs with static lifetime.- Flexible construction: Support for creating GUIDs from both
efi::Guidreferences and validated string representations - String support: Handles multiple input formats such as hyphenated,
compact (non-hyphenated), and case-insensitive strings without
validation that returns a customGuidErrortype - Performance benchmarks: Benchmarks are added to compare Patina GUID
operations againstr_efi - Examples: An examples file is added to to demonstrate how to use
the Patina GUID in common scenarios
String formats supported:
- "Standard" hyphenated format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - "Compact" format without hyphens:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Note: Strings are case insensitive and whitespace is cleaned up.
C interoperability with r_efi types is maintained while providing
easier-to-use Rust APIs. GUID operations do not use heap allocations.
patina_sdk: Use the Patina GUID
Updates several locations in patina_sdk to use the new Patina GUID
type.
Benchmark Data
Benchmark Implementation Time Outliers guid_creation patina_from_ref 1.0672 ns - 1.0733 ns 13/100 (4 high mild, 9 high severe) guid_creation patina_try_from_string 72.601 ns - 75.601 ns 15/100 (4 high mild, 11 high severe) guid_creation r_efi_direct 4.0607 ns - 4.0680 ns 13/100 (1 low severe, 1 low mild, 3 high mild, 8 high severe) guid_display patina_format 550.20 ns - 558.39 ns 16/100 (6 high mild, 10 high severe) guid_display r_efi_manual_format 466.87 ns - 544.24 ns 19/100 (1 high mild, 18 high severe) guid_comparison patina_eq_same 3.1442 ns - 3.1607 ns 16/100 (6 high mild, 10 high severe) guid_comparison patina_eq_different 3.1512 ns - 3.1968 ns 9/100 (9 high severe) guid_comparison r_efi_eq_same 313.05 ps - 314.69 ps 8/100 (1 high mild, 7 high severe) guid_comparison r_efi_eq_different 312.94 ps - 315.12 ps 20/100 (1 low severe, 2 low mild, 4 high mild, 13 high severe) guid_complex_operations patina_complex_10 7.2226 µs - 7.3132 µs 13/100 (1 high mild, 12 high severe) guid_complex_operations patina_complex_100 73.048 µs - 74.131 µs 14/100 (3 high mild, 11 high severe) guid_complex_operations patina_complex_1000 721.02 µs - 729.48 µs 14/100 (2 high mild, 12 high severe) guid_complex_operations r_efi_complex_10 4.8560 µs - 4.8733 µs 10/100 (2 high mild, 8 high severe) guid_complex_operations r_efi_complex_100 48.444 µs - 48.676 µs 11/100 (5 high mild, 6 high severe) guid_complex_operations r_efi_complex_1000 481.68 µs - 485.30 µs 18/100 (8 low mild, 1 high mild, 9 high severe) Note: I've already optimized some operations in the Patina GUID implementation to get to these numbers. Since this is a wrapper type, it will always be more computationally expensive. The benchmark was added to get to "reasonable" numbers for now, but also to improve and track perf of the implementation moving forward.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all- Benchmark
- Example execution
- Documentation review
- QEMU Q35 boot to EFI shell
Integration Instructions
- Update any references to
patina_sdk::guidto use the constants now located inpatina_sdk::guids - Use the Patina SDK GUID in Patina code
- Flexible construction: Support for creating GUIDs from both
-
Return Handles in Creation order; adjust verbosity for protocol install/uninstall messages. [Rebase \& FF] @joschock (#797)
Change Details
## Description
This PR makes two commits to change the protocol DB implementation:
Handle Database behavior updates
- Add support for tracking creation time for handles so that they are returned in creation order for query functions like
LocateHandleBuffer - (minor)
registered_protocolsupdated to return only unique protocols (no duplicates)
Handle Database message verbosity
- (minor) Adjust verbosity of install/uninstall protocol interface messages to align with traditional verbosity in EDK2 core.
Returning handles in creation order is not a UEFI spec requirement, but returning them in creation order is behavior that a number of subsystems (even within patina) rely on for reasonable behavior. An example within patina is if multiple FVs are defined via HOBs at the start of DXE, they should be dispatched in the order that they are reported to the core. Without creation ordering on the handle query for new FVs, the dispatcher will discover and process the FVs in arbitrary order.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Passes unit tests, executes on hardware platform without observed issues.
Integration Instructions
N/A
</blockquote> <hr> </details> - Add support for tracking creation time for handles so that they are returned in creation order for query functions like
-
Remove `FunctionComponent` implementation @Javagedes (#744)
Change Details
## Description
Reference implementation for #741
This commit removes the
FunctionComponentstruct, associated blanket
IntoComponentimplementation for functions, tests, and examples.
Additionally, it updates all relevant documentation to reflect this
change.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
CI
Integration Instructions
Remove any usage of function components. They can easily be made into struct components in the follwoing example:
fn reference_function_component(Config<MyConfig>) ->Result<()> { Ok(()) } // Struct component keeping the same name #[derive(IntoComponent)] #[entry_point(path = Self::reference_function_component)] struct NewComponent; impl NewComponent { fn reference_function_component(&self, Config<MyConfig>) ->Result<()> { Ok(()) } } // Struct component changing the name #[derive(IntoComponent)] struct NewComponent; impl NewComponent { fn entry_point(&self, Config<MyConfig>) ->Result<()> { Ok(()) } }
</blockquote> <hr> </details>
📖 Documentation Updates
-
Add Patina GUID Type [Rebase \& FF] @makubacki (#788)
Change Details
## Description
Closes #787
patina_sdk: Rename guid module to guids
Place GUID constants in a
guidsmodule instead ofguid.This prepares for a Patina SDK GUID type by clarifying the type of
GUID content in the crate namespace and is more natural to use when
refering to these constants.
patina_sdk: Move guid::FmtGuid to base::guid::Guid
Moves the existing
FmtGuidtype under thebasemodule. Re-exports
the type aspatina_sdk::Guidso it is simpler to refer to and
simply viewed at the "Patina SDK GUID type".
patina_sdk: Add Patina GUID type
The Patina GUID type is essentially a wrapper around the
r_efiGUID
type that is opinionated, more featured, and easier to use. It is
recommended to use the Patina SDK GUID type for all Patina code
moving forward.There are two new GUID types (1)
Guid<'a>for borrowed GUIDs and
(2)OwnedGuidfor owned GUIDs with static lifetime.- Flexible construction: Support for creating GUIDs from both
efi::Guidreferences and validated string representations - String support: Handles multiple input formats such as hyphenated,
compact (non-hyphenated), and case-insensitive strings without
validation that returns a customGuidErrortype - Performance benchmarks: Benchmarks are added to compare Patina GUID
operations againstr_efi - Examples: An examples file is added to to demonstrate how to use
the Patina GUID in common scenarios
String formats supported:
- "Standard" hyphenated format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - "Compact" format without hyphens:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Note: Strings are case insensitive and whitespace is cleaned up.
C interoperability with r_efi types is maintained while providing
easier-to-use Rust APIs. GUID operations do not use heap allocations.
patina_sdk: Use the Patina GUID
Updates several locations in patina_sdk to use the new Patina GUID
type.
Benchmark Data
Benchmark Implementation Time Outliers guid_creation patina_from_ref 1.0672 ns - 1.0733 ns 13/100 (4 high mild, 9 high severe) guid_creation patina_try_from_string 72.601 ns - 75.601 ns 15/100 (4 high mild, 11 high severe) guid_creation r_efi_direct 4.0607 ns - 4.0680 ns 13/100 (1 low severe, 1 low mild, 3 high mild, 8 high severe) guid_display patina_format 550.20 ns - 558.39 ns 16/100 (6 high mild, 10 high severe) guid_display r_efi_manual_format 466.87 ns - 544.24 ns 19/100 (1 high mild, 18 high severe) guid_comparison patina_eq_same 3.1442 ns - 3.1607 ns 16/100 (6 high mild, 10 high severe) guid_comparison patina_eq_different 3.1512 ns - 3.1968 ns 9/100 (9 high severe) guid_comparison r_efi_eq_same 313.05 ps - 314.69 ps 8/100 (1 high mild, 7 high severe) guid_comparison r_efi_eq_different 312.94 ps - 315.12 ps 20/100 (1 low severe, 2 low mild, 4 high mild, 13 high severe) guid_complex_operations patina_complex_10 7.2226 µs - 7.3132 µs 13/100 (1 high mild, 12 high severe) guid_complex_operations patina_complex_100 73.048 µs - 74.131 µs 14/100 (3 high mild, 11 high severe) guid_complex_operations patina_complex_1000 721.02 µs - 729.48 µs 14/100 (2 high mild, 12 high severe) guid_complex_operations r_efi_complex_10 4.8560 µs - 4.8733 µs 10/100 (2 high mild, 8 high severe) guid_complex_operations r_efi_complex_100 48.444 µs - 48.676 µs 11/100 (5 high mild, 6 high severe) guid_complex_operations r_efi_complex_1000 481.68 µs - 485.30 µs 18/100 (8 low mild, 1 high mild, 9 high severe) Note: I've already optimized some operations in the Patina GUID implementation to get to these numbers. Since this is a wrapper type, it will always be more computationally expensive. The benchmark was added to get to "reasonable" numbers for now, but also to improve and track perf of the implementation moving forward.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all- Benchmark
- Example execution
- Documentation review
- QEMU Q35 boot to EFI shell
Integration Instructions
- Update any references to
patina_sdk::guidto use the constants now located inpatina_sdk::guids - Use the Patina SDK GUID in Patina code
- Flexible construction: Support for creating GUIDs from both
Full Changelog: patina-v9.0.0...v10.0.0