Changeset View
Changeset View
Standalone View
Standalone View
lib/libvmmapi/vmmapi.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
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_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, | int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, | ||||
int *wired); | int *wired); | ||||
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); | uint64_t gla, int prot, uint64_t *gpa, int *fault); | ||||
uint32_t vm_get_lowmem_limit(struct vmctx *ctx); | uint32_t vm_get_lowmem_limit(struct vmctx *ctx); | ||||
void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); | void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); | ||||
void vm_set_memflags(struct vmctx *ctx, int flags); | void vm_set_memflags(struct vmctx *ctx, int flags); | ||||
size_t vm_get_lowmem_size(struct vmctx *ctx); | size_t vm_get_lowmem_size(struct vmctx *ctx); | ||||
size_t vm_get_highmem_size(struct vmctx *ctx); | size_t vm_get_highmem_size(struct vmctx *ctx); | ||||
int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, | int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, | ||||
uint64_t base, uint32_t limit, uint32_t access); | uint64_t base, uint32_t limit, uint32_t access); | ||||
int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, | int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
int vm_get_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state *s); | int vm_get_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state *s); | ||||
int vm_set_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state s); | int vm_set_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state s); | ||||
int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); | int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); | ||||
/* | /* | ||||
* Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. | * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. | ||||
* The 'iovcnt' should be big enough to accomodate all GPA segments. | * The 'iovcnt' should be big enough to accomodate all GPA segments. | ||||
* Returns 0 on success, 1 on a guest fault condition and -1 otherwise. | * | ||||
* retval fault Interpretation | |||||
* 0 0 Success | |||||
* 0 1 An exception was injected into the guest | |||||
* EFAULT N/A Error | |||||
*/ | */ | ||||
int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, | int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, | ||||
uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); | uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, | ||||
int *fault); | |||||
void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, | void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, | ||||
void *host_dst, size_t len); | void *host_dst, size_t len); | ||||
void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, | void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, | ||||
struct iovec *guest_iov, size_t len); | struct iovec *guest_iov, size_t len); | ||||
void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, | void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, | ||||
int iovcnt); | int iovcnt); | ||||
/* RTC */ | /* RTC */ | ||||
Show All 23 Lines |