summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-03-17 23:30:38 +0000
committerneel <neel@FreeBSD.org>2014-03-17 23:30:38 +0000
commit9e498dc1161a9ae61d66645734a969dce6aaa24f (patch)
treec77786aa3aef3881c70e9521b7d6c8fd878d649a
parentd5f533fd038883ed27840ec652a210040e7892b7 (diff)
downloadFreeBSD-src-9e498dc1161a9ae61d66645734a969dce6aaa24f.zip
FreeBSD-src-9e498dc1161a9ae61d66645734a969dce6aaa24f.tar.gz
Notify vcpus participating in the rendezvous of the pending event to ensure
that they execute the rendezvous function as soon as possible.
-rw-r--r--sys/amd64/vmm/vmm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index cd87fdd..f1f6031 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -1657,6 +1657,8 @@ void
vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t dest,
vm_rendezvous_func_t func, void *arg)
{
+ int i;
+
/*
* Enforce that this function is called without any locks
*/
@@ -1687,6 +1689,15 @@ restart:
vm_set_rendezvous_func(vm, func);
mtx_unlock(&vm->rendezvous_mtx);
+ /*
+ * Wake up any sleeping vcpus and trigger a VM-exit in any running
+ * vcpus so they handle the rendezvous as soon as possible.
+ */
+ for (i = 0; i < VM_MAXCPU; i++) {
+ if (CPU_ISSET(i, &dest))
+ vcpu_notify_event(vm, i, false);
+ }
+
vm_handle_rendezvous(vm, vcpuid);
}
OpenPOWER on IntegriCloud