Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libvmmapi/vmmapi.h
Show All 30 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/cpuset.h> | #include <sys/cpuset.h> | ||||
/* | /* | ||||
* API version for out-of-tree consumers like grub-bhyve for making compile | * API version for out-of-tree consumers like grub-bhyve for making compile | ||||
* time decisions. | * time decisions. | ||||
*/ | */ | ||||
#define VMMAPI_VERSION 0102 /* 2 digit major followed by 2 digit minor */ | #define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ | ||||
struct iovec; | struct iovec; | ||||
struct vmctx; | struct vmctx; | ||||
enum x2apic_state; | enum x2apic_state; | ||||
/* | /* | ||||
* Different styles of mapping the memory assigned to a VM into the address | * Different styles of mapping the memory assigned to a VM into the address | ||||
* space of the controlling process. | * space of the controlling process. | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Map the memory segment identified by 'segid' into the guest address space | * Map the memory segment identified by 'segid' into the guest address space | ||||
* at [gpa,gpa+len) with protection 'prot'. | * at [gpa,gpa+len) with protection 'prot'. | ||||
*/ | */ | ||||
int vm_mmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, int segid, | int vm_mmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, int segid, | ||||
vm_ooffset_t segoff, size_t len, int prot); | vm_ooffset_t segoff, size_t len, int prot); | ||||
int vm_create(const char *name); | int vm_create(const char *name); | ||||
int vm_get_device_fd(struct vmctx *ctx); | |||||
struct vmctx *vm_open(const char *name); | struct vmctx *vm_open(const char *name); | ||||
void vm_destroy(struct vmctx *ctx); | void vm_destroy(struct vmctx *ctx); | ||||
int vm_parse_memsize(const char *optarg, size_t *memsize); | int vm_parse_memsize(const char *optarg, size_t *memsize); | ||||
int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); | int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); | ||||
void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); | void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); | ||||
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); | int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); | ||||
int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, | int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, | ||||
uint64_t gla, int prot, uint64_t *gpa, int *fault); | uint64_t gla, int prot, uint64_t *gpa, int *fault); | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, | int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, | ||||
int func, uint64_t addr, uint64_t msg, int numvec); | int func, uint64_t addr, uint64_t msg, int numvec); | ||||
int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, | int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, | ||||
int func, int idx, uint64_t addr, uint64_t msg, | int func, int idx, uint64_t addr, uint64_t msg, | ||||
uint32_t vector_control); | uint32_t vector_control); | ||||
int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); | int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); | ||||
int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); | int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); | ||||
const cap_ioctl_t *vm_get_ioctls(size_t *len); | |||||
/* | /* | ||||
* Return a pointer to the statistics buffer. Note that this is not MT-safe. | * Return a pointer to the statistics buffer. Note that this is not MT-safe. | ||||
*/ | */ | ||||
uint64_t *vm_get_stats(struct vmctx *ctx, int vcpu, struct timeval *ret_tv, | uint64_t *vm_get_stats(struct vmctx *ctx, int vcpu, struct timeval *ret_tv, | ||||
int *ret_entries); | int *ret_entries); | ||||
const char *vm_get_stat_desc(struct vmctx *ctx, int index); | const char *vm_get_stat_desc(struct vmctx *ctx, int index); | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |