[FEATURE] Transfer original fixed PCI resource assignments at platform takeover #37

Open
opened 2026-11-13 16:52:27 +01:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Native DeviceFrame loans need the original device-resource backing. Configuration access, BAR coordinates and firmware resource descriptions cannot supply that owner.

Proposed behavior and scope

Capture actual firmware-assigned root-bridge, function and BAR resources while UEFI protocols remain live. Transfer the retained assignment ledger through the original successful platform takeover. Add a known BootKernel 2.4 extension with bounded root/function/window/BAR tables and original device-path data; retain the exact standard configuration header once per function.

Logical UEFI BAR numbers remain distinct from configuration dword slots. Preserve both CPU and PCI spans, raw translations and the specific provider convention. The initial mode keeps fixed assignments; relocation and DMA isolation are separate work.

Authority, security and reliability

The source is the actual one-shot platform takeover, scoped by original assigned allocations and real parent occupations. Safe decoding creates only descriptions. A bridge aperture is routing scope, not a child allocation grant. Parent identity must agree with original firmware association and actual bridge routing; ambiguous ancestry does not broaden scope.

Exclude RAM, runtime images, boot sources, stacks, tables, APIC and independent firmware/device occupations. Framebuffer overlap needs a genuine same-origin relationship. Retain owners through failure and uncertain cleanup; after an attempted firmware exit, unrecoverable failure must not return to firmware. Every directly exposed page requires authority for all of its bytes.

Acceptance criteria

  • Capture and preserve original function/root associations, logical/config BAR identities and fixed assignments without destructive sizing probes.
  • Validate counted extents, reserved fields, both address domains, ancestry and complete resource conflicts without fixed topology limits.
  • Reject descriptor-only ownership, ambiguous parents, changed assignments, unauthorized rounding and unrelated source overlaps.
  • Preserve cleanup before exit and original occupied resources after uncertain/partial exit.
  • Exercise mixed 32/64-bit BARs, nonidentity translation, multiple resources, malformed records and actual coherent native mapping/revocation cases.
  • Update component documentation and the manual; keep native acceptance distinct from codec checks.

Alternatives and tradeoffs

Inferring ownership from BAR reads or memory-kind labels would bypass the original source. UEFI section 7 supplies the actual platform-management transition; PCI descriptions delimit existing assignments. The precise UEFI provider’s translation definition must be preserved rather than inferred from generic ACPI semantics. Unknown firmware ancestry or translation remains closed until supported explicitly.

Tracking and rollout

Coordinates Kernel #145. Builds on the loaded-runtime-image handover and its partial-exit custody. The codec, actual producer and original native consumer must be introduced together before opening DeviceFrame construction.

Primary contracts: UEFI boot services and UEFI PCI support.

## Problem and motivation Native DeviceFrame loans need the original device-resource backing. Configuration access, BAR coordinates and firmware resource descriptions cannot supply that owner. ## Proposed behavior and scope Capture actual firmware-assigned root-bridge, function and BAR resources while UEFI protocols remain live. Transfer the retained assignment ledger through the original successful platform takeover. Add a known BootKernel 2.4 extension with bounded root/function/window/BAR tables and original device-path data; retain the exact standard configuration header once per function. Logical UEFI BAR numbers remain distinct from configuration dword slots. Preserve both CPU and PCI spans, raw translations and the specific provider convention. The initial mode keeps fixed assignments; relocation and DMA isolation are separate work. ## Authority, security and reliability The source is the actual one-shot platform takeover, scoped by original assigned allocations and real parent occupations. Safe decoding creates only descriptions. A bridge aperture is routing scope, not a child allocation grant. Parent identity must agree with original firmware association and actual bridge routing; ambiguous ancestry does not broaden scope. Exclude RAM, runtime images, boot sources, stacks, tables, APIC and independent firmware/device occupations. Framebuffer overlap needs a genuine same-origin relationship. Retain owners through failure and uncertain cleanup; after an attempted firmware exit, unrecoverable failure must not return to firmware. Every directly exposed page requires authority for all of its bytes. ## Acceptance criteria - [ ] Capture and preserve original function/root associations, logical/config BAR identities and fixed assignments without destructive sizing probes. - [ ] Validate counted extents, reserved fields, both address domains, ancestry and complete resource conflicts without fixed topology limits. - [ ] Reject descriptor-only ownership, ambiguous parents, changed assignments, unauthorized rounding and unrelated source overlaps. - [ ] Preserve cleanup before exit and original occupied resources after uncertain/partial exit. - [ ] Exercise mixed 32/64-bit BARs, nonidentity translation, multiple resources, malformed records and actual coherent native mapping/revocation cases. - [ ] Update component documentation and the manual; keep native acceptance distinct from codec checks. ## Alternatives and tradeoffs Inferring ownership from BAR reads or memory-kind labels would bypass the original source. UEFI section 7 supplies the actual platform-management transition; PCI descriptions delimit existing assignments. The precise UEFI provider’s translation definition must be preserved rather than inferred from generic ACPI semantics. Unknown firmware ancestry or translation remains closed until supported explicitly. ## Tracking and rollout Coordinates [Kernel #145](https://git.erikinkinen.fi/erix/kernel/issues/145). Builds on the loaded-runtime-image handover and its partial-exit custody. The codec, actual producer and original native consumer must be introduced together before opening DeviceFrame construction. Primary contracts: [UEFI boot services](https://uefi.org/specs/UEFI/2.10/07_Services_Boot_Services.html) and [UEFI PCI support](https://uefi.org/specs/UEFI/2.10/14_Protocols_PCI_Bus_Support.html).
erikinkinen added this to the Alpha 1 milestone 2026-11-13 16:52:27 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/bootloader#37
No description provided.