-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
Update device enumeration to interleave controller connection with driver dispatch, ensuring drivers loaded from firmware volumes (e.g., PCI option ROMs) are dispatched before continuing enumeration.
Current State
The current connect_all() function connects controllers in a loop until the handle count stabilizes, but does not dispatch newly-loaded drivers between iterations:
for _iteration in 0..MAX_ITERATIONS {
let handles = boot_services.locate_handle_buffer(...)?;
for &handle in handles.iter() {
let _ = boot_services.connect_controller(handle, ...);
}
// Missing: dxe_services.dispatch() call here
if current_handle_count == prev_handle_count {
break;
}
}Requirements
Per the Boot Orchestration RFC:
"interleave_connect_and_dispatch() - Orchestrate connect-dispatch loop for device enumeration"
"connect controllers, dispatch newly loaded drivers, repeat until stable"
- Add
DxeServicesdependency to perform driver dispatch - Call
dxe_services.dispatch()after each round of controller connection - Continue until both handle count stabilizes AND no new drivers are dispatched
Design
Either update the existing connect_all() function or provide a new interleave_connect_and_dispatch() helper that takes both BootServices and DxeServices:
pub fn interleave_connect_and_dispatch<B: BootServices, D: DxeServices>(
boot_services: &B,
dxe_services: &D,
) -> Result<()> {
loop {
connect_all_handles(boot_services)?;
if !dxe_services.dispatch()? {
break; // No more drivers to dispatch
}
}
Ok(())
}Impact
Without this fix, platforms with PCI option ROM drivers or other firmware volume-based drivers may not have those drivers dispatched during boot enumeration, potentially missing devices.
Related
- RFC: Boot Orchestration (RFC: Boot Orchestration Component #1013)
- BootOrchestrator component uses this for device enumeration
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status