[DragonFlyBSD - Bug #3477] (New) x86_64: stopped cpus without MONITOR never restart
tuxillo
bugtracker-admin at leaf.dragonflybsd.org
Sun Nov 22 04:33:12 PST 2026
Issue #3477 has been reported by tuxillo.
----------------------------------------
Bug #3477: x86_64: stopped cpus without MONITOR never restart
http://bugs.dragonflybsd.org/issues/3477
* Author: tuxillo
* Status: New
* Priority: Normal
* Target version: 6.6
* Start date: 2026-11-22
----------------------------------------
As of master e2619a112f, on x86_64 cpus without MONITOR/MWAIT, a cpu stopped by stop_cpus() never restarts. That covers QEMU's default cpu models, other VMs and some old cpus. ddb's continue leaves the other cpus parked for good, and so does dump_reactivate_cpus() in a dump to dm_crypt.
A stopped cpu loops in Xcpustop, calling lwkt_smp_stopped(), until its bit shows up in started_cpus. Since 63cff0361c (2016) lwkt_smp_stopped() ends in cpu_smp_stopped(), which waits on started_cpus with MONITOR/MWAIT, or without MONITOR calls cpu_halt() with the comment "depend on lapic timer". But cpu_halt() is @for (;;) hlt;@ and never returns, so the cpu never looks at started_cpus again.
The attached patch calls cpu_pause() there instead, so these cpus spin while stopped, as they did before 63cff0361c. FreeBSD's cpustop_handler() also spins with ia32_pause() when it can't use mwait.
I tested in an 8-vCPU QEMU guest (nvmm) whose cpu has no MONITOR. Before the patch, with a TLB shootdown load running, ddb's continue didn't come back in 3 of 3 tries, and the QEMU monitor showed the stopped vCPUs in cpu_halt(). With the patch and no load, ddb's continue came back DDB_RESULT, and restartwait.c from #3476 ran 5000 stop/restart rounds with every cpu restarting in each round, within 175 us. Its FAIL line there is #3476 (restart_cpus() returns without waiting), not this bug. I didn't test a dm_crypt dump, or hardware without MONITOR.
---Files--------------------------------
0001-x86_64-spin-in-cpu_smp_stopped-when-there-is-no-MONI.patch (2.04 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list