Preserve exact bootstrap page-table backing and permissions #30

Manually merged
erikinkinen merged 8 commits from feature/exact-bootstrap-page-tables into feature/x86-startup-resources 2026-11-13 20:51:36 +01:00
Owner

Summary and rationale

Make the bootstrap page-table planner count exactly the tables the mapper consumes. Preserve compatible original backing when rounded load pages share a page, split low identity mappings when read-only policy requires it, and reject conflicting translations or policies before changing tables.

Tracking and scope

Builds on #29. This fixes the paging component; dynamic-artifact production and whole-image kernel admission are separate work.

Architecture, authority and failure behavior

The existing UEFI allocation owns the exact table arena. Mapping requests describe geometry and policy; they do not grant backing memory. Keep the strict arena-consumption gate, reject physical rebinding and reserved control-window conflicts, and preserve neighboring permissions when splitting a huge leaf. The existing broad identity map and absence of NX policy are unchanged and are not claimed as solved here.

Validation evidence

  • Original formatting, strict Clippy, host and UEFI builds, tests and rustdoc gates
  • Production mapper exercised by 43 compiled Rust controls, including exact allocation, read-only splitting, genuine shared rounded pages and refusal before mutation
  • Documentation and Markdown checks
  • Current published CI

Host tests execute the production planner and mapper using explicitly owned test storage. They do not prove firmware placement or guest execution.

Review checklist

  • Original source, signed commits and main-branch dependency declarations
  • Inline contracts and cohesive source files below 1,000 lines
  • README, ARCHITECTURE and ROADMAP updated
  • No whole-image, Kernel or AP startup acceptance inferred from component checks
## Summary and rationale Make the bootstrap page-table planner count exactly the tables the mapper consumes. Preserve compatible original backing when rounded load pages share a page, split low identity mappings when read-only policy requires it, and reject conflicting translations or policies before changing tables. ## Tracking and scope Builds on #29. This fixes the paging component; dynamic-artifact production and whole-image kernel admission are separate work. ## Architecture, authority and failure behavior The existing UEFI allocation owns the exact table arena. Mapping requests describe geometry and policy; they do not grant backing memory. Keep the strict arena-consumption gate, reject physical rebinding and reserved control-window conflicts, and preserve neighboring permissions when splitting a huge leaf. The existing broad identity map and absence of NX policy are unchanged and are not claimed as solved here. ## Validation evidence - [x] Original formatting, strict Clippy, host and UEFI builds, tests and rustdoc gates - [x] Production mapper exercised by 43 compiled Rust controls, including exact allocation, read-only splitting, genuine shared rounded pages and refusal before mutation - [x] Documentation and Markdown checks - [x] Current published CI Host tests execute the production planner and mapper using explicitly owned test storage. They do not prove firmware placement or guest execution. ## Review checklist - [x] Original source, signed commits and main-branch dependency declarations - [x] Inline contracts and cohesive source files below 1,000 lines - [x] README, ARCHITECTURE and ROADMAP updated - [x] No whole-image, Kernel or AP startup acceptance inferred from component checks
Run the unchanged native population algorithm on explicitly owned hosted table bytes. Preserve strict arena accounting and check actual leaves, compatible rounded LOAD sharing, read-only identity policy and refusal of conflicting backing before mapping effects. Hosted storage makes no firmware placement or execution claim.
Compile the real page planner and mapper in hosted owned-byte controls without importing the native-only arena initialization helper. Preserve mandatory warnings and the original mapping behavior for the pre-fix regression capture.
Count only page tables actually needed by writable identity reuse, and split original large leaves when a requested page must be read-only. Preflight canonical byte geometry and sorted overlapping requests before table writes, refusing changed backing, conflicting write policy and reserved routes. Keep exact used-versus-owned arena accounting and preserve neighboring original leaves.
Refuse conflicting controller descriptors before population and exercise canonical, recursive-slot and byte-offset rejection. Verify one split table preserves separate read-only and writable requested pages without widening their policy.
Use the actual original planned page count for conflicting requests so an excess test allocation cannot accidentally satisfy the expected refusal through the strict final arena gate.
Convert the handoff usize selector explicitly before forming the canonical reserved window, preserving checked mapping admission and the independent negative fixture.
Keep the same architectural rejection while using the standard interval predicate required by strict Clippy.
docs: Explain exact bootstrap paging and genuine shared-page controls
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 44s
814d28416f
Document original arena custody, read-only identity splitting and compatible page sharing alongside their authority boundaries. Use two disjoint byte intervals that actually share a rounded page, with explicit boundary assertions, rather than an adjacent-page fixture.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 13:58:33 +01:00
erikinkinen changed title from WIP: Preserve exact bootstrap page-table backing and permissions to Preserve exact bootstrap page-table backing and permissions 2026-11-13 13:59:52 +01:00
Author
Owner

The paging component is ready for review at 814d2841. Its original gates pass locally and current CI passes, including the actual UEFI build. The controls execute the production mapper and cover exact arena use, read-only splitting, compatible rounded-page sharing and refusal before mutation. Whole-image Kernel admission remains separate.

The paging component is ready for review at `814d2841`. Its original gates pass locally and [current CI passes](https://git.erikinkinen.fi/erix/bootloader/actions/runs/308), including the actual UEFI build. The controls execute the production mapper and cover exact arena use, read-only splitting, compatible rounded-page sharing and refusal before mutation. Whole-image Kernel admission remains separate.
erikinkinen manually merged commit 6f64d18178 into feature/x86-startup-resources 2026-11-13 20:51:36 +01:00
Sign in to join this conversation.
No description provided.