[FEATURE] Capture bounded firmware processor topology before handover #31

Open
opened 2026-11-13 13:59:04 +01:00 by erikinkinen · 1 comment
Owner

Problem and motivation

The kernel currently discovers processors by following raw ACPI addresses after firmware handover. Processor discovery needs immutable topology data, not continuing access to firmware tables.

Proposed behavior and scope

Capture enabled LAPIC and x2APIC processor IDs while the bootloader holds its original live UEFI/configuration-table context. Bound every table read using the original firmware memory types and lengths, then serialize a counted immutable topology snapshot through the BootKernel wire contract. Preserve full-width IDs, discovery order and single-processor systems. Coordinate the kernel consumer and remove its superseded raw discovery path.

Authority, security and reliability

Read provenance comes from the original UEFI entry context and valid firmware table storage. Normalized free/reserved memory labels, checksums and numeric addresses cannot grant read access. Validate every header and full span before following it; reject malformed lengths, checksum failures, duplicate enabled IDs, truncated records and allocation failures. Copy only topology data into ordinary retained handoff storage and release temporary allocations before firmware exit. The snapshot conveys neither firmware-read permission nor processor startup ownership.

Acceptance criteria

  • Bound the RSDP, root table and every followed SDT against original readable firmware storage.
  • Preserve original checksum/MADT controls and add out-of-span, arithmetic, trailing-record, duplicate-ID and allocation-failure controls.
  • Encode the versioned counted snapshot through the coordinated codec, preserving startup resources and handoff rebuilds.
  • Retain snapshot storage through firmware exit with complete failure cleanup and documented ownership.
  • Pass original strict component gates and both native UEFI release configurations.
  • Coordinate actual 1-, 2- and 4-CPU release-image acceptance separately from hosted parser checks.

Alternatives and tradeoffs

Transferring firmware-read authority into the kernel would retain a larger boundary and require another authority-bearing interface. Capturing the needed IDs in the bootloader keeps that access within its existing firmware lifetime.

Tracking and rollout

Implemented in #32, building on #29 and the scoped paging correction #30. Coordinate lib-handoff#11 and kernel#140. Preserve known handoff compatibility; no permanent firmware alias or synthetic processor ID is introduced.

## Problem and motivation The kernel currently discovers processors by following raw ACPI addresses after firmware handover. Processor discovery needs immutable topology data, not continuing access to firmware tables. ## Proposed behavior and scope Capture enabled LAPIC and x2APIC processor IDs while the bootloader holds its original live UEFI/configuration-table context. Bound every table read using the original firmware memory types and lengths, then serialize a counted immutable topology snapshot through the [BootKernel wire contract](https://git.erikinkinen.fi/erix/lib-handoff/pulls/11). Preserve full-width IDs, discovery order and single-processor systems. Coordinate the kernel consumer and remove its superseded raw discovery path. ## Authority, security and reliability Read provenance comes from the original UEFI entry context and valid firmware table storage. Normalized free/reserved memory labels, checksums and numeric addresses cannot grant read access. Validate every header and full span before following it; reject malformed lengths, checksum failures, duplicate enabled IDs, truncated records and allocation failures. Copy only topology data into ordinary retained handoff storage and release temporary allocations before firmware exit. The snapshot conveys neither firmware-read permission nor processor startup ownership. ## Acceptance criteria - [x] Bound the RSDP, root table and every followed SDT against original readable firmware storage. - [x] Preserve original checksum/MADT controls and add out-of-span, arithmetic, trailing-record, duplicate-ID and allocation-failure controls. - [x] Encode the versioned counted snapshot through the coordinated codec, preserving startup resources and handoff rebuilds. - [x] Retain snapshot storage through firmware exit with complete failure cleanup and documented ownership. - [x] Pass original strict component gates and both native UEFI release configurations. - [ ] Coordinate actual 1-, 2- and 4-CPU release-image acceptance separately from hosted parser checks. ## Alternatives and tradeoffs Transferring firmware-read authority into the kernel would retain a larger boundary and require another authority-bearing interface. Capturing the needed IDs in the bootloader keeps that access within its existing firmware lifetime. ## Tracking and rollout Implemented in #32, building on #29 and the scoped paging correction #30. Coordinate [lib-handoff#11](https://git.erikinkinen.fi/erix/lib-handoff/pulls/11) and [kernel#140](https://git.erikinkinen.fi/erix/kernel/issues/140). Preserve known handoff compatibility; no permanent firmware alias or synthetic processor ID is introduced.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 13:59:04 +01:00
Author
Owner

The bounded firmware reader and counted snapshot producer are implemented in #32. Processor IDs are copied before firmware exit, temporary owners are released before handover, and the kernel receives no firmware pointer. Coordinated native image acceptance remains on the checklist.

The bounded firmware reader and counted snapshot producer are implemented in #32. Processor IDs are copied before firmware exit, temporary owners are released before handover, and the kernel receives no firmware pointer. Coordinated native image acceptance remains on the checklist.
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#31
No description provided.