Crate hypervisor [] [src]

This is a Rust library that taps into functionality that enables hardware-accelerated execution of virtual machines on OS X.

It binds to the Hypervisor framework on OS X, and exposes a safe Rust interface through the hypervisor module, and an unsafe foreign function interface through the hypervisor::ffi module.

To use this library, you need

  • OS X Yosemite (10.10), or newer

  • an Intel processor with the VT-x feature set that includes Extended Page Tables (EPT) and Unrestricted Mode. To verify this, run and expect the following in your Terminal:

    $ sysctl kern.hv_support
    kern.hv_support: 1
    

Modules

consts

Some useful constants

ffi

Bindings to the Hypervisor Framework

Structs

vCPU

Virtual CPU

Enums

Error

Error returned after every call

MemPerm

Guest physical memory region permissions

VMXCap

VMX cabability

x86Reg

x86 architectural register

Functions

create_vm

Creates a VM instance for the current Mach task

destroy_vm

Destroys the VM instance associated with the current Mach task

interrupt_vcpus

Forces an immediate VMEXIT of a set of vCPUs

map_mem

Maps a region in the virtual address space of the current Mach task into the guest physical address space of the virutal machine

protect_mem

Modifies the permissions of a region in the guest physical address space of the virtual machine

read_vmx_cap

Reads a VMX capability of the host processor

sync_tsc

Synchronizes the guest Timestamp-Counters (TSC) across all vCPUs

unmap_mem

Unmaps a region in the guest physical address space of the virutal machine