From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balbir Singh Subject: Re: [PATCH] kvmtool: delegate exit/reboot responsibility to vcpu0 Date: Thu, 14 Apr 2016 11:57:31 +1000 Message-ID: <570EF90B.908@gmail.com> References: <1460389061-19451-1-git-send-email-will.deacon@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: mpe@ellerman.id.au, Julien Grall To: Will Deacon , kvm@vger.kernel.org Return-path: Received: from mail-pa0-f42.google.com ([209.85.220.42]:36646 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbcDNB5i (ORCPT ); Wed, 13 Apr 2016 21:57:38 -0400 Received: by mail-pa0-f42.google.com with SMTP id er2so11327153pad.3 for ; Wed, 13 Apr 2016 18:57:38 -0700 (PDT) In-Reply-To: <1460389061-19451-1-git-send-email-will.deacon@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 Balbir Singh