Bug #13063

clarify VMCS interfaces in bhyve

Added by Patrick Mooney 7 months ago. Updated 6 months ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


As it was imported from FreeBSD, bhyve has an API surface for interacting with the VMCS (virtual machine control structure) when running on Intel hardware. This API is somewhat scattered and inconsistent, both in how it exposes access to VMCS tasks, and how it manipulates data when doing so. It is a mix of fallible (reporting errors) and infallible (panic on presumably unexpected errors) functions, with a real mix of how consumers use and interpret any potential error states.

It would be nice to clear this up so that all unexpected errors are handled with panic(), making handling easier for consumers. Additionally, any manipulation of the data being written/read from the VMCS should be done as part of the VMX logic, so it's clear, rather than being hidden by the VMCS API as it is now. The combination of these efforts should result in cleaner more readable code which is less prone to barreling through unexpected conditions.

Related issues

Related to illumos gate - Bug #13064: bhyve should not waste extra page for VMCSClosedPatrick Mooney


Updated by Electric Monk 7 months ago

  • Gerrit CR set to 860

Updated by Patrick Mooney 7 months ago

Using the proposed fix for this, I booted up the normal crew of guests:
- CentOS
- OmniOSce
- OpenBSD
- Windows

All seemed content to boot up normally.


Updated by Dan McDonald 6 months ago

  • Related to Bug #13064: bhyve should not waste extra page for VMCS added

Updated by Electric Monk 6 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 007ca33219ffdc49281657f5f8a9ee1bbfc367ab

commit  007ca33219ffdc49281657f5f8a9ee1bbfc367ab
Author: Patrick Mooney <>
Date:   2020-08-28T18:28:42.000Z

    13063 clarify VMCS interfaces in bhyve
    13064 bhyve should not waste extra page for VMCS
    Reviewed by: Robert Mustacchi <>
    Reviewed by: Mike Zeller <>
    Approved by: Dan McDonald <>

Also available in: Atom PDF