Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/include/vmm.h
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | struct vm_copyinfo { | ||||
void *cookie; | void *cookie; | ||||
}; | }; | ||||
/* | /* | ||||
* Set up 'copyinfo[]' to copy to/from guest linear address space starting | * Set up 'copyinfo[]' to copy to/from guest linear address space starting | ||||
* at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for | * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for | ||||
* a copyin or PROT_WRITE for a copyout. | * a copyin or PROT_WRITE for a copyout. | ||||
* | * | ||||
* Returns 0 on success. | * retval is_fault Intepretation | ||||
* Returns 1 if an exception was injected into the guest. | * 0 0 Success | ||||
* Returns -1 otherwise. | * 0 1 An exception was injected into the guest | ||||
* EFAULT N/A Unrecoverable error | |||||
* | * | ||||
* The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if | * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if | ||||
* the return value is 0. The 'copyinfo[]' resources should be freed by calling | * the return value is 0. The 'copyinfo[]' resources should be freed by calling | ||||
* 'vm_copy_teardown()' after the copy is done. | * 'vm_copy_teardown()' after the copy is done. | ||||
*/ | */ | ||||
int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, | int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, | ||||
uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, | uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, | ||||
int num_copyinfo); | int num_copyinfo, int *is_fault); | ||||
void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, | void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, | ||||
int num_copyinfo); | int num_copyinfo); | ||||
void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, | void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, | ||||
void *kaddr, size_t len); | void *kaddr, size_t len); | ||||
void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr, | void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr, | ||||
struct vm_copyinfo *copyinfo, size_t len); | struct vm_copyinfo *copyinfo, size_t len); | ||||
int vcpu_trace_exceptions(struct vm *vm, int vcpuid); | int vcpu_trace_exceptions(struct vm *vm, int vcpuid); | ||||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |