From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 23:30:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 112F839E; Mon, 17 Mar 2014 23:30:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1AC6949; Mon, 17 Mar 2014 23:30:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HNUcwP012823; Mon, 17 Mar 2014 23:30:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HNUcch012821; Mon, 17 Mar 2014 23:30:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403172330.s2HNUcch012821@svn.freebsd.org> From: Neel Natu Date: Mon, 17 Mar 2014 23:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263280 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 23:30:39 -0000 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); }