From: Julien Grall Subject: Re: [PATCH] kvmtool: delegate exit/reboot responsibility to vcpu0 Date: Tue, 12 Apr 2016 11:03:59 +0100 Message-ID: <570CC80F.8050409@arm.com> References: <1460389061-19451-1-git-send-email-will.deacon@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: mpe@ellerman.id.au, Balbir Singh To: Will Deacon , kvm@vger.kernel.org Return-path: Received: from foss.arm.com ([217.140.101.70]:54228 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756295AbcDLKEG (ORCPT ); Tue, 12 Apr 2016 06:04:06 -0400 In-Reply-To: <1460389061-19451-1-git-send-email-will.deacon@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Hello Will, On 11/04/2016 16: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 I've been able to power cycle 1000 guests without any issue. Without this patch it break at ~50 cycles. Tested-by: Julien Grall Regards, -- Julien Grall