[FEATURE] Retain native fault continuations through scheduler handoff #122

Open
opened 2026-11-07 08:28:31 +01:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Native fault handling needs an explicit owner for the execution, frame, stack and mapping resources that remain involved while userspace receives a fault and chooses its disposition.

Proposed behavior and scope

Kernel fault handling transfers one original continuation through entry completion, scheduler handoff, userspace delivery and final return or disposal. Reserve a separate per-CPU continuation stack during fallible CPU setup; architectural interrupt stacks keep their existing roles. Coordinate Kernel, lib-ipc and Pagerd consumers.

Authority, security and reliability

A continuation retains its actual original execution, frame, stack and mapping owners. Addresses, process identifiers, source withdrawal and acknowledgements do not establish physical retirement. Partial handoff failures preserve those same resources and the first error. Release execution and memory resources only after their actual outstanding uses end. Do not allocate in interrupt or queue commit paths, hold mutable guards across interruptible waits, or lose timer/device work on contention.

Acceptance criteria

  • Reserve and retain original continuation storage before native fault entry.
  • Complete the actual stack and scheduler transfer before fault delivery.
  • Preserve original resources through registered, absent and withdrawn receiver paths.
  • Retain partial handoff and disposal duties until positive retirement.
  • Preserve timer, controller and device work under interrupt contention.
  • Verify actual VM handoff, replacement/replay refusals, repeated fault stress and SMP isolation.

Alternatives and tradeoffs

A separate retained continuation stack adds per-CPU storage but makes stack ownership explicit. Reusing an architectural interrupt stack would couple unrelated roles. A queued completion flag cannot replace the actual handoff and retirement resources.

Tracking and rollout

Part of Alpha 1 acceptance. Keep native admission disabled until the complete handoff, userspace consumers and failure paths are reviewed together. Source-model tests alone do not establish physical execution.

## Problem and motivation Native fault handling needs an explicit owner for the execution, frame, stack and mapping resources that remain involved while userspace receives a fault and chooses its disposition. ## Proposed behavior and scope Kernel fault handling transfers one original continuation through entry completion, scheduler handoff, userspace delivery and final return or disposal. Reserve a separate per-CPU continuation stack during fallible CPU setup; architectural interrupt stacks keep their existing roles. Coordinate Kernel, lib-ipc and Pagerd consumers. ## Authority, security and reliability A continuation retains its actual original execution, frame, stack and mapping owners. Addresses, process identifiers, source withdrawal and acknowledgements do not establish physical retirement. Partial handoff failures preserve those same resources and the first error. Release execution and memory resources only after their actual outstanding uses end. Do not allocate in interrupt or queue commit paths, hold mutable guards across interruptible waits, or lose timer/device work on contention. ## Acceptance criteria - [ ] Reserve and retain original continuation storage before native fault entry. - [ ] Complete the actual stack and scheduler transfer before fault delivery. - [ ] Preserve original resources through registered, absent and withdrawn receiver paths. - [ ] Retain partial handoff and disposal duties until positive retirement. - [ ] Preserve timer, controller and device work under interrupt contention. - [ ] Verify actual VM handoff, replacement/replay refusals, repeated fault stress and SMP isolation. ## Alternatives and tradeoffs A separate retained continuation stack adds per-CPU storage but makes stack ownership explicit. Reusing an architectural interrupt stack would couple unrelated roles. A queued completion flag cannot replace the actual handoff and retirement resources. ## Tracking and rollout Part of [Alpha 1 acceptance](https://git.erikinkinen.fi/erix/integration/issues/65). Keep native admission disabled until the complete handoff, userspace consumers and failure paths are reviewed together. Source-model tests alone do not establish physical execution.
erikinkinen added this to the Alpha 1 milestone 2026-11-07 08:28:31 +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/kernel#122
No description provided.