[BUG] Route the boot LAPIC timer vector to its native handler #43

Closed
opened 2026-10-02 11:40:56 +02:00 by erikinkinen · 0 comments
Owner

Summary

The executable boot IDT routes the LAPIC timer vector through a fallback assembly stub that only executes IRETQ. The existing timer acknowledgment/rearm and interrupt-event handler is not connected to that installed vector. A hardware timer interrupt therefore cannot reach those handlers or drive deadline wakeups through this boot path. This is a source-confirmed liveness defect; no runtime reproduction is claimed.

Reproduction

Inspect Kernel f957c8296c3bda282d5a14e456c5d515d25850a7: src/bin/kernel/faults.rs install_idt passes erix_default_irq_stub for every non-exception vector. src/arch/x86_64/idt.rs init_bsp_idt_with_handlers applies that address to vectors 32 through 255, including LAPIC_TIMER_VECTOR (0xE0). src/bin/kernel/entry_stubs.rs implements the fallback as IRETQ alone. src/arch/x86_64/irq.rs handle_lapic_timer_interrupt contains acknowledgment/rearm/event work, but the executable installs no path to it. No VM command has been executed under the current testing waiver.

Expected and actual behavior

A real LAPIC timer interrupt should enter a dedicated native handler, preserve the interrupted architectural state, acknowledge and rearm the configured timer, and publish only authorized original deadline/event work before resuming safely. The source-selected executable path currently returns without performing those operations. Connecting the handler must not switch through unrelated scheduler-test contexts or hold object locks across an interrupt return.

Environment and identity

  • Kernel: f957c8296c3bda282d5a14e456c5d515d25850a7; Integration graph: 617d66f2fc6f571316068956d5388601c7642781.
  • Branch: feature/posix-compat; affected path: x86_64 executable boot IDT with an actual LAPIC timer enabled.
  • Image digest, executed VM/hardware, firmware and toolchain versions: not collected; source-only evidence.
  • Relevant authority: the Kernel owns the local interrupt controller; userspace must retain explicit Time authority for any deadline registration.
  • Last known working revision: unknown.

Evidence and prior checks

The source paths above establish the disconnected handler. Existing hosted handler calls or scheduler diagnostics do not prove execution through the boot-installed hardware vector. Add a native interrupt-entry control exercising the actual vector, acknowledgment/rearm and preserved user/kernel state, plus actual monotonic deadline wakeup. Tests, builds and CI observation remain deferred; authored coverage is not an executed pass.

Tracking

Prerequisite for original descriptor readiness and phase completion. Coordinate the actual IRQ entry, explicit deadline ownership and native workload without adding implicit user clock or foreign-process authority.

Authorized native deadlines — 2 October 2026

ARM_DEADLINE (0x59) derives the actual current running process, generation and CSpace, validates the original dedicated Time SEND binding and syscall window, admits a calibrated clock and real interrupt source, and reserves storage before returning an original timer selector. No extra service grant, copied capability, retained user pointer, relative overflow or arbitrary duration/count ceiling is introduced.

Binding loss retains one final original wake; terminal cleanup ends all custody, and serials never wrap/reset.

Runtime and owned-invocation images include the real APIC backend; unsupported profiles refuse timer admission. Elapsed decisions use calibrated monotonic nanoseconds, never interrupt counts.

It requires actual native blocking, increased hardware acknowledgment, a newer epoch, elapsed status and GP/direction canaries, then cancels the original timer. The required deadline marker follows every native/user assertion.

This prerequisite adds no phase acceptance. Timed still needs counted original public deadline waiters/cancellation; descriptor/provider subscriptions, mediator/client consumers, signals and complete poll/select workloads remain unfinished. A service must cover every real event source before replacing cooperative yielding with atomic waiting. Both complete EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.

Related records and contracts
Repository Links
integration PR 12
kernel issue 43, PR 3
lib-ipc PR 2, native-deadlines.md
## Summary The executable boot IDT routes the LAPIC timer vector through a fallback assembly stub that only executes IRETQ. The existing timer acknowledgment/rearm and interrupt-event handler is not connected to that installed vector. A hardware timer interrupt therefore cannot reach those handlers or drive deadline wakeups through this boot path. This is a source-confirmed liveness defect; no runtime reproduction is claimed. ## Reproduction Inspect Kernel `f957c8296c3bda282d5a14e456c5d515d25850a7`: src/bin/kernel/faults.rs install_idt passes erix_default_irq_stub for every non-exception vector. src/arch/x86_64/idt.rs init_bsp_idt_with_handlers applies that address to vectors 32 through 255, including LAPIC_TIMER_VECTOR (0xE0). src/bin/kernel/entry_stubs.rs implements the fallback as IRETQ alone. src/arch/x86_64/irq.rs handle_lapic_timer_interrupt contains acknowledgment/rearm/event work, but the executable installs no path to it. No VM command has been executed under the current testing waiver. ## Expected and actual behavior A real LAPIC timer interrupt should enter a dedicated native handler, preserve the interrupted architectural state, acknowledge and rearm the configured timer, and publish only authorized original deadline/event work before resuming safely. The source-selected executable path currently returns without performing those operations. Connecting the handler must not switch through unrelated scheduler-test contexts or hold object locks across an interrupt return. ## Environment and identity - Kernel: `f957c8296c3bda282d5a14e456c5d515d25850a7`; Integration graph: `617d66f2fc6f571316068956d5388601c7642781`. - Branch: feature/posix-compat; affected path: x86_64 executable boot IDT with an actual LAPIC timer enabled. - Image digest, executed VM/hardware, firmware and toolchain versions: not collected; source-only evidence. - Relevant authority: the Kernel owns the local interrupt controller; userspace must retain explicit Time authority for any deadline registration. - Last known working revision: unknown. ## Evidence and prior checks The source paths above establish the disconnected handler. Existing hosted handler calls or scheduler diagnostics do not prove execution through the boot-installed hardware vector. Add a native interrupt-entry control exercising the actual vector, acknowledgment/rearm and preserved user/kernel state, plus actual monotonic deadline wakeup. Tests, builds and CI observation remain deferred; authored coverage is not an executed pass. ## Tracking Prerequisite for [original descriptor readiness](https://git.erikinkinen.fi/erix/posixd/issues/33) and [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). Coordinate the actual IRQ entry, explicit deadline ownership and native workload without adding implicit user clock or foreign-process authority. ### Authorized native deadlines — 2 October 2026 ARM_DEADLINE (0x59) derives the actual current running process, generation and CSpace, validates the original dedicated Time SEND binding and syscall window, admits a calibrated clock and real interrupt source, and reserves storage before returning an original timer selector. No extra service grant, copied capability, retained user pointer, relative overflow or arbitrary duration/count ceiling is introduced. Binding loss retains one final original wake; terminal cleanup ends all custody, and serials never wrap/reset. Runtime and owned-invocation images include the real APIC backend; unsupported profiles refuse timer admission. Elapsed decisions use calibrated monotonic nanoseconds, never interrupt counts. It requires actual native blocking, increased hardware acknowledgment, a newer epoch, elapsed status and GP/direction canaries, then cancels the original timer. The required deadline marker follows every native/user assertion. This prerequisite adds no phase acceptance. Timed still needs counted original public deadline waiters/cancellation; descriptor/provider subscriptions, mediator/client consumers, signals and complete poll/select workloads remain unfinished. A service must cover every real event source before replacing cooperative yielding with atomic waiting. Both complete EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | integration | [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12) | | kernel | [issue 43](https://git.erikinkinen.fi/erix/kernel/issues/43), [PR 3](https://git.erikinkinen.fi/erix/kernel/pulls/3) | | lib-ipc | [PR 2](https://git.erikinkinen.fi/erix/lib-ipc/pulls/2), [native-deadlines.md](https://git.erikinkinen.fi/erix/lib-ipc/src/branch/feature/posix-compat/docs/native-deadlines.md) | </details>
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:29 +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#43
No description provided.