Page MenuHomeFreeBSD

Fix bhyve w/ INVARIANTS post D13573
AbandonedPublic

Authored by kmacy on Feb 15 2018, 3:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 11 2023, 3:49 AM
Unknown Object (File)
Oct 15 2023, 8:19 AM
Unknown Object (File)
Aug 15 2023, 4:17 PM
Unknown Object (File)
Aug 15 2023, 3:01 PM
Unknown Object (File)
Mar 3 2023, 4:25 PM
Unknown Object (File)
Feb 16 2023, 6:37 AM
Unknown Object (File)
Feb 1 2023, 5:18 PM
Unknown Object (File)
Jan 7 2023, 4:06 PM
Subscribers
Tokens
"Orange Medal" token, awarded by dch.

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 - subversion
Lint
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.
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 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.