Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/intel/vmcs.h
Show All 26 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _VMCS_H_ | #ifndef _VMCS_H_ | ||||
#define _VMCS_H_ | #define _VMCS_H_ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct vm_snapshot_meta; | |||||
struct vmcs { | struct vmcs { | ||||
uint32_t identifier; | uint32_t identifier; | ||||
uint32_t abort_code; | uint32_t abort_code; | ||||
char _impl_specific[PAGE_SIZE - sizeof(uint32_t) * 2]; | char _impl_specific[PAGE_SIZE - sizeof(uint32_t) * 2]; | ||||
}; | }; | ||||
CTASSERT(sizeof(struct vmcs) == PAGE_SIZE); | CTASSERT(sizeof(struct vmcs) == PAGE_SIZE); | ||||
/* MSR save region is composed of an array of 'struct msr_entry' */ | /* MSR save region is composed of an array of 'struct msr_entry' */ | ||||
struct msr_entry { | struct msr_entry { | ||||
uint32_t index; | uint32_t index; | ||||
uint32_t reserved; | uint32_t reserved; | ||||
uint64_t val; | uint64_t val; | ||||
}; | }; | ||||
int vmcs_set_msr_save(struct vmcs *vmcs, u_long g_area, u_int g_count); | int vmcs_set_msr_save(struct vmcs *vmcs, u_long g_area, u_int g_count); | ||||
int vmcs_init(struct vmcs *vmcs); | int vmcs_init(struct vmcs *vmcs); | ||||
int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); | int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); | ||||
int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); | int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); | ||||
int vmcs_getdesc(struct vmcs *vmcs, int running, int ident, | int vmcs_getdesc(struct vmcs *vmcs, int running, int ident, | ||||
struct seg_desc *desc); | struct seg_desc *desc); | ||||
int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, | int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, | ||||
struct seg_desc *desc); | struct seg_desc *desc); | ||||
#ifdef BHYVE_SNAPSHOT | |||||
int vmcs_getany(struct vmcs *vmcs, int running, int ident, uint64_t *val); | |||||
int vmcs_setany(struct vmcs *vmcs, int running, int ident, uint64_t val); | |||||
int vmcs_snapshot_reg(struct vmcs *vmcs, int running, int ident, | |||||
struct vm_snapshot_meta *meta); | |||||
int vmcs_snapshot_desc(struct vmcs *vmcs, int running, int seg, | |||||
struct vm_snapshot_meta *meta); | |||||
int vmcs_snapshot_any(struct vmcs *vmcs, int running, int ident, | |||||
struct vm_snapshot_meta *meta); | |||||
#endif | |||||
/* | /* | ||||
* Avoid header pollution caused by inline use of 'vtophys()' in vmx_cpufunc.h | * Avoid header pollution caused by inline use of 'vtophys()' in vmx_cpufunc.h | ||||
*/ | */ | ||||
#ifdef _VMX_CPUFUNC_H_ | #ifdef _VMX_CPUFUNC_H_ | ||||
static __inline uint64_t | static __inline uint64_t | ||||
vmcs_read(uint32_t encoding) | vmcs_read(uint32_t encoding) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 346 Lines • Show Last 20 Lines |