Repository navigation
[major] Add Initial Patina UEFI Services [Rebase & FF] - #1743
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
I'm working on some changes to improve unit test coverage. |
ℹ️ QEMU Validation Skipped - Unsupported Target BranchThe Patina QEMU PR validation workflow did not run because the PR targets an unsupported branch. Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/34870380596
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
f63f1af to
3e810b7
Compare
Pushed. Also updated the |
cfernald
left a comment
There was a problem hiding this comment.
just reviewed the SDK interface for now. Will review the full changes later.
kat-perez
left a comment
There was a problem hiding this comment.
I found several safety and contract issues in the new service layer that should be addressed before merge. The inline comments focus on callback lifetime, protocol reference lifetime, marker protocol compatibility, and duration conversion.
Withdrawn by reviewer for additional cross-checking before feedback is submitted.
b9d0dbd to
75530e3
Compare
|
@Javagedes, @cfernald, @kat-perez, this is ready for you review again when you get time. |
|
I've decided to spend a bit more time improving open protocol and driver binding since that might impact some other interfaces and there's no point having those in an intermediate state. Will push that update within a few days. |
75530e3 to
1fed1b9
Compare
Merged main into the major branch (at commit 35f9055) and rebased the PR onto it. The main set of changes added are in commit 59cc862. |
5051c61 to
89f426b
Compare
I made some cumulative changes to better support UEFI Driver Model components, the PR description is updated. The summary of new changes is a |
|
I've made some additional changes to handle pool allocations returned from C code, split GOP-specific logic out to a dedicated component/service and move the default font package into its own component (out of |
Patina UEFI Services are a set of service traits that expose UEFI Boot Services (and, potentially Runtime Services in the future) to Patina components so that they can perform the operations provided by the services in a safer more idiomatic way. These services are the recommended way for components to consume UEFI functionality. Unlike the raw `uefi::boot_services` abstractions, which wrap the C `EFI_BOOT_SERVICES` function-pointer table, these services are implemented by the Patina DXE Core directly against its internal Rust APIs. Components therefore do not interact with C-style constructs such as the boot services table or raw pointers until they go down an unavoidable path into C code, such as calling a protocol function pointer when the protocol is produced by a C driver. The services are only defined in this commit and will be produced by the Patina DXE Core in a future commit. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Binds these types to the GUID they are published under, so they can be used with Configuration Table Services without handling a raw pointer or repeating the GUID at each call site. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Produces UEFI Services for components to have safer, direct access to common UEFI Services implemented in the DXE Core. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Adds a set of new sample components that demonstrate how to use the UEFI Services. Samples include: - `overview` - A quick tour of timer, event, and protocol usage in one component. - `configuration_table` - Installs a vendor configuration table and reads it back. - `driver_connect` - Discovers controllers by protocol and connects drivers to them. - `end_of_dxe_protocol_consumer` - Defers protocol consumption to End-of-DXE. - `protocol_consumer` - Shows different ways to consume a protocol. - `protocol_publisher` - Demonstrates one component publishing a protocol and another consuming it. - `timers` - Drives work from one-shot and periodic timers using Rust closures. - `tpl_critical_section` - Serializes access to shared state with TPL. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
744f2ee to
ea0dd60
Compare
|
This branch has accumulated several months worth of changes now. I'm going to remove everything except the initial set of commits to add the UEFI Services themselves and break the remaining changes up into other PRs for more focused review. The remaining set of changes (and some commits after) were already reviewed and approved, so I'll complete this PR after CI passes. There might be some redundant review in the next few PRs created, but a second look doesn't hurt. |
| { | ||
| // SAFETY: `context` is the `ClosureHolder` pointer created in `create_event_internal`. | ||
| // The event has just been closed, so no further notifications can reference it. | ||
| drop(unsafe { Box::from_raw(context as *mut ClosureHolder) }); |
There was a problem hiding this comment.
Couldn't this be the closure that called close_event?
| .map_err(ConfigTableError::from) | ||
| } | ||
|
|
||
| fn remove_table(&self, guid: BinaryGuid) -> Result<(), ConfigTableError> { |
There was a problem hiding this comment.
I think this routine needs to also try CONFIG_TABLE_TYPES.lock().remove(&guid); to avoid potential type aliasing.
cfernald
left a comment
There was a problem hiding this comment.
looks like I missed the window a bit, but a few comments.
Description
Includes an initial merge commit from the current main branch into major.
Adds a new set of Patina component services called "UEFI Services". These services are defined in the Patina SDK, produced by the Patina DXE Core, and used by Patina components.
Main changes:
sdk\patina\src\component\service\uefi_services.patina_dxe_core\src\uefi_services.components\patina_samples\src\component\uefi_services.Note: Throughout the development of this PR, other changes were added that built on the code that currently remains. Those have been removed to reduce the size of this PR, and the above set of changes are the primary set that remain.
How This Was Tested
cargo make allInitial component dispatch (DXE core and sample components):
Later after the Timer Architectural protocol is installed:
End of DXE messages:
All Patina on-system tests pass:
GraphicsConsoleDxefrom QEMU platforms and using thepatina_graphics_consolecomponent instead.Integration Instructions