Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Implement ARM64 exit_qemu() via PSCI SYSTEM_OFF so kthread tests can cleanly exit QEMU on ARM64
  • Extract kthread lifecycle/join tests into shared task/kthread_tests.rs using arch-generic wrappers (both x86_64 and ARM64 pass)
  • Add unified kthread-test and boot-test-btrt xtask commands with --arch x86_64|arm64
  • Fix BTRT finalization hang: grace period fallback extracts results after 120s even when stuck test processes prevent ===BTRT_READY===
  • Make btrt::finalize() idempotent; add fallback finalize when last userspace thread exits
  • Expand BTRT catalog with full userspace test coverage and per-process PID registration
  • Add breenix> shell prompt validation in boot_test_btrt

Test Results

Test x86_64 ARM64
kthread-test PASS PASS
boot-test-btrt 53 pass / 11 fail 52 pass / 24 fail

Test failures are pre-existing functional issues (fs_write, cloexec, waitpid, etc.), not infrastructure problems. Both architectures now produce structured BTRT results reliably.

Test plan

  • cargo run -p xtask -- kthread-test --arch x86_64 — PASS
  • cargo run -p xtask -- kthread-test --arch arm64 — PASS
  • cargo run -p xtask -- boot-test-btrt --arch arm64 — extracts results, shell prompt validated
  • cargo run -p xtask -- boot-test-btrt --arch x86_64 — extracts results via grace period fallback
  • Zero compiler warnings on all build configs (testing, kthread_test_only, btrt — both architectures)

🤖 Generated with Claude Code

ryanbreen and others added 2 commits February 10, 2026 07:02
Replace brittle serial-marker-matching CI with an in-memory result table
that the kernel populates during boot. The host extracts results via QMP
pmemsave, producing reliable, timing-independent test results.

Kernel-side (btrt feature flag):
- BTRT data structures: header + 512-entry table in BSS (#[no_mangle])
- Test catalog with 33 milestones across x86_64 and ARM64 boot paths
- KTAP-formatted serial output for human-readable results
- Instrumentation at key boot milestones in main.rs and main_aarch64.rs
- Page-table-walking virt_to_phys on x86_64, HHDM subtraction on ARM64
- Tracing counters for boot test pass/fail/skip totals
- Boot test tracing provider (temporarily disabled pending integration)

Host-side (xtask):
- QMP client for QEMU machine protocol over Unix socket
- Binary BTRT parser with magic validation and result extraction
- boot-test-btrt command: build, launch QEMU, wait for sentinel, extract
- Parallel support for both x86_64 and ARM64 architectures

run.sh integration:
- --btrt flag delegates to xtask boot-test-btrt
- Works with --x86 (x86_64) and default (ARM64)

Verified: x86_64 16/16 pass, ARM64 13/13 pass, zero warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add cross-architecture kthread tests, ARM64 QEMU exit, unified xtask
commands, and BTRT finalization fallback:

- Implement ARM64 exit_qemu() via PSCI SYSTEM_OFF (HVC #0)
- Extract kthread tests into shared task/kthread_tests.rs module
  using arch-generic halt/interrupt wrappers
- Add kthread test calls + kthread_test_only exit path to ARM64 entry
- Add `cargo run -p xtask -- kthread-test --arch x86_64|arm64` command
- Add `cargo run -p xtask -- boot-test-btrt` grace period fallback:
  extracts BTRT results after 120s even if stuck processes prevent
  BTRT_READY sentinel (handles both stale and noisy serial output)
- Make btrt::finalize() idempotent with AtomicBool guard
- Add fallback BTRT finalize in sys_exit when no userspace threads remain
- Add breenix> shell prompt validation in boot_test_btrt
- Expand BTRT test catalog with full userspace test coverage
- Add per-process BTRT registration in test_exec.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 67235a9 into main Feb 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant