Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2014 23:30:38 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263280 - head/sys/amd64/vmm
Message-ID:  <201403172330.s2HNUcch012821@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Mon Mar 17 23:30:38 2014
New Revision: 263280
URL: http://svnweb.freebsd.org/changeset/base/263280

Log:
  Notify vcpus participating in the rendezvous of the pending event to ensure
  that they execute the rendezvous function as soon as possible.

Modified:
  head/sys/amd64/vmm/vmm.c

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Mon Mar 17 23:21:31 2014	(r263279)
+++ head/sys/amd64/vmm/vmm.c	Mon Mar 17 23:30:38 2014	(r263280)
@@ -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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403172330.s2HNUcch012821>