patina-v23.0.0
What's Changed
This release has several breaking changes. See the Breaking Changes section for details.
⚠️ Breaking Changes
-
Integrate major branch changes into main [REBASE \& FF] @cfernald (#1671)
Change Details
## Description
Merged the following changes from the major branch
PR #1628 — [major] Refactor performance into core service
Description
This PR addresses multiple issues with the current performance structure:
- Performance data is not available until the component is dispatched. This can cause significant
misrepresentation of the DXE execution time and cause events from images to be lost if not
dispatched in the first loop. - Performance implementations in the SDK require SDK statics, which is generally an SDK antipattern.
This PR does the following:
- Moves the core performance implementation into the core, into a new struct named
CorePerformance,
following the pattern established by the timer and memory management. - Creates a new service trait
PerformanceMeasurementthat exposes this core support. - Updates the component to now use this core service to produce the protocol & publish tables.
- Change initialization and configuration of performance measurements to be done by the core.
- Updates all documentation according to these changes.
- Some smaller rework and restructuring.
Resolves: #1483
Reviewing this PR
This PR is intended to be merged as a single commit. The individual commits do attempt to follow a
basic progression of the code rework but may be incomplete at the partial steps. Recommended review flow:- Start with the new theory of operation md (
performance_measurement.md) to understand the intended structure. - Review the new service interface (
PerformanceMeasurement). - Review the new core implementation.
- Review the changes to the component to consume the new service.
PR #1630 — [major] Remove
SerialIOinterior mutability and cleanup serial implementations [REBASE & FF]Description
Change SerialIO trait to be mutable
The current
SerialIOimplementation takes&selfinstead of&mut selffor its methods, forcing
all serial implementations to implement interior mutability. However, because of the nature of the
serial port use cases, the typical locking mechanisms that avoid deadlocks, such as theTplMutex,
are not readily accessible. Because of this, internal implementations have one-off, and at times
questionable, interior mutability implementations.This commit removes the expectation on the serial port to ensure this, and instead provides a
re-usableSharedSerialwrapper that implements interior mutability in a suitable way for serial
port use cases.patina: Simplify serial implementations
This commit takes advantage of the new mutable references to cleanup the serial port implementations.
Namely by dropping re-initialization of interior references used as a workaround for the lack of
mutability in theSerialIOtrait.patina: split uart module submodules
This commit splits the null, 16550, and pl011 UART implementations into their own submodules under
theuartmodule. This better aligns to general code organization practices. This additionally
removes some unnecessary conditional complication.
PR #1643 — [major] patina_debugger: remove deprecated
without_transport_initfunctionDescription
This PR removes the deprecated
without_transport_initfunction for the next major release. This
function is now a no-op and the inverse functionwith_transport_initis now the control for this behavior.
PR #1646 — [major] Refactor Patina SDK for stronger code organization [REBASE & FF]
Description
This PR organizes the SDK into well-defined modules, and moves code and modules into their appropriate location.
The main goals of this refactor are to:
- Introduce better hierarchy for modules for definitions based on their use.
- Normalize paths between modules for consistency.
- Standardize naming conventions.
- Document these decisions for future consistency.
Reviewing this PR
The commits have been organized into a basic pattern for the sake of review. All the Patina SDK
changes are kept in their own commits and all the mass-edits for consumers are kept in separate
squash: ...commits. This is to keep the core changes clear and reviewable; these are squashed
into their respective change before merging.There are three significant steps in this PR:
- Republish r_efi
- Move files to individual modules
- Refactor code and names in modules for consistency
Top level modules
Module Description arch Abstractions for architecture specific functionality (e.g. caching) and architecture specific functions. component Component and service definitions for the dependency-injected component model. debug Macros and definitions for logging and diagnostics. management_mode Definitions for Management Mode (MM/SMM) interactions. mmio Re-export of the safe-mmio crate for memory-mapped I/O access. performance Performance measurement types, records, and related GUIDs. peripheral Abstractions and implementations for core device operations. pi Platform Initialization (PI) specification definitions and wrappers. uefi UEFI specification definitions and wrappers. A detailed before/after view of the "New Patina Structure" is included in the original PR, showing the
reorganization of files (e.g.serial.rs→standard.rs,uefi_protocol→protocol,
protocols→protocol, newperipheralanddebugmodules, r_efi re-export viastandard, etc.).
PR #1660 — [major] Remove unnecessary protocol definitions from SDK
Description
Moves several protocol definitions from the
uefimodule in the SDK to their appropriate location:DecompressProtocol: A duplicate definition withr_efithat carried implementation details that were not needed in the SDK.- Switched to use the
r_efiversion directly. - Moved implementation to dxe_core.
- Switched to use the
EdkiiPerformanceMeasurementProtocol: An EDKII protocol, that should only be produced and not consumed by Patina code.- Moved the definition to
patina_performancethat produces the protocol.
- Moved the definition to
StatusCodeRuntimeProtocol: A wrapper around the PI definition providing a convenience function.- Moved the convenience function directly onto the
pimodule definition.
- Moved the convenience function directly onto the
PR #1666 — [major] SDK Refactor: Republish base, update consumers, and cleanup [REBASE & FF]
Description
Second phase of large Patina SDK refactor, including:
Add
CorePerformanceto servicesThe performance refactor left out declaring the
CorePerformanceservice in the derive service macro
forCorePerformance. This commit simply adds the missing service declaration.SDK Refactor: Consume r_efi republish from patina crate
This commit changes all uses of r_efi in the patina repo to instead use the r_efi republished from
the patina crate, and removes r_efi from individual cargo dependencies.SDK Refactor: Publish all of base from Patina root
This commit republishes all of
Patina::base::*from the Patina root. This flattens callers' imports
and makes accessing common base types easier.patina: Scope allow(static_mut_refs) only to necessary tests
Moves the global
#![allow(static_mut_refs)]attributes to the test modules that require it, rather
than having it at the crate level. This change improves code safety and clarity by limiting the scope
of this allowance to only where it's needed.
PR #1669 — [major] Breaking changes for Patina SDK UEFI Strings [Rebase & FF]
Description
Breaking changes to use the new UEFI string
types that have been deferred until this PR to themajorbranch.sdk: Use Patina SDK UEFI string types in public APIs
This is a breaking change to public APIs in the SDK to use the new UEFI string types where appropriate.
patina_dxe_core: Use
Char16Strinfilesystems::SimpleFile::openThis is a breaking change to use
&Char16Stras the filename. Some other minor integrating changes in
patina_dxe_core for the new Patina SDK UEFI string types are included.components: Integrate Patina SDK UEFI string changes
Updates the code to use the new string types modified in public APIs used by components that were made
as breaking changes.
PR #1674 — [major] Update the MSRV to 1.90.0
Description
Closes #1673
Updates the Minimum Supported Rust Version (MSRV) to 1.90.0. This update is being made at this time to
allow dependencies with an MSRV of 1.90.0 that have security advisories to be updated.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Unit tests
- Patina tests on Q35
- Patina tests on ArmVirt
- Boot to OS on Q35
- Boot to OS on ArmVirt
Integration Instructions
Performance Refactor
Platforms must change use of with_measurements from the patina_performance to instead override PlatformInfo::default_performance_config()
SerialIOTrait Changes- All custom SerialIO implementations should drop any interior mutalability and adopt the &mut self references.
- Users of Uart16550 must swap to the new new_io and new_mmio instantiations.
Debugger Changes
Callers should remove use of
without_transport_initwhich is already deprecatedPatina SDK Refactor
This change consists of major refactoring to the SDK. Consumers should ensure the following
Consume standard::efi instead of using r_efi to ensure consistent compilation.
- Update all references to modules moved to their new location. See the "New Patina Structure" above for reference.
- Update all renamed structures to conform to their new convention-based name
It is not practical to enumerate all possible changes here, but if there is any ambiguity, reach out to the core Patina team.
String Based Interface Changes
Review the public API changes and adjust consuming code accordingly. Any callers in the patina repo are updated in this PR.
Rust Version
MSRV Updated to 1.9. Consumers must update as well.
- Performance data is not available until the component is dispatched. This can cause significant
📖 Documentation Updates
-
Integrate major branch changes into main [REBASE \& FF] @cfernald (#1671)
Change Details
## Description
Merged the following changes from the major branch
PR #1628 — [major] Refactor performance into core service
Description
This PR addresses multiple issues with the current performance structure:
- Performance data is not available until the component is dispatched. This can cause significant
misrepresentation of the DXE execution time and cause events from images to be lost if not
dispatched in the first loop. - Performance implementations in the SDK require SDK statics, which is generally an SDK antipattern.
This PR does the following:
- Moves the core performance implementation into the core, into a new struct named
CorePerformance,
following the pattern established by the timer and memory management. - Creates a new service trait
PerformanceMeasurementthat exposes this core support. - Updates the component to now use this core service to produce the protocol & publish tables.
- Change initialization and configuration of performance measurements to be done by the core.
- Updates all documentation according to these changes.
- Some smaller rework and restructuring.
Resolves: #1483
Reviewing this PR
This PR is intended to be merged as a single commit. The individual commits do attempt to follow a
basic progression of the code rework but may be incomplete at the partial steps. Recommended review flow:- Start with the new theory of operation md (
performance_measurement.md) to understand the intended structure. - Review the new service interface (
PerformanceMeasurement). - Review the new core implementation.
- Review the changes to the component to consume the new service.
PR #1630 — [major] Remove
SerialIOinterior mutability and cleanup serial implementations [REBASE & FF]Description
Change SerialIO trait to be mutable
The current
SerialIOimplementation takes&selfinstead of&mut selffor its methods, forcing
all serial implementations to implement interior mutability. However, because of the nature of the
serial port use cases, the typical locking mechanisms that avoid deadlocks, such as theTplMutex,
are not readily accessible. Because of this, internal implementations have one-off, and at times
questionable, interior mutability implementations.This commit removes the expectation on the serial port to ensure this, and instead provides a
re-usableSharedSerialwrapper that implements interior mutability in a suitable way for serial
port use cases.patina: Simplify serial implementations
This commit takes advantage of the new mutable references to cleanup the serial port implementations.
Namely by dropping re-initialization of interior references used as a workaround for the lack of
mutability in theSerialIOtrait.patina: split uart module submodules
This commit splits the null, 16550, and pl011 UART implementations into their own submodules under
theuartmodule. This better aligns to general code organization practices. This additionally
removes some unnecessary conditional complication.
PR #1643 — [major] patina_debugger: remove deprecated
without_transport_initfunctionDescription
This PR removes the deprecated
without_transport_initfunction for the next major release. This
function is now a no-op and the inverse functionwith_transport_initis now the control for this behavior.
PR #1646 — [major] Refactor Patina SDK for stronger code organization [REBASE & FF]
Description
This PR organizes the SDK into well-defined modules, and moves code and modules into their appropriate location.
The main goals of this refactor are to:
- Introduce better hierarchy for modules for definitions based on their use.
- Normalize paths between modules for consistency.
- Standardize naming conventions.
- Document these decisions for future consistency.
Reviewing this PR
The commits have been organized into a basic pattern for the sake of review. All the Patina SDK
changes are kept in their own commits and all the mass-edits for consumers are kept in separate
squash: ...commits. This is to keep the core changes clear and reviewable; these are squashed
into their respective change before merging.There are three significant steps in this PR:
- Republish r_efi
- Move files to individual modules
- Refactor code and names in modules for consistency
Top level modules
Module Description arch Abstractions for architecture specific functionality (e.g. caching) and architecture specific functions. component Component and service definitions for the dependency-injected component model. debug Macros and definitions for logging and diagnostics. management_mode Definitions for Management Mode (MM/SMM) interactions. mmio Re-export of the safe-mmio crate for memory-mapped I/O access. performance Performance measurement types, records, and related GUIDs. peripheral Abstractions and implementations for core device operations. pi Platform Initialization (PI) specification definitions and wrappers. uefi UEFI specification definitions and wrappers. A detailed before/after view of the "New Patina Structure" is included in the original PR, showing the
reorganization of files (e.g.serial.rs→standard.rs,uefi_protocol→protocol,
protocols→protocol, newperipheralanddebugmodules, r_efi re-export viastandard, etc.).
PR #1660 — [major] Remove unnecessary protocol definitions from SDK
Description
Moves several protocol definitions from the
uefimodule in the SDK to their appropriate location:DecompressProtocol: A duplicate definition withr_efithat carried implementation details that were not needed in the SDK.- Switched to use the
r_efiversion directly. - Moved implementation to dxe_core.
- Switched to use the
EdkiiPerformanceMeasurementProtocol: An EDKII protocol, that should only be produced and not consumed by Patina code.- Moved the definition to
patina_performancethat produces the protocol.
- Moved the definition to
StatusCodeRuntimeProtocol: A wrapper around the PI definition providing a convenience function.- Moved the convenience function directly onto the
pimodule definition.
- Moved the convenience function directly onto the
PR #1666 — [major] SDK Refactor: Republish base, update consumers, and cleanup [REBASE & FF]
Description
Second phase of large Patina SDK refactor, including:
Add
CorePerformanceto servicesThe performance refactor left out declaring the
CorePerformanceservice in the derive service macro
forCorePerformance. This commit simply adds the missing service declaration.SDK Refactor: Consume r_efi republish from patina crate
This commit changes all uses of r_efi in the patina repo to instead use the r_efi republished from
the patina crate, and removes r_efi from individual cargo dependencies.SDK Refactor: Publish all of base from Patina root
This commit republishes all of
Patina::base::*from the Patina root. This flattens callers' imports
and makes accessing common base types easier.patina: Scope allow(static_mut_refs) only to necessary tests
Moves the global
#![allow(static_mut_refs)]attributes to the test modules that require it, rather
than having it at the crate level. This change improves code safety and clarity by limiting the scope
of this allowance to only where it's needed.
PR #1669 — [major] Breaking changes for Patina SDK UEFI Strings [Rebase & FF]
Description
Breaking changes to use the new UEFI string
types that have been deferred until this PR to themajorbranch.sdk: Use Patina SDK UEFI string types in public APIs
This is a breaking change to public APIs in the SDK to use the new UEFI string types where appropriate.
patina_dxe_core: Use
Char16Strinfilesystems::SimpleFile::openThis is a breaking change to use
&Char16Stras the filename. Some other minor integrating changes in
patina_dxe_core for the new Patina SDK UEFI string types are included.components: Integrate Patina SDK UEFI string changes
Updates the code to use the new string types modified in public APIs used by components that were made
as breaking changes.
PR #1674 — [major] Update the MSRV to 1.90.0
Description
Closes #1673
Updates the Minimum Supported Rust Version (MSRV) to 1.90.0. This update is being made at this time to
allow dependencies with an MSRV of 1.90.0 that have security advisories to be updated.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Unit tests
- Patina tests on Q35
- Patina tests on ArmVirt
- Boot to OS on Q35
- Boot to OS on ArmVirt
Integration Instructions
Performance Refactor
Platforms must change use of with_measurements from the patina_performance to instead override PlatformInfo::default_performance_config()
SerialIOTrait Changes- All custom SerialIO implementations should drop any interior mutalability and adopt the &mut self references.
- Users of Uart16550 must swap to the new new_io and new_mmio instantiations.
Debugger Changes
Callers should remove use of
without_transport_initwhich is already deprecatedPatina SDK Refactor
This change consists of major refactoring to the SDK. Consumers should ensure the following
Consume standard::efi instead of using r_efi to ensure consistent compilation.
- Update all references to modules moved to their new location. See the "New Patina Structure" above for reference.
- Update all renamed structures to conform to their new convention-based name
It is not practical to enumerate all possible changes here, but if there is any ambiguity, reach out to the core Patina team.
String Based Interface Changes
Review the public API changes and adjust consuming code accordingly. Any callers in the patina repo are updated in this PR.
Rust Version
MSRV Updated to 1.9. Consumers must update as well.
- Performance data is not available until the component is dispatched. This can cause significant
Full Changelog: patina-v22.2.4...v23.0.0