diff options
author | neel <neel@FreeBSD.org> | 2015-05-28 17:37:01 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2015-05-28 17:37:01 +0000 |
commit | 3f2b4fc770fb5b735b286cf251b967cfa4afdf12 (patch) | |
tree | bf06da9d3f5b0d4207c8486e7021daaf66ac42b5 /sys/amd64/vmm/intel | |
parent | 67b3bbe09c36f09dda55d0e010c9d1bf12cc6073 (diff) | |
download | FreeBSD-src-3f2b4fc770fb5b735b286cf251b967cfa4afdf12.zip FreeBSD-src-3f2b4fc770fb5b735b286cf251b967cfa4afdf12.tar.gz |
Fix non-deterministic delays when accessing a vcpu that was in "running" or
"sleeping" state. This is done by forcing the vcpu to transition to "idle"
by returning to userspace with an exit code of VM_EXITCODE_REQIDLE.
MFC after: 2 weeks
Diffstat (limited to 'sys/amd64/vmm/intel')
-rw-r--r-- | sys/amd64/vmm/intel/vmx.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 4c3f20d..7ee50d4 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -2554,7 +2554,7 @@ vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit) static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap, - void *rendezvous_cookie, void *suspend_cookie) + struct vm_eventinfo *evinfo) { int rc, handled, launched; struct vmx *vmx; @@ -2623,18 +2623,24 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap, * vmx_inject_interrupts() can suspend the vcpu due to a * triple fault. */ - if (vcpu_suspended(suspend_cookie)) { + if (vcpu_suspended(evinfo)) { enable_intr(); vm_exit_suspended(vmx->vm, vcpu, rip); break; } - if (vcpu_rendezvous_pending(rendezvous_cookie)) { + if (vcpu_rendezvous_pending(evinfo)) { enable_intr(); vm_exit_rendezvous(vmx->vm, vcpu, rip); break; } + if (vcpu_reqidle(evinfo)) { + enable_intr(); + vm_exit_reqidle(vmx->vm, vcpu, rip); + break; + } + if (vcpu_should_yield(vm, vcpu)) { enable_intr(); vm_exit_astpending(vmx->vm, vcpu, rip); |