WIP: Retain native address-space backing through execution #141

Draft
erikinkinen wants to merge 73 commits from feature/native-private-root-activation into feature/retained-processor-topology-intake
Owner

Keep actual process backing, CPU stacks and private page-table allocations alive through native selection, mapping replacement and retirement. Closed root interrupts consume the original pending request; user entry and final return retain the original execution through machine-state restoration and terminal cleanup.

Builds on #142 (and its #139 foundation) with the retained IPC/boot-source suppliers. The topology diagnostic runs after the original owned-stack preparation; firmware traversal is not restored. Design and remaining authority requirements: #123. This draft is not ready for native use or merge.

  • Retain original CPU/root occupations and real AP startup resources through admission, refusal and uncertain completion.
  • Stage managed, anonymous, boot, registered and framebuffer mapping changes with owned forward/rollback resources and hardware clearance.
  • Preserve original framebuffer cache policy and perform real USER-permission exposure/reactivation transactions.
  • Capture original user state, block unsafe returns and use a fresh owned successor frame for terminal faults.
  • Exercise the original interrupt and full-register return instruction streams, including independent RCX/R11 and complete machine-state preservation.
  • Complete DeviceFrame/raw-memory source, alias, mapping and revocation custody; never import ownership from coordinate rows.
  • Receive actual loaded Kernel/DSO image grants and restrict supervisor mappings to their genuine sources, excluding unwanted loader/firmware/free aliases.
  • Verify the full AP cache-control policy and all remaining contention/cleanup paths.
  • Pass current-head component CI.
  • Demonstrate actual native entry, mapping/revocation and retirement on coherent 1/2/4-CPU images. Hosted controls and image builds do not satisfy this requirement.
Keep actual process backing, CPU stacks and private page-table allocations alive through native selection, mapping replacement and retirement. Closed root interrupts consume the original pending request; user entry and final return retain the original execution through machine-state restoration and terminal cleanup. Builds on #142 (and its #139 foundation) with the retained IPC/boot-source suppliers. The topology diagnostic runs after the original owned-stack preparation; firmware traversal is not restored. Design and remaining authority requirements: [#123](https://git.erikinkinen.fi/erix/kernel/issues/123). This draft is not ready for native use or merge. - [x] Retain original CPU/root occupations and real AP startup resources through admission, refusal and uncertain completion. - [x] Stage managed, anonymous, boot, registered and framebuffer mapping changes with owned forward/rollback resources and hardware clearance. - [x] Preserve original framebuffer cache policy and perform real USER-permission exposure/reactivation transactions. - [x] Capture original user state, block unsafe returns and use a fresh owned successor frame for terminal faults. - [x] Exercise the original interrupt and full-register return instruction streams, including independent RCX/R11 and complete machine-state preservation. - [ ] Complete DeviceFrame/raw-memory source, alias, mapping and revocation custody; never import ownership from coordinate rows. - [ ] Receive actual loaded Kernel/DSO image grants and restrict supervisor mappings to their genuine sources, excluding unwanted loader/firmware/free aliases. - [ ] Verify the full AP cache-control policy and all remaining contention/cleanup paths. - [x] Pass current-head component CI. - [ ] Demonstrate actual native entry, mapping/revocation and retirement on coherent 1/2/4-CPU images. Hosted controls and image builds do not satisfy this requirement.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 14:09:38 +01:00
Preserve the original GP registers and hardware frame before scalar dispatch on the dedicated NMI IST, returning with IRETQ only for an authenticated request. Keep unrelated NMIs on the existing fatal path. Borrow the original pending request for physical APIC delivery and retain the established ICR deadline without treating dispatch as peer acknowledgement.
Keep tagless NMIs outside root replacement. A dedicated root interrupt can return safely after a late notification without leaving residual authority to suppress unrelated hardware NMIs.
Preserve the original NMI fatal oracle and reserve a closed supervisor gate for root mailbox notifications. Borrow the actual pending CPU request for bounded physical delivery, acknowledge real late interrupts without granting completion, and prepare each original AP controller before readiness. Retain complete scalar interrupt state and exercise the production entry through hardware return.
Observe the fixture callee inside the original assembly window so omitting dispatch cannot pass by leaving interrupted state untouched.
Keep original CPU request and receiver roles native-only. Hosted gates exercise descriptive IDT and entry contracts without constructing a hardware delivery role; native controller-disabled profiles retain explicit refusal.
Include the real controller EOI in the existing acknowledgement metric while leaving scheduler and deadline ticks unchanged.
Retain actual Kernel image grants and private table allocations through prepared CPU entry and physical CR3 replacement. Keep old and new resources in original CPU slots and return actual mailbox resources after native completion. Selection, safe Kernel roots and peer publication remain in progress.
Move original boot resources into the actual CPU allocation before a closed nonreturning stack transfer. Consume them once only after verifying the native continuation is executing within that owned stack.
Check the original CPU, actual owned-stack execution and consumed one-shot grant storage before bootstrap preparation or runtime effects. A published phase or observed stack address alone does not establish this origin.
Retain a distinct aligned bootstrap continuation allocation in the original CPU record. Native stack transfer and origin checks use that allocation, so TSS RSP0 and syscall entry cannot overwrite suspended bootstrap frames.
Move original boot sources through a closed nonreturning continuation. Prepare Kernel objects and install its safe supervisor root before AP bringup, then consume one local prepared context for Rootd launch. Retain original providers across phase boundaries and require actual owned-stack custody before effects.
Retain original boot sources and validated module records during Kernel preparation. Select Rootd only when consuming the context for launch, before publishing its runtime objects.
Route diagnostic images through the fixed owned-stack continuation and retain the prepared boot occupation across their native entries. Build fixtures on initialized objects and seed managed RAM from original boot exclusions instead of resetting live registries or reconstructing authority from ingress records.
Carry the V2.1 handoff consumer and complete counted catalog queries onto the native root foundation. Preserve original boot-file source custody, full catalog-store authentication and fixed-record ingress validation.
Publish startup roles only from the initial reserved-memory transaction after checking the adopted hierarchy and actual loader stack. Retain the same exclusions through hierarchy subscriptions and exclusive scratch loans; quarantine uncertain AP scratch instead of reusing it. Native completion and AP consumption remain part of the private activation implementation.
Compare only existing hierarchy and scratch roles under their original nonreplaceable reservation guard. The comparison grants no completion authority and cannot rearm uncertain physical scratch.
Write complete preflighted fragments through the guarded physical window while retaining the original exclusive scratch record. Do not rely on an identity mapping or accept caller-supplied physical destinations.
Require the original prepared boot occupation for native SMP. Write relocatable packets through exclusive startup loans, use actual CPU-owned worker stacks and original low hierarchies, and collect sealed final-root admission before scratch reuse. Serialize each physical startup signal with source completion and retain all uncertain resources while aborting later starts. Poll original root requests at unlocked idle boundaries.
Consume the separate pre-dispatch cancellation proof when the attached source cannot enter physical dispatch. Preserve the original refusal while releasing only the proven unpublished scratch occupation.
Share the original assembled transition with an independent bounded real-mode prefix interpreter. Exercise low and high SIPI locations, a complete 64 KiB stack and full-width protected targets. Reject the actual MOV-symbol encoding regression through an emitted-byte mutation control; this checks encoding rather than native startup acceptance.
Use only the returned original admission body for native AP completion. Remove the unused transition counter, its writable packet field and its assembly effect.
Keep startup allocation authority absent from kernels without processor bringup. Preserve hosted accounting controls without constructing native roles, and retain wire validation independently of source-role production.
Derive physical changes from the original owned mapping candidate and require returned native resource clearance for commit or rollback. Keep withdrawn backing and its allocator duty in the VSpace through release failures, and expose interrupt transport roles only on supported controller routes.
Install one relocatable immutable packet for the entire diagnostic batch, observe its aligned counter through the retained coherent physical window, and abort rather than reuse uncertain physical startup. Keep counter observations separate from Kernel admission. Preflight atomic read geometry and preserve output and mapping policy on refusal.
Keep hierarchy loans exclusive to full native admission, and authenticate a sole BSP without requiring unused AP resources. Do not invent remote APIC identities from a package count. Propagate the original runtime initialization refusal and stop before Rootd instead of silently continuing after uncertain CPU startup.
Keep original boot-source ownership with the pending VSpace before publication and return that same owner on an unpublished preparation refusal. Derive prospective readiness from retained allocation/source policy, and dispose physically withdrawn candidates only after CPU-root exclusion ends.
Preserve both source histories while bringing the complete queued, serving, publisher and ordinary transport implementation and fixtures into private-root activation. Retain original owned-stack diagnostics and startup grants rather than the superseded entry continuation, and select the coherent counted-catalog and startup-resource providers in both explicit profiles.
The production retirement path retains its actual native withdrawal clearance. Scope the hosted fixture-only constructor to tests so ordinary strict library builds do not expose an unused alternate constructor.
Give the hosted exception, fallback and private-root fixtures distinct pure return tags and fixed external symbol definitions. This prevents empty-body address coalescing across optimized codegen units without mutable fixture state. Retain all native interrupt implementations and independent route, privilege and cleared-gate assertions.
Keep the diagnostic packet in its own assembly source and align its original atomic counter independently of surrounding linked text. Exercise the emitted CS-relative counter address and locked increment without treating a diagnostic halt as CPU admission.
Use explicit host-only fixture linkage names so descriptor identity remains stable without occupying the production assembly entry symbols used by independent ABI probes.
Acknowledge scalar root requests before task-state capture so a waiting producer can release its source guards. Preserve the original hardware frame across aligned calls, account actual user entry, and end the original return exclusion only at genuine CPL3 IRET boundaries. Keep Kernel-interrupted paths outside the user-return interval.
Drive the production error-code entry through hardware IRETQ with both incoming stack alignments. Retain independent vector, error, register, flags, machine-state and final-completion observations alongside the unchanged fatal NMI control.
Send genuine user exceptions through the captured-entry termination boundary instead of the Kernel-fatal oracle. Keep NMI, double fault and machine check fatal, and never reuse the interrupted frame as a successor context.
Consume the original captured execution for unresolved page faults and use the shared nonreturning terminal handoff. Legitimate capability contention must not fall through to a Kernel-wide exit, and terminal fault frames must not become successor resume storage.
Use explicit host-only fixture linkage names so descriptor identity remains stable without occupying the production assembly entry symbols used by independent ABI probes.
Compile the full process-root and AP admission path independently of the legacy real-mode diagnostic profiles. Deny compiler and linker warnings for this runtime so mutually exclusive diagnostic gates cannot hide unfinished native adapters.
Document the source owners, acknowledgement order and scalar final-return boundary. Separate terminal fault handling from ordinary delegated resume and retain the requirement for actual multicore execution and bounded firmware intake.
Keep the actual process body blocked through physical publication or rollback and retain final CPU return exclusion until the original assembly completion. Capture terminal current executions without restoring them, and route terminal entries through owned successor storage. Narrow scalar mailbox progress to entry metadata waits instead of the generic spinlock. Native guest acceptance and remaining device and activation mapping conversions remain open.
Retain both signed source ancestries and the actual owned-stack, AP, COW and final-return paths. Bring in the qualified counted boot catalog, serving suppliers and explicit current provider graph without reverting resource owners or hardware proof obligations.
Account terminal process totals through the closed original metadata chain and refuse a contended native scheduler directory before effects. Retry terminal successor retirement on one owned Kernel frame, then use a closed GP-complete resume stream with source-derived offsets and selectors restored before auxiliary state.
Execute the production instruction stream through hardware IRETQ using the actual frame layout and explicit hosted selectors. Observe independent RCX/R11, all general registers, flags, stack, FP state and the original scalar completion without substituting the restore instructions.
Keep the exact native exclusion abort on machine restore refusal while propagating the same result directly in hosted profiles.
Compose the checked full-register resume stream, its original hosted hardware ABI control and the platform-specific auxiliary restore error handling. Preserve the explicit public provider graph and prior source ancestry.
Derive a mapping-only original framebuffer grant before preparing a complete native root version. Preserve every original cache selector instead of forcing write combining, keep full caller ownership on unpublished refusal, and retain narrowed backing through uncertain publication and physical withdrawal. Release withdrawn source duties outside root exclusion without retaining rendering or delegation authority.
Compose the original cache-policy mapping grant with qualified serving and boot sources. Keep native forward/rollback ownership, exact source ancestry and independent acceptance obligations.
Limit scalar progress waits to genuine capture and final CPU boundaries. General selection and hierarchy producers refuse contention before effects; final terminal detach retains its original occupation through preparation refusal and retries outside source guards.
Keep exposure on the actual retained VSpace body and commit policy only beside native physical clearance. Change USER only for tracked leaves with original backing; disabled policy survives future admitted mapping candidates and genuine runnable selection reactivates through the same complete transaction. Retain unshared peer protection and refuse native directory contention before effects. Descriptor-only physical sources and inherited supervisor aliases remain explicit implementation prerequisites.
merge: Compose native exposure with retained source custody
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 3s
CI / test (push) Has been cancelled
074aeafbf4
Retain the original body exposure policy, checked mapping inventories and real reactivation transactions while preserving qualified serving, catalog and entry foundations. Keep unimplemented device and runtime-image ownership requirements explicit.
docs: Wrap the supervisor source acceptance boundary
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 7m58s
75e17788ee
Keep the remaining allowlist requirement readable within the shared Markdown format without changing its scope or evidence.
erikinkinen changed target branch from feature/boot-kernel-v2-startup-intake to feature/retained-processor-topology-intake 2026-11-13 15:24:36 +01:00
Compose the counted snapshot consumer while preserving actual prepared startup resources and the original native entry paths. Run its data-only diagnostic after the owned-stack and safe-root preparation boundaries, retain both native build profiles, and remove unused provider/data-observer glue.
Keep the prepared-context hardware observation used by the native sole-BSP coordinator. Snapshot decoding replaces firmware traversal but does not replace that independent original startup check.
fix: Make original native entry custody an unsafe contract
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 8m18s
2283a3821a
Raw pointers and copied frame words must not provide a safe API for creating original boot or user-entry roles. Mark the closed loader, interrupt and fault handovers unsafe and document their real source/lifetime requirements; preserve the machine calling conventions and instruction streams.
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 8m18s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'feature/native-private-root-activation:feature/native-private-root-activation'
git switch 'feature/native-private-root-activation'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'feature/retained-processor-topology-intake'
git merge --no-ff 'feature/native-private-root-activation'
git switch 'feature/native-private-root-activation'
git rebase 'feature/retained-processor-topology-intake'
git switch 'feature/retained-processor-topology-intake'
git merge --ff-only 'feature/native-private-root-activation'
git switch 'feature/native-private-root-activation'
git rebase 'feature/retained-processor-topology-intake'
git switch 'feature/retained-processor-topology-intake'
git merge --no-ff 'feature/native-private-root-activation'
git switch 'feature/retained-processor-topology-intake'
git merge --squash 'feature/native-private-root-activation'
git switch 'feature/retained-processor-topology-intake'
git merge --ff-only 'feature/native-private-root-activation'
git switch 'feature/retained-processor-topology-intake'
git merge 'feature/native-private-root-activation'
git push origin 'feature/retained-processor-topology-intake'
Sign in to join this conversation.
No description provided.