Skip to content

Conversation

@makubacki
Copy link
Collaborator

@makubacki makubacki commented Nov 25, 2025

Description

The HOB list is relocated to DXE allocated memory shortly into DXE core entry. The Rust allocated HOB list is not binary compatible with the C HOB list. The Rust HOB list is a vector of references to HOB structures while the C hob list is a compact series of binary HOB structures.

While the Rust HOB list is sufficient for most use cases that simply need information from the HOBs in a more type safe and ergonomic interface, there are still use cases that require binary compatibility of the HOB list such as placement of the HOB into the system table where it is discovered by other modules, including C modules.

Today, this works because the HOB list pointer is directly passed to the system table initialization function where it is placed into the HOB list system table. This change relocates both HOB lists in the same place in the init_memory() function. Later DXE functionality consistently works on a relocated HOB list after init_memory() returns.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • cargo make all
  • QEMU SBSA and Q35 EFI shell boot

Integration Instructions

  • N/A

@makubacki makubacki self-assigned this Nov 25, 2025
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki makubacki force-pushed the add_c_hob_list_opt_to_core branch from d5d79a6 to 0c39568 Compare November 26, 2025 01:10
@makubacki makubacki changed the title Add a HOB list pointer to Core storage patina_dxe_core: Clean up HOB init flow Nov 26, 2025
@makubacki makubacki force-pushed the add_c_hob_list_opt_to_core branch from 0c39568 to 9258040 Compare November 26, 2025 01:31
@makubacki makubacki force-pushed the add_c_hob_list_opt_to_core branch from 9258040 to 2dd858a Compare November 26, 2025 16:35
@makubacki makubacki force-pushed the add_c_hob_list_opt_to_core branch from 2dd858a to 7d52820 Compare November 26, 2025 18:48
@makubacki
Copy link
Collaborator Author

Fyi: The most recent update just pushes some unit tests for get_pi_hob_list_size().

@github-actions github-actions bot added the impact:testing Affects testing label Nov 26, 2025
The HOB list is relocated to DXE allocated memory shortly into
DXE core entry. The Rust allocated HOB list is not binary
compatible with the C HOB list. The Rust HOB list is a vector of
references to HOB structures while the C hob list is a compact
series of binary HOB structures.

While the Rust HOB list is sufficient for most use cases that simply
need information from the HOBs in a more type safe and ergonomic
interface, there are still use cases that require binary
compatibility of the HOB list such as placement of the HOB into the
system table where it is discovered by other modules, including
C modules.

Today, this works because the HOB list pointer is direclty passed
to the system table initialization function where it is placed into
the HOB list system table. This change updates the stored HOB list
context to maintain a C HOB list pointer in addition to the Rust
managed list so all HOB list context is available in the structure.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki force-pushed the add_c_hob_list_opt_to_core branch from 7d52820 to 98d4a67 Compare November 26, 2025 18:55
@makubacki makubacki merged commit 45dce38 into OpenDevicePartnership:main Nov 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:testing Affects testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants