You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS/HVF: a first pause() ≥20 s after boot crashes the guest kernel on continue #377
Found by the macOS grounding run for #375 (PR #376): pause() is HMP stop, and continue() is cont.
On x86 under HVF (Intel Mac, macOS 26.6.2, QEMU 11.1.1, CHR 7.25.2, 1 vCPU, 512 MB), the first pause after each boot does not freeze guest time. On cont the guest sees the whole pause at once:
First pause after boot
Result
3 s (×2)
OK; uptime advanced the full wall time
10 s
OK; uptime advanced the full wall time
20 s
kernel failure, RouterOS reboots in the same QEMU (same PID)
30 s (×4, 15 s to 1:22 after boot)
same; continue took ~27.7 s
RouterOS logs system,error,critical kernel failure in previous boot and writes an autosupout.rif.
Every later pause in the same boot (five 30 s pauses) froze the clock as on KVM: uptime +2–3 s over 33–34 s of wall time, guest clock 32 s behind, continue in 2.4–3.0 s.
Linux/KVM does not do this. A 30 s pause straight after boot (uptime 21 s) kept a RAM :global, and uptime moved 2 s across about 32 s of wall time.
continue() reports success, because after the reboot REST answers again. Only the long wait and the reset uptime show what happened.
Suspected cause (unconfirmed): under HVF the TSC keeps counting across the first stop, and a jump of 20 s or more trips the guest kernel's soft-lockup limit (2 × 10 s). Later stops may freeze because the kernel has switched clocksource by then.
Open questions / possible work
Confirm the mechanism: the guest clocksource before and after the first resume, and whether -cpu host flags (invtsc and the like) or a QEMU version change matter.
Apple Silicon (arm64 under TCG) is untested.
Mitigation options: a short stop/cont "primer" right after boot on HVF; or pause() on HVF doing a quick stop/cont before the real stop, if that is enough.
Detection: continue() could notice a guest that rebooted during the resume (for example uptime compared with a value read before the pause, when REST is reachable) and say so instead of reporting a plain resume.
test/integration/pause-reset.test.ts now checks that a RAM value survives pause/continue, but its pause is about 5 s, below the threshold.
Documented as a caveat in MANUAL.md (pause) and qemu.instructions.md in #376.
Activity
docs(qemu): macOS/HVF first-pause caveat from the #375 grounding; tes…