Capture bounded firmware processor topology before handover #32

Manually merged
erikinkinen merged 3 commits from feature/firmware-topology-snapshot into feature/x86-startup-resources 2026-11-13 20:51:40 +01:00
Owner

Summary and rationale

Capture enabled processor IDs before firmware exit and pass a counted immutable snapshot to the kernel. Replace the later raw ACPI-pointer handoff with scoped reads through the original live UEFI configuration-table source.

Tracking and scope

Implements #31 atop #30; selects lib-handoff#11 and coordinates kernel#140.

Architecture, authority and failure behavior

Check original firmware storage types, complete spans, descriptor geometry, checksums and record boundaries before following tables. Preserve full-width IDs, discovery order and the existing startup record; reject duplicates and incomplete records. The snapshot is data and grants no firmware access or processor ownership.

Temporary ID and sorting storage has explicit owners. Copy IDs into the retained handoff, preserve them on console rebuilds, mark scratch storage future usable and release it before firmware exit. Zero the legacy RSDP field and remove the separate ACPI identity mappings. The existing broad low identity map remains separate work.

Validation evidence

  • Original component gates, strict Clippy, warning-denied builds and rustdoc
  • 53 Rust controls, including original large-topology coverage, source refusal, malformed records, duplicate identities, both allocation refusals and handoff rebuilding
  • Actual UEFI release builds with and without the development console
  • Repository Markdown checks and focused ownership documentation
  • Current published CI
  • Coordinated native 1-, 2- and 4-CPU topology data acceptance with the kernel consumer

Hosted readers and allocation controls do not establish actual firmware placement or AP startup.

Review checklist

  • Original EriX parser/control provenance and primary UEFI references
  • Signed commits, main-branch dependency declarations and explicit public companions
  • Useful inline contracts and source files below 1,000 lines
  • README, ARCHITECTURE, ROADMAP and focused design updated
  • Discovery data kept distinct from original startup resources and processor authority
## Summary and rationale Capture enabled processor IDs before firmware exit and pass a counted immutable snapshot to the kernel. Replace the later raw ACPI-pointer handoff with scoped reads through the original live UEFI configuration-table source. ## Tracking and scope Implements #31 atop #30; selects [lib-handoff#11](https://git.erikinkinen.fi/erix/lib-handoff/pulls/11) and coordinates [kernel#140](https://git.erikinkinen.fi/erix/kernel/issues/140). ## Architecture, authority and failure behavior Check original firmware storage types, complete spans, descriptor geometry, checksums and record boundaries before following tables. Preserve full-width IDs, discovery order and the existing startup record; reject duplicates and incomplete records. The snapshot is data and grants no firmware access or processor ownership. Temporary ID and sorting storage has explicit owners. Copy IDs into the retained handoff, preserve them on console rebuilds, mark scratch storage future usable and release it before firmware exit. Zero the legacy RSDP field and remove the separate ACPI identity mappings. The existing broad low identity map remains separate work. ## Validation evidence - [x] Original component gates, strict Clippy, warning-denied builds and rustdoc - [x] 53 Rust controls, including original large-topology coverage, source refusal, malformed records, duplicate identities, both allocation refusals and handoff rebuilding - [x] Actual UEFI release builds with and without the development console - [x] Repository Markdown checks and focused ownership documentation - [x] Current published CI - [x] Coordinated native 1-, 2- and 4-CPU topology data acceptance with the kernel consumer Hosted readers and allocation controls do not establish actual firmware placement or AP startup. ## Review checklist - [x] Original EriX parser/control provenance and primary UEFI references - [x] Signed commits, main-branch dependency declarations and explicit public companions - [x] Useful inline contracts and source files below 1,000 lines - [x] README, ARCHITECTURE, ROADMAP and focused design updated - [x] Discovery data kept distinct from original startup resources and processor authority
Keep ACPI reads within the genuine live UEFI source and its original descriptor types and read policy. Copy enabled full-width identities into the versioned counted handoff, retain startup resource geometry across rebuilds, and release temporary discovery storage before firmware exit. Replace the pointer handoff and extra firmware identity mappings with immutable data.
Treat memory-map attributes as capabilities rather than current protection settings, following the UEFI source contract. Remove the obsolete transition import, exercise both allocation refusals through the actual capture transaction, and document data-only handover and pre-exit cleanup.
fix: Reject malformed firmware descriptor page geometry
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Successful in 45s
8d98cb7339
Require the nonempty page-aligned ranges specified by UEFI before using original descriptors to bound any table span. Cover zero-page and misaligned inputs alongside gaps, overlaps and overflow so malformed map geometry cannot become a read boundary.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 14:14:43 +01:00
Author
Owner

The captured-topology data cases now pass in QEMU/OVMF with 1, 2 and 4 vCPUs, reporting IDs [0], [0, 1] and [0, 1, 2, 3]. The real dynamic image uses Kernel #141 (2283a382), Bootloader #36 (0776f2cc) and Integration #783. The topology producer and consumer module are byte-identical to this PR; the companion fixes the separately tracked runtime-symbol lookup in Bootloader #35. Each guest reaches Kernel entry, owned-stack preparation and PROCESSOR_TOPOLOGY:DATA_OK, then exits through the expected success path. This completes the topology data requirement and does not establish AP execution or private-root confinement.

The captured-topology data cases now pass in QEMU/OVMF with 1, 2 and 4 vCPUs, reporting IDs `[0]`, `[0, 1]` and `[0, 1, 2, 3]`. The real dynamic image uses Kernel #141 (`2283a382`), [Bootloader #36](https://git.erikinkinen.fi/erix/bootloader/pulls/36) (`0776f2cc`) and [Integration #783](https://git.erikinkinen.fi/erix/integration/pulls/783). The topology producer and consumer module are byte-identical to this PR; the companion fixes the separately tracked runtime-symbol lookup in [Bootloader #35](https://git.erikinkinen.fi/erix/bootloader/issues/35). Each guest reaches Kernel entry, owned-stack preparation and `PROCESSOR_TOPOLOGY:DATA_OK`, then exits through the expected success path. This completes the topology data requirement and does not establish AP execution or private-root confinement.
erikinkinen changed title from WIP: Capture bounded firmware processor topology before handover to Capture bounded firmware processor topology before handover 2026-11-13 16:31:12 +01:00
erikinkinen changed target branch from feature/exact-bootstrap-page-tables to feature/x86-startup-resources 2026-11-13 20:51:39 +01:00
erikinkinen manually merged commit 2e91a01224 into feature/x86-startup-resources 2026-11-13 20:51:40 +01:00
Sign in to join this conversation.
No description provided.