patina-v11.4.0
What's Changed
-
Beautify the Exception Handler Processing @os-d (#857)
Change Details
## Description
This change makes several updates to the exception handlers for x64 and aarch64:
- Add an AARCH64 synchronous exception handler to dump more granular information, particularly about instruction/data aborts
- Print register dumps in arch specific and generic handlers more concisely, printing multiple registers per line and only useful registers (except at debug error level)
- Dump the page table for the failing address in a page fault instead only using query; this provides much more information.
A couple notes:
-
This is somewhat subjective, so happy to take additional feedback
-
Doing log::error(""); between lines instead of
\ninside of another print makes the log look better, with adv logger, because the error string gets appended on the front of the former, but not the latter, making the output look strange. -
Other ARM64 synchronous exception types can be added, but instruction/data aborts are some of the most common and there is easily obtainable information that is useful to retrieve. As time goes on, we could certainly extend it. I am not attempting to replace existing external software that translates the ESR for you. Just getting information we can't otherwise get.
-
Impacts functionality?
-
Impacts security?
-
Breaking change?
-
Includes tests?
-
Includes documentation?
How This Was Tested
Tested by injecting faults on Q35 and SBSA and seeing the exception messages.
Integration Instructions
N/A.
</blockquote> <hr> </details>
-
deny.toml: Drop patina-fw registry @makubacki (#873)
Change Details
## Description
Now that the transition from patina-fw to crates.io is complete, drop the patina-fw registry from deny.toml.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make denycargo make all
Integration Instructions
- N/A
-
chore: Release v11.3.3 @Javagedes (#872)
Change Details
## Description
N/A
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A
Integration Instructions
N/A
</blockquote> <hr> </details>
🚀 Features & ✨ Enhancements
-
Add `patina_mm` Integration Tests and Abstractions [Rebase \& FF] @makubacki (#831)
Change Details
## Description
patina_mmprimarily offers MM Communication services right now. Since the details of MM vary and MM communication is historically cumbersome to setup and test on a real platform, this set of changes allows MM Communication to happen entirely in targeted host testing with full logging and native debug.For a detailed overview of the testing framework introduced to support this, see patina/components/patina_mm/tests/README.md.
These changes leverage the env_logger crate to allow controlled visibility into MM Communication flows with the ability to run single or multiple tests simultaneously:
# Run all Patina MM tests with debug logging $env:RUST_LOG="debug"; cargo make test --package patina_mm # Run the main integration test suite $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration # Run specific test by name within the integration suite $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration test_mm_communicator_component_initialization # Run specific test module (e.g., stress tests) $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration mm_communicator::stress_tests
To better support this, an abstraction is introduced in
patina_mm::component::communicatorcalledMmExecutorthat allows "MM execution" to either be entirely mocked, or in the case of the production MM Communicate code use SW MMI.Here's an example of test output showing a simple communicate flow roundtrip:
$env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration test_real_component_echo_communication
running 1 test [2025-10-06T14:10:43Z DEBUG real_test_framework] Building real component MM test framework with 1 handlers [2025-10-06T14:10:43Z DEBUG mm_comm] Creating new CommunicateBuffer: id=0, size=0x1000 [2025-10-06T14:10:43Z DEBUG real_test_framework] Real component communication request: guid=12345678-1234-5678-1234-567890ABCDEF, data_len=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Starting MM communication: buffer_id=0, data_size=26, recipient=12345678-1234-5678-1234-567890ABCDEF [2025-10-06T14:10:43Z DEBUG mm_comm] Buffer 0 message set successfully: header_size=24, message_size=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Outgoing MM communication request: buffer_id=0, data_size=26, recipient=12345678-1234-5678-1234-567890ABCDEF [2025-10-06T14:10:43Z DEBUG mm_comm] Request Data (hex): [48, 65, 6C, 6C, 6F, 2C, 20, 52, 65, 61, 6C, 20, 4D, 4D, 20, 43, 6F, 6D, 70, 6F, 6E, 65, 6E, 74, 73, 21] [2025-10-06T14:10:43Z DEBUG mm_comm] Executing MM communication [2025-10-06T14:10:43Z DEBUG test_mm_executor] Executing MM with test handlers [2025-10-06T14:10:43Z DEBUG test_mm_executor] Processing MM request: recipient=12345678-1234-5678-1234-567890ABCDEF, data_len=26 [2025-10-06T14:10:43Z DEBUG echo_handler] Echoing 26 bytes of data [2025-10-06T14:10:43Z DEBUG test_mm_executor] Handler executed successfully, response_len=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Buffer 0 message set successfully: header_size=24, message_size=26 [2025-10-06T14:10:43Z DEBUG mm_comm] MM communication response received: size=26 [2025-10-06T14:10:43Z DEBUG real_test_framework] Real component communication result: Ok(26) test mm_communicator::component_integration_tests::test_real_component_echo_communication ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 0.00sNote: This set of changes brings the Patina GUID into
patina_mm. Ther_efiGUID type is still used in some places. Those may be evaluated to move to the Patina GUID in the future but the current choice of GUID types is intentional.
Individual commits:
patina_mm: Add comm buffer reset
Add
CommunicateBuffer::reset()to allow the MM Communicate buffer
to easily be reset. Where reset is defined as setting all internal
state tracking back to default values and filling the communicate
buffer with all zeros.
patima_mm/config: Make EfiMmCommunicateHeader public
Allows the type to be accessed from integration tests which, as
integration tests, are located in their own module.
patina_mm/communicator: Abstract MM execution
Introduces an
MmExecutortrait to abstract MM execution logic,
allowing the communicator to be easily tested without relying on
real MM handlers in a real MM environment.Replaces direct SW MMI trigger usage with injectable executors,
includes aRealMmExecutorfor production andaMockMmExecutor
for testing.In particular, this prepares the testing abstractions needed to
simulate MM Communication in host-based integration testing in
future changes.
patina_mm: Use the Patina GUID type
Updates code in the
patina_mmcrate to use the GUID type defined
in thepatinacrate. In a small number of cases, ther_efiGUID
might still be used privately for compat with other interfaces or
code.
patina_mm/communicator: Test improvements
Enhances the testing framework for the MM communicator by adding
new test executors (echo and transform variants) and adding coverage
for additional cases like buffer management and error conditions.Documentation is also improved.
patina_mm/config: Add additional unit tests
Cover all code sections in the module with tests.
patina_mm: Add integration framework and tests
The Patina MM Integration Test Framework provides testing
capabilities for Management Mode (MM) communication. The framework
allows testing with both lightweight unit-style communication
patterns and full integration tests that exercise realpatina_mm
components with their actual service interfaces.The test suite validates:
MmCommunicatorcomponent initialization and dependency injectionMmCommunicationservice interface testing with actual communication
buffers- MM communicate message parsing and serialization
- Error handling and validation across the MM communication stack
- Stress testing of the MM communicate service
Ultimately, this is used to fully exercise MM communication flows
on the host with quick and efficient debugger support and full
detailed logging of communication flows with the ability to
easily hook and extend new MM handlers over time.Infrastructure for the MM Supervisor is added. That may be built
further upon in future changes as that is a key component in the
MM Communication flow in Standalone MM.See
components/patina_mm/tests/README.mdfor more information.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all$env:RUST_LOG="debug"; cargo make test --package patina_mm$env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration- .. and other variations
- QEMU Q35 platform boot to EFI shell (comm component is currently removed from Q35 FW)
Integration Instructions
- N/A - No breaking changes introduced.
🐛 Bug Fixes
-
Align EFI\_MEMORY\_MAP Generation with edk2 @os-d (#862)
Change Details
## Description
OSes have taken a hard dependence on the EFI_MEMORY_MAP as created by edk2. As such, this aligns Patina's
EFI_MEMORY_MAP generation with edk2's.Namely this:
- Only returns runtime MMIO in the map. Without this large MMIO ranges can cause OSes to needlessly map giant memory regions, causing them to build large PFN databases and consuming a lot of memory.
- Drop checking for ISA_VALID and setting EFI_MEMORY_PORT_IO_SPACE. Both of these are for IPF only, which is not supported in Patina.
- Set EFI_MEMORY_NV for persistent memory.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Tested on a platform where Windows was consuming large amounts of memory. After this change it no longer does.
Integration Instructions
N/A.
</blockquote> <hr> </details>
📖 Documentation Updates
-
Add `patina_mm` Integration Tests and Abstractions [Rebase \& FF] @makubacki (#831)
Change Details
## Description
patina_mmprimarily offers MM Communication services right now. Since the details of MM vary and MM communication is historically cumbersome to setup and test on a real platform, this set of changes allows MM Communication to happen entirely in targeted host testing with full logging and native debug.For a detailed overview of the testing framework introduced to support this, see patina/components/patina_mm/tests/README.md.
These changes leverage the env_logger crate to allow controlled visibility into MM Communication flows with the ability to run single or multiple tests simultaneously:
# Run all Patina MM tests with debug logging $env:RUST_LOG="debug"; cargo make test --package patina_mm # Run the main integration test suite $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration # Run specific test by name within the integration suite $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration test_mm_communicator_component_initialization # Run specific test module (e.g., stress tests) $env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration mm_communicator::stress_tests
To better support this, an abstraction is introduced in
patina_mm::component::communicatorcalledMmExecutorthat allows "MM execution" to either be entirely mocked, or in the case of the production MM Communicate code use SW MMI.Here's an example of test output showing a simple communicate flow roundtrip:
$env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration test_real_component_echo_communication
running 1 test [2025-10-06T14:10:43Z DEBUG real_test_framework] Building real component MM test framework with 1 handlers [2025-10-06T14:10:43Z DEBUG mm_comm] Creating new CommunicateBuffer: id=0, size=0x1000 [2025-10-06T14:10:43Z DEBUG real_test_framework] Real component communication request: guid=12345678-1234-5678-1234-567890ABCDEF, data_len=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Starting MM communication: buffer_id=0, data_size=26, recipient=12345678-1234-5678-1234-567890ABCDEF [2025-10-06T14:10:43Z DEBUG mm_comm] Buffer 0 message set successfully: header_size=24, message_size=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Outgoing MM communication request: buffer_id=0, data_size=26, recipient=12345678-1234-5678-1234-567890ABCDEF [2025-10-06T14:10:43Z DEBUG mm_comm] Request Data (hex): [48, 65, 6C, 6C, 6F, 2C, 20, 52, 65, 61, 6C, 20, 4D, 4D, 20, 43, 6F, 6D, 70, 6F, 6E, 65, 6E, 74, 73, 21] [2025-10-06T14:10:43Z DEBUG mm_comm] Executing MM communication [2025-10-06T14:10:43Z DEBUG test_mm_executor] Executing MM with test handlers [2025-10-06T14:10:43Z DEBUG test_mm_executor] Processing MM request: recipient=12345678-1234-5678-1234-567890ABCDEF, data_len=26 [2025-10-06T14:10:43Z DEBUG echo_handler] Echoing 26 bytes of data [2025-10-06T14:10:43Z DEBUG test_mm_executor] Handler executed successfully, response_len=26 [2025-10-06T14:10:43Z DEBUG mm_comm] Buffer 0 message set successfully: header_size=24, message_size=26 [2025-10-06T14:10:43Z DEBUG mm_comm] MM communication response received: size=26 [2025-10-06T14:10:43Z DEBUG real_test_framework] Real component communication result: Ok(26) test mm_communicator::component_integration_tests::test_real_component_echo_communication ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 0.00sNote: This set of changes brings the Patina GUID into
patina_mm. Ther_efiGUID type is still used in some places. Those may be evaluated to move to the Patina GUID in the future but the current choice of GUID types is intentional.
Individual commits:
patina_mm: Add comm buffer reset
Add
CommunicateBuffer::reset()to allow the MM Communicate buffer
to easily be reset. Where reset is defined as setting all internal
state tracking back to default values and filling the communicate
buffer with all zeros.
patima_mm/config: Make EfiMmCommunicateHeader public
Allows the type to be accessed from integration tests which, as
integration tests, are located in their own module.
patina_mm/communicator: Abstract MM execution
Introduces an
MmExecutortrait to abstract MM execution logic,
allowing the communicator to be easily tested without relying on
real MM handlers in a real MM environment.Replaces direct SW MMI trigger usage with injectable executors,
includes aRealMmExecutorfor production andaMockMmExecutor
for testing.In particular, this prepares the testing abstractions needed to
simulate MM Communication in host-based integration testing in
future changes.
patina_mm: Use the Patina GUID type
Updates code in the
patina_mmcrate to use the GUID type defined
in thepatinacrate. In a small number of cases, ther_efiGUID
might still be used privately for compat with other interfaces or
code.
patina_mm/communicator: Test improvements
Enhances the testing framework for the MM communicator by adding
new test executors (echo and transform variants) and adding coverage
for additional cases like buffer management and error conditions.Documentation is also improved.
patina_mm/config: Add additional unit tests
Cover all code sections in the module with tests.
patina_mm: Add integration framework and tests
The Patina MM Integration Test Framework provides testing
capabilities for Management Mode (MM) communication. The framework
allows testing with both lightweight unit-style communication
patterns and full integration tests that exercise realpatina_mm
components with their actual service interfaces.The test suite validates:
MmCommunicatorcomponent initialization and dependency injectionMmCommunicationservice interface testing with actual communication
buffers- MM communicate message parsing and serialization
- Error handling and validation across the MM communication stack
- Stress testing of the MM communicate service
Ultimately, this is used to fully exercise MM communication flows
on the host with quick and efficient debugger support and full
detailed logging of communication flows with the ability to
easily hook and extend new MM handlers over time.Infrastructure for the MM Supervisor is added. That may be built
further upon in future changes as that is a key component in the
MM Communication flow in Standalone MM.See
components/patina_mm/tests/README.mdfor more information.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all$env:RUST_LOG="debug"; cargo make test --package patina_mm$env:RUST_LOG="debug"; cargo make test --package patina_mm --test patina_mm_integration- .. and other variations
- QEMU Q35 platform boot to EFI shell (comm component is currently removed from Q35 FW)
Integration Instructions
- N/A - No breaking changes introduced.
-
RFC: SMBIOS @kat-perez (#627)
Change Details
Proposes a new `SmbiosProvider` service
Description
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A
Integration Instructions
N/A
</blockquote> <hr> </details>
Full Changelog: patina-v11.3.3...v11.4.0