Page MenuHomeFreeBSD

Fix bhyve w/ INVARIANTS post D13573

Authored by kmacy on Feb 15 2018, 3:41 AM.



D13573 broke bhyve if INVARIANTS is enabled with passthrough. This fixes the lock recursion without making the vcpu lock recursive.

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped
Build Status
Buildable 15059

Event Timeline

Only minor issue I had was the trailing underscores in the inline routine name: wasn't too sure if that was idiomatic FreeBSD. Maybe "_int" ?

This revision is now accepted and ready to land.Feb 15 2018, 5:03 PM

If you capture VMCS_GUEST_INTR_STATUS in the EXIT_REASON_HLT case of vmx_exit_process() then you can use that value in vmx_pending_intr() without having to use a vmx_getreg(). That circumvents the locking issue, removes the need for the special case #ifdef INVARIANTS/#endif code and may even improve the latency by skipping an iteration of VMPTRLD() and VMCLEAR().

cem added inline comments.

style(9) nit: Prefer bool + true/false in new code


style(9) nit: ampersand inside the parentheses?

dch added a subscriber: dch.

@kmacy tyvm works brilliantly here - I'll close the PR in bugzilla when this lands. Many many thanks!

The changes I proposed in the comments here, and reviewed in D14548, have been committed.