summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm/intel
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2015-01-18 03:08:30 +0000
committerneel <neel@FreeBSD.org>2015-01-18 03:08:30 +0000
commitd9f07f98412532f2077e8a8503651536223931ca (patch)
tree059a656c08c5c81e9f08be1740cebcdf26e3df13 /sys/amd64/vmm/intel
parent359b23588446cd5af725d5a06bf6058c4ffa57b9 (diff)
downloadFreeBSD-src-d9f07f98412532f2077e8a8503651536223931ca.zip
FreeBSD-src-d9f07f98412532f2077e8a8503651536223931ca.tar.gz
Simplify instruction restart logic in bhyve.
Keep track of the next instruction to be executed by the vcpu as 'nextrip'. As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should start execution. Also, instruction restart happens implicitly via 'vm_inject_exception()' or explicitly via 'vm_restart_instruction()'. The APIs behave identically in both kernel and userspace contexts. The main beneficiary is the instruction emulation code that executes in both contexts. bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length' as readonly: - Restarting an instruction is now done by calling 'vm_restart_instruction()' as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout()) - Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch()) Differential Revision: https://reviews.freebsd.org/D1526 Reviewed by: grehan MFC after: 2 weeks
Diffstat (limited to 'sys/amd64/vmm/intel')
-rw-r--r--sys/amd64/vmm/intel/vmx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index a10a591..c83a8b2 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -2412,6 +2412,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
if (vm_mem_allocated(vmx->vm, gpa) ||
apic_access_fault(vmx, vcpu, gpa)) {
vmexit->exitcode = VM_EXITCODE_PAGING;
+ vmexit->inst_length = 0;
vmexit->u.paging.gpa = gpa;
vmexit->u.paging.fault_type = ept_fault_type(qual);
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1);
OpenPOWER on IntegriCloud