Page MenuHomeFreeBSD

bhyve: Sleep briefly in the VMEXIT_DEBUG handler
ClosedPublic

Authored by markj on Mar 20 2023, 2:57 PM.
Tags
None
Referenced Files
F167724586: D39174.diff
Mon, Aug 24, 1:14 AM
Unknown Object (File)
Sun, Aug 23, 1:24 PM
Unknown Object (File)
Sun, Aug 23, 1:22 PM
Unknown Object (File)
Sun, Aug 23, 1:09 PM
Unknown Object (File)
Jul 22 2026, 11:28 PM
Unknown Object (File)
Jun 26 2026, 12:10 AM
Unknown Object (File)
Jun 23 2026, 5:15 PM
Unknown Object (File)
Jun 21 2026, 1:30 PM
Subscribers

Details

Summary

As of commit 0bda8d3e9f7a ("vmm: permit some IPIs to be handled by
userspace") and commit 9cc9abf409cc ("bhyve: create all vcpus on
startup"), we have a misbehaviour where AP vCPU threads spin until they
receive a SIPI. In particular, since they are "suspended", they simply
call the VMEXIT_DEBUG handler in a loop, but the handler is a no-op by
default.

This is tricky to fix since the gdb stub isn't aware of whether a given
vCPU is supposed to be running. For 13.2's sake, introduce a simple
workaround wherein the VMEXIT_DEBUG handler sleeps for a short period.
This ensures that host CPU usage remains sane when VMs are starting.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable