Skip to content

patina_dxe_core: Add DxeDispatch service for driver dispatch#1421

Merged
kat-perez merged 1 commit intoOpenDevicePartnership:mainfrom
kat-perez:kp/expose-core-dispatch
Mar 24, 2026
Merged

patina_dxe_core: Add DxeDispatch service for driver dispatch#1421
kat-perez merged 1 commit intoOpenDevicePartnership:mainfrom
kat-perez:kp/expose-core-dispatch

Conversation

@kat-perez
Copy link
Copy Markdown
Contributor

@kat-perez kat-perez commented Mar 19, 2026

Description

Add a DxeDispatch service trait in the SDK and a CoreDxeDispatch
implementation in patina_dxe_core that delegates to the PI dispatcher.
The service is registered alongside other core services (MemoryManager,
PerfTimer, etc.) and consumed via dependency injection by components
that need to trigger driver dispatch passes.

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

How This Was Tested

  • Built SBSA DXE core binary with BootDispatcher + SimpleBootManager consuming the service via DI
  • Booted Windows ARM64 under QEMU SBSA-ref with Patina BDS handling the full boot flow
  • Connect-dispatch interleaving discovered AHCI device, expanded partial device path, loaded Windows bootloader, ExitBootServices completed
  • 106 on-system unit tests passed (0 fails)

Integration Instructions

The DxeDispatch service is registered automatically by the DXE core.
Components consume it via dependency injection:

fn entry_point(self, dxe_dispatch: Service<dyn DxeDispatch>) -> Result<()> {
    dxe_dispatch.dispatch()?;
    Ok(())
}

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented Mar 19, 2026

ℹ️ QEMU Validation Skipped - PR Merged

The Patina QEMU PR validation workflow did not run because the PR was merged before validation started.

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/23510554819

Note: Previous results are available in this comment's edit history.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch from b8285d5 to 527b860 Compare March 19, 2026 18:51
@kat-perez kat-perez marked this pull request as ready for review March 19, 2026 18:56
Comment thread patina_dxe_core/src/lib.rs Outdated
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch from 527b860 to 386036d Compare March 20, 2026 18:28
@kat-perez kat-perez changed the title patina_dxe_core: Expose Core::dispatch() for boot orchestrators patina_dxe_core: Add DxeDispatch service for driver dispatch Mar 20, 2026
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch 6 times, most recently from c8162fd to 762aa1d Compare March 23, 2026 17:39
@kat-perez
Copy link
Copy Markdown
Contributor Author

@os-d @Javagedes this is ready for another review. thanks!

Comment thread sdk/patina/src/component/service/dxe_dispatch.rs Outdated
Copy link
Copy Markdown
Contributor

@os-d os-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the overall approach is reasonable, we would want the other dispatch services also defined at some point, but I think it is okay to defer those until a use case arises

Comment thread patina_dxe_core/src/dxe_dispatch_service.rs Outdated
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch 2 times, most recently from 7469952 to 00af474 Compare March 23, 2026 19:15
@kat-perez kat-perez requested review from Javagedes and os-d March 23, 2026 19:16
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch 4 times, most recently from df163af to 1d334a4 Compare March 23, 2026 23:35
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch 2 times, most recently from 6a617c3 to 0fae68c Compare March 23, 2026 23:51
@kat-perez
Copy link
Copy Markdown
Contributor Author

@os-d @Javagedes does this new implementation work better?

Copy link
Copy Markdown
Collaborator

@makubacki makubacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks reasonable for making the equivalent of the DXE Services dispatch interface available to components.

There is the small probability that developers get confused and think only a component dispatch loop exists and they are responsible for using this service to start PI dispatch. Maybe a clarifying comment for that would be nice to add.

@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch 2 times, most recently from b340c80 to 5f06673 Compare March 24, 2026 17:57
@kat-perez
Copy link
Copy Markdown
Contributor Author

@makubacki added this in the inline docs:

/// Note: The DXE core already runs a PI dispatch loop automatically. This
/// service is only needed when a component must explicitly trigger a dispatch
/// pass at a specific point in its execution.
pub trait DxeDispatch {
...

@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch from 5f06673 to 302824e Compare March 24, 2026 17:57
@kat-perez kat-perez force-pushed the kp/expose-core-dispatch branch from 302824e to fe7d8f8 Compare March 24, 2026 20:11
@kat-perez kat-perez enabled auto-merge (squash) March 24, 2026 20:12
@kat-perez kat-perez merged commit 1ed7a98 into OpenDevicePartnership:main Mar 24, 2026
9 of 10 checks passed
@kat-perez kat-perez deleted the kp/expose-core-dispatch branch March 24, 2026 20:48
kat-perez added a commit that referenced this pull request Mar 26, 2026
…with DxeServices (#1422)

## Description

Interleave controller connection with DXE driver dispatch during device
enumeration. Connecting controllers can discover new firmware volumes
(e.g., PCI option ROMs) that contain drivers for devices behind that
controller. Those drivers must be dispatched before the next round of
enumeration, otherwise the devices they serve will not be found.

`SimpleBootManager` uses `interleave_connect_and_dispatch()` to
alternate
between connecting controllers and dispatching newly-discovered drivers
until both stabilize. The `DxeDispatch` service trait (from #1421) is
consumed via dependency injection.

Note: `interleave_connect_and_dispatch()` currently uses `connect_all()`
which connects every controller on every round. This is functional but
inefficient for platforms with large device topologies — a future
optimization could connect only newly-discovered controllers.

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

- Built SBSA DXE core binary with `BootDispatcher` + `SimpleBootManager`
replacing TianoCore BdsDxe
- Booted Windows ARM64 under QEMU SBSA-ref emulation with Patina BDS
handling the full boot flow
- Verified interleaving: controller connection discovered AHCI device,
partial device path expanded to full path, Windows bootloader loaded,
ExitBootServices completed

## Integration Instructions

Depends on #1421 (`DxeDispatch` service trait) for platform binary
integration.

Remove TianoCore `BdsDxe.inf` from platform DSC/FDF since the
`BootDispatcher` provides the BDS architectural protocol.
kat-perez added a commit to kat-perez/patina that referenced this pull request Apr 1, 2026
…with DxeServices (OpenDevicePartnership#1422)

## Description

Interleave controller connection with DXE driver dispatch during device
enumeration. Connecting controllers can discover new firmware volumes
(e.g., PCI option ROMs) that contain drivers for devices behind that
controller. Those drivers must be dispatched before the next round of
enumeration, otherwise the devices they serve will not be found.

`SimpleBootManager` uses `interleave_connect_and_dispatch()` to
alternate
between connecting controllers and dispatching newly-discovered drivers
until both stabilize. The `DxeDispatch` service trait (from OpenDevicePartnership#1421) is
consumed via dependency injection.

Note: `interleave_connect_and_dispatch()` currently uses `connect_all()`
which connects every controller on every round. This is functional but
inefficient for platforms with large device topologies — a future
optimization could connect only newly-discovered controllers.

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

- Built SBSA DXE core binary with `BootDispatcher` + `SimpleBootManager`
replacing TianoCore BdsDxe
- Booted Windows ARM64 under QEMU SBSA-ref emulation with Patina BDS
handling the full boot flow
- Verified interleaving: controller connection discovered AHCI device,
partial device path expanded to full path, Windows bootloader loaded,
ExitBootServices completed

## Integration Instructions

Depends on OpenDevicePartnership#1421 (`DxeDispatch` service trait) for platform binary
integration.

Remove TianoCore `BdsDxe.inf` from platform DSC/FDF since the
`BootDispatcher` provides the BDS architectural protocol.
kat-perez added a commit that referenced this pull request Apr 1, 2026
…with DxeServices (#1422)

## Description

Interleave controller connection with DXE driver dispatch during device
enumeration. Connecting controllers can discover new firmware volumes
(e.g., PCI option ROMs) that contain drivers for devices behind that
controller. Those drivers must be dispatched before the next round of
enumeration, otherwise the devices they serve will not be found.

`SimpleBootManager` uses `interleave_connect_and_dispatch()` to
alternate
between connecting controllers and dispatching newly-discovered drivers
until both stabilize. The `DxeDispatch` service trait (from #1421) is
consumed via dependency injection.

Note: `interleave_connect_and_dispatch()` currently uses `connect_all()`
which connects every controller on every round. This is functional but
inefficient for platforms with large device topologies — a future
optimization could connect only newly-discovered controllers.

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

- Built SBSA DXE core binary with `BootDispatcher` + `SimpleBootManager`
replacing TianoCore BdsDxe
- Booted Windows ARM64 under QEMU SBSA-ref emulation with Patina BDS
handling the full boot flow
- Verified interleaving: controller connection discovered AHCI device,
partial device path expanded to full path, Windows bootloader loaded,
ExitBootServices completed

## Integration Instructions

Depends on #1421 (`DxeDispatch` service trait) for platform binary
integration.

Remove TianoCore `BdsDxe.inf` from platform DSC/FDF since the
`BootDispatcher` provides the BDS architectural protocol.
kat-perez added a commit that referenced this pull request Apr 14, 2026
…with DxeServices (#1422)

## Description

Interleave controller connection with DXE driver dispatch during device
enumeration. Connecting controllers can discover new firmware volumes
(e.g., PCI option ROMs) that contain drivers for devices behind that
controller. Those drivers must be dispatched before the next round of
enumeration, otherwise the devices they serve will not be found.

`SimpleBootManager` uses `interleave_connect_and_dispatch()` to
alternate
between connecting controllers and dispatching newly-discovered drivers
until both stabilize. The `DxeDispatch` service trait (from #1421) is
consumed via dependency injection.

Note: `interleave_connect_and_dispatch()` currently uses `connect_all()`
which connects every controller on every round. This is functional but
inefficient for platforms with large device topologies — a future
optimization could connect only newly-discovered controllers.

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

- Built SBSA DXE core binary with `BootDispatcher` + `SimpleBootManager`
replacing TianoCore BdsDxe
- Booted Windows ARM64 under QEMU SBSA-ref emulation with Patina BDS
handling the full boot flow
- Verified interleaving: controller connection discovered AHCI device,
partial device path expanded to full path, Windows bootloader loaded,
ExitBootServices completed

## Integration Instructions

Depends on #1421 (`DxeDispatch` service trait) for platform binary
integration.

Remove TianoCore `BdsDxe.inf` from platform DSC/FDF since the
`BootDispatcher` provides the BDS architectural protocol.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants