From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH] kvmtool: delegate exit/reboot responsibility to vcpu0 Date: Thu, 14 Apr 2016 09:49:33 +0100 Message-ID: <20160414084933.GB23207@arm.com> References: <1460389061-19451-1-git-send-email-will.deacon@arm.com> <570EF90B.908@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, mpe@ellerman.id.au, Julien Grall To: Balbir Singh Return-path: Received: from foss.arm.com ([217.140.101.70]:40499 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754584AbcDNIte (ORCPT ); Thu, 14 Apr 2016 04:49:34 -0400 Content-Disposition: inline In-Reply-To: <570EF90B.908@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 14, 2016 at 11:57:31AM +1000, Balbir Singh wrote: > > > On 12/04/16 01:37, Will Deacon wrote: > > Our exit/reboot code is a bit of a mess: > > > > - Both kvm__reboot and kvm_cpu_exit send SIGKVMEXIT to running vcpus > > - When vcpu0 exits, the main thread starts executing destructors > > (exitcalls) whilst other vcpus may be running > > - The pause_lock isn't always held when inspecting is_running for > > a vcpu > > > > This patch attempts to fix these issues by restricting the exit/reboot > > path to vcpu0 and the main thread. In particular, a KVM_SYSTEM_EVENT > > will signal SIGKVMEXIT to vcpu0, which will join with the main thread > > and then tear down the other vcpus before invoking any destructor code. > > > > Cc: Julien Grall > > Cc: Balbir Singh > > Signed-off-by: Will Deacon > > --- > > > > Balbir -- does this work on ppc? > > > Yes, it does > > Acked-by: Balbir Singh > > My patch for exit race fixes can be dropped in favour of this change Thanks, Balbir! I've pushed it out, along with your ppc changes. Will