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
Unknown Object (File)
Sat, Feb 21, 5:43 AM
Unknown Object (File)
Wed, Feb 18, 6:44 AM
Unknown Object (File)
Wed, Feb 18, 5:34 AM
Unknown Object (File)
Tue, Feb 17, 7:45 AM
Unknown Object (File)
Mon, Feb 16, 11:19 AM
Unknown Object (File)
Mon, Feb 16, 11:19 AM
Unknown Object (File)
Mon, Jan 26, 8:47 PM
Unknown Object (File)
Mon, Jan 26, 6:25 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 50484
Build 47375: arc lint + arc unit