L4Re Operating System Framework – Interface and Usage Documentation
|
Virtual machine API for VMX. More...
Functions | |
l4_uint64_t | l4_vm_vmx_get_caps (void const *vcpu_state, unsigned cap_msr) L4_NOTHROW |
Get a capability register for VMX. | |
l4_uint32_t | l4_vm_vmx_get_caps_default1 (void const *vcpu_state, unsigned cap_msr) L4_NOTHROW |
Get a default to one capability register for VMX. | |
unsigned | l4_vm_vmx_field_len (unsigned field) L4_NOTHROW |
Return length in bytes of a VMCS field. | |
unsigned | l4_vm_vmx_field_order (unsigned field) L4_NOTHROW |
Return length in power of two (bytes) of a VMCS field. | |
void | l4_vm_vmx_clear (void *vmcs, void *user_vmcs) L4_NOTHROW |
Saves cached state from the kernel VMCS to the user VMCS. | |
void | l4_vm_vmx_ptr_load (void *vmcs, void *user_vmcs) L4_NOTHROW |
Loads the user_vmcs as the current VMCS. | |
l4_uint32_t | l4_vm_vmx_get_cr2_index (void const *vmcs) L4_NOTHROW |
Get the VMCS field index of the virtual CR2 register. | |
l4_umword_t | l4_vm_vmx_read_nat (void *vmcs, unsigned field) L4_NOTHROW |
Read a natural width VMCS field. | |
l4_uint16_t | l4_vm_vmx_read_16 (void *vmcs, unsigned field) L4_NOTHROW |
Read a 16bit VMCS field. | |
l4_uint32_t | l4_vm_vmx_read_32 (void *vmcs, unsigned field) L4_NOTHROW |
Read a 32bit VMCS field. | |
l4_uint64_t | l4_vm_vmx_read_64 (void *vmcs, unsigned field) L4_NOTHROW |
Read a 64bit VMCS field. | |
l4_uint64_t | l4_vm_vmx_read (void *vmcs, unsigned field) L4_NOTHROW |
Read any VMCS field. | |
void | l4_vm_vmx_write_nat (void *vmcs, unsigned field, l4_umword_t val) L4_NOTHROW |
Write to a natural width VMCS field. | |
void | l4_vm_vmx_write_16 (void *vmcs, unsigned field, l4_uint16_t val) L4_NOTHROW |
Write to a 16bit VMCS field. | |
void | l4_vm_vmx_write_32 (void *vmcs, unsigned field, l4_uint32_t val) L4_NOTHROW |
Write to a 32bit VMCS field. | |
void | l4_vm_vmx_write_64 (void *vmcs, unsigned field, l4_uint64_t val) L4_NOTHROW |
Write to a 64bit VMCS field. | |
void | l4_vm_vmx_write (void *vmcs, unsigned field, l4_uint64_t val) L4_NOTHROW |
Write to an arbitrary VMCS field. | |
Virtual machine API for VMX.
anonymous enum |
Additional (virtual) VMCS fields.
The VMCS offsets defined here are actually not in the hardware VMCS. However our VMMs run in user mode and need to have access to certain registers available in kernel mode only. So we put them into our version of the VMCS.
Enumerator | |
---|---|
L4_VM_VMX_VMCS_CR2 | VMCS offset for CR2.
|
L4_VM_VMX_VMCS_XCR0 | VMCS offset of extended control register XCR0. |
L4_VM_VMX_VMCS_MSR_SYSCALL_MASK | VMCS offset of system call flag mask MSR. |
L4_VM_VMX_VMCS_MSR_LSTAR | VMCS offset of IA32e mode system call target address MSR. |
L4_VM_VMX_VMCS_MSR_CSTAR | VMCS offset of IA32 mode system call target address MSR. |
L4_VM_VMX_VMCS_MSR_TSC_AUX | VMCS offset of auxiliary TSC signature MSR. |
L4_VM_VMX_VMCS_MSR_STAR | VMCS offset of system call target address MSR. |
L4_VM_VMX_VMCS_MSR_KERNEL_GS_BASE | VMCS offset of GS base address swap target MSR. |
Definition at line 105 of file __vm-vmx.h.
enum L4_vm_vmx_caps_regs |
Exported VMX capability registers.
Definition at line 39 of file __vm-vmx.h.
enum L4_vm_vmx_dfl1_regs |
Exported VMX capability registers (default to 1 bits).
Definition at line 62 of file __vm-vmx.h.
|
inline |
Saves cached state from the kernel VMCS to the user VMCS.
vmcs | Pointer to the kernel VMCS. |
user_vmcs | Pointer to the user VMCS. |
This function is comparable to VMX vmclear.
Definition at line 433 of file __vm-vmx.h.
Referenced by l4_vm_vmx_ptr_load().
|
inline |
Return length in bytes of a VMCS field.
field | Field number. |
Definition at line 357 of file __vm-vmx.h.
References l4_vm_vmx_field_order().
|
inline |
Return length in power of two (bytes) of a VMCS field.
field | Field number. |
Definition at line 342 of file __vm-vmx.h.
Referenced by l4_vm_vmx_field_len().
|
inline |
Get a capability register for VMX.
vcpu_state | Pointer to the VCPU state of the VCPU. |
cap_msr | Caps register index (see L4_vm_vmx_caps_regs). |
Definition at line 529 of file __vm-vmx.h.
References L4_VCPU_OFFSET_EXT_INFOS.
|
inline |
Get a default to one capability register for VMX.
vcpu_state | Pointer to the VCPU state of the VCPU. |
cap_msr | Default 1 caps register index (see L4_vm_vmx_dfl1_regs). |
Definition at line 537 of file __vm-vmx.h.
References L4_VCPU_OFFSET_EXT_INFOS, L4_VM_VMX_NUM_CAPS_REGS, and L4_VM_VMX_PINBASED_CTLS_DFL1_REG.
|
inline |
Get the VMCS field index of the virtual CR2 register.
vmcs | Pointer to the software VMCS. |
The CR2 register is actually not in the hardware VMCS, however our VMMs run in user mode and need to have access to this register so we put it into our software version of the VMCS.
Definition at line 545 of file __vm-vmx.h.
|
inline |
Loads the user_vmcs as the current VMCS.
vmcs | Pointer to the kernel VMCS. |
user_vmcs | Pointer to the user VMCS. |
This function is comparable to VMX vmptrld.
Definition at line 445 of file __vm-vmx.h.
References l4_vm_vmx_clear().
|
inline |
Read any VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
Definition at line 481 of file __vm-vmx.h.
References l4_vm_vmx_read_16(), l4_vm_vmx_read_32(), l4_vm_vmx_read_64(), and l4_vm_vmx_read_nat().
|
inline |
Read a 16bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
Definition at line 466 of file __vm-vmx.h.
Referenced by l4_vm_vmx_read().
|
inline |
Read a 32bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
Definition at line 471 of file __vm-vmx.h.
Referenced by l4_vm_vmx_read().
|
inline |
Read a 64bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
Definition at line 476 of file __vm-vmx.h.
Referenced by l4_vm_vmx_read().
|
inline |
Read a natural width VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
Definition at line 461 of file __vm-vmx.h.
Referenced by l4_vm_vmx_read().
|
inline |
Write to an arbitrary VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
val | The value that shall be written to the given field. |
Definition at line 516 of file __vm-vmx.h.
References l4_vm_vmx_write_16(), l4_vm_vmx_write_32(), l4_vm_vmx_write_64(), and l4_vm_vmx_write_nat().
|
inline |
Write to a 16bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
val | The value that shall be written to the given field. |
Definition at line 500 of file __vm-vmx.h.
Referenced by l4_vm_vmx_write().
|
inline |
Write to a 32bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
val | The value that shall be written to the given field. |
Definition at line 505 of file __vm-vmx.h.
Referenced by l4_vm_vmx_write().
|
inline |
Write to a 64bit VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
val | The value that shall be written to the given field. |
Definition at line 510 of file __vm-vmx.h.
Referenced by l4_vm_vmx_write().
|
inline |
Write to a natural width VMCS field.
vmcs | Pointer to the software VMCS. |
field | The VMCS field index as used on VMX hardware. |
val | The value that shall be written to the given field. |
Definition at line 495 of file __vm-vmx.h.
Referenced by l4_vm_vmx_write().