Skip to content

kthread_tests::* leave IF clear before kernel_main_continue(), hanging first x86 registry dispatch #682

Description

@ryanbreen

Problem

Every case in kernel::task::kthread_tests::* ends with arch_disable_interrupts(). Nothing re-enables interrupts before control returns to kernel_main_continue(), so that function is entered with IF clear (interrupts masked). This is not theoretical: it permanently hung the first x86 staged-registry dispatch after [STAGE:serial:ADVANCE].

Current workaround (call-site only, not a source fix)

Branch feat/green-tracing @ d9266b71 worked around this at the call site — saving, enabling, and restoring the interrupt flag around the dispatch — rather than fixing the actual test cases. That branch's impl-notes.md records this explicitly as a by-catch discovery: "noted, not rewritten."

What's needed

Fix the source defect: kthread_tests::* cases should not leave the CPU with interrupts disabled on return. Either each case should restore interrupts before returning, or the harness/runner around them should own that guarantee structurally (not via an ad hoc save/enable/restore wrapped around one particular dispatch call site).

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions