Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vmm_instruction_emul.h
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* | /* | ||||
* APIs to fetch and decode the instruction from nested page fault handler. | * APIs to fetch and decode the instruction from nested page fault handler. | ||||
* | * | ||||
* 'vie' must be initialized before calling 'vmm_fetch_instruction()' | * 'vie' must be initialized before calling 'vmm_fetch_instruction()' | ||||
*/ | */ | ||||
int vmm_fetch_instruction(struct vm *vm, int cpuid, | int vmm_fetch_instruction(struct vm *vm, int cpuid, | ||||
struct vm_guest_paging *guest_paging, | struct vm_guest_paging *guest_paging, | ||||
uint64_t rip, int inst_length, struct vie *vie); | uint64_t rip, int inst_length, struct vie *vie, | ||||
int *fault); | |||||
/* | /* | ||||
* Translate the guest linear address 'gla' to a guest physical address. | * Translate the guest linear address 'gla' to a guest physical address. | ||||
* | * | ||||
* Returns 0 on success and '*gpa' contains the result of the translation. | * retval guest_fault Interpretation | ||||
* Returns 1 if an exception was injected into the guest. | * 0 0 'gpa' contains result of the translation | ||||
* Returns -1 otherwise. | * 0 1 An exception was injected into the guest | ||||
* EFAULT N/A An unrecoverable hypervisor error occurred | |||||
*/ | */ | ||||
int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, | int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, | ||||
uint64_t gla, int prot, uint64_t *gpa); | uint64_t gla, int prot, uint64_t *gpa, int *guest_fault); | ||||
void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); | void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); | ||||
/* | /* | ||||
* Decode the instruction fetched into 'vie' so it can be emulated. | * Decode the instruction fetched into 'vie' so it can be emulated. | ||||
* | * | ||||
* 'gla' is the guest linear address provided by the hardware assist | * 'gla' is the guest linear address provided by the hardware assist | ||||
* that caused the nested page table fault. It is used to verify that | * that caused the nested page table fault. It is used to verify that | ||||
Show All 12 Lines |