Page MenuHomeFreeBSD

Fix bhyve w/ INVARIANTS post D13573
AbandonedPublic

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

Details

Summary

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

Diff Detail

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

Event Timeline

kmacy created this revision.Feb 15 2018, 3:41 AM
grehan accepted this revision.Feb 15 2018, 5:03 PM

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 a subscriber: cem.Feb 27 2018, 4:00 PM
cem added inline comments.
sys/amd64/vmm/intel/vmx.c
2949

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

sys/amd64/vmm/vmm.c
314

style(9) nit: ampersand inside the parentheses?

dch accepted this revision.Feb 27 2018, 8:48 PM
dch added a subscriber: dch.

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

dch awarded a token.Feb 27 2018, 8:48 PM
tychon added a comment.Mar 7 2018, 8:15 PM

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

kmacy abandoned this revision.Mar 20 2018, 3:50 AM