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/amd/svm.c | |
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/amd/svm.c')
-rw-r--r-- | sys/amd64/vmm/amd/svm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index 20e8f76..53b12b7 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -1900,7 +1900,7 @@ enable_gintr(void) */ static int svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap, - void *rend_cookie, void *suspended_cookie) + struct vm_eventinfo *evinfo) { struct svm_regctx *gctx; struct svm_softc *svm_sc; @@ -1975,18 +1975,24 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap, */ disable_gintr(); - if (vcpu_suspended(suspended_cookie)) { + if (vcpu_suspended(evinfo)) { enable_gintr(); vm_exit_suspended(vm, vcpu, state->rip); break; } - if (vcpu_rendezvous_pending(rend_cookie)) { + if (vcpu_rendezvous_pending(evinfo)) { enable_gintr(); vm_exit_rendezvous(vm, vcpu, state->rip); break; } + if (vcpu_reqidle(evinfo)) { + enable_gintr(); + vm_exit_reqidle(vm, vcpu, state->rip); + break; + } + /* We are asked to give the cpu by scheduler. */ if (vcpu_should_yield(vm, vcpu)) { enable_gintr(); |