Changeset View
Changeset View
Standalone View
Standalone View
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 0102 /* 2 digit major followed by 2 digit minor */ | ||||
grehan: Need to bump the minor number since there 2 new api calls. | |||||
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. | ||||
*/ | */ | ||||
enum vm_mmap_style { | enum vm_mmap_style { | ||||
VM_MMAP_NONE, /* no mapping */ | VM_MMAP_NONE, /* no mapping */ | ||||
VM_MMAP_ALL, /* fully and statically mapped */ | VM_MMAP_ALL, /* fully and statically mapped */ | ||||
VM_MMAP_SPARSE, /* mappings created on-demand */ | VM_MMAP_SPARSE, /* mappings created on-demand */ | ||||
}; | }; | ||||
Not Done Inline ActionsWhile here, could you fix the style(9) violation? All the member names should align. lattera-gmail.com: While here, could you fix the style(9) violation? All the member names should align. | |||||
/* | /* | ||||
* 'flags' value passed to 'vm_set_memflags()'. | * 'flags' value passed to 'vm_set_memflags()'. | ||||
*/ | */ | ||||
#define VM_MEM_F_INCORE 0x01 /* include guest memory in core file */ | #define VM_MEM_F_INCORE 0x01 /* include guest memory in core file */ | ||||
#define VM_MEM_F_WIRED 0x02 /* guest memory is wired */ | #define VM_MEM_F_WIRED 0x02 /* guest memory is wired */ | ||||
/* | /* | ||||
Show All 35 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 u_long *vm_get_ioctls(size_t *len); | |||||
Not Done Inline Actionsu_long can be changed to cap_ioctl_t here. This file already requires <sys/types.h>, which unconditionally defines that type (the man page for cap_ioctls_limit needs to be updated). grehan: u_long can be changed to cap_ioctl_t here. This file already requires <sys/types.h>, which… | |||||
/* | /* | ||||
* 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 |
Need to bump the minor number since there 2 new api calls.