From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH 4/5] Fix a race during exit processing Date: Mon, 11 Apr 2016 16:37:29 +0100 Message-ID: <20160411153728.GB19749@arm.com> References: <1459423707-8956-1-git-send-email-bsingharora@gmail.com> <1459423707-8956-5-git-send-email-bsingharora@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, mpe@ellerman.id.au, mikey@neuling.org To: Balbir Singh Return-path: Received: from foss.arm.com ([217.140.101.70]:50624 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755325AbcDKPhc (ORCPT ); Mon, 11 Apr 2016 11:37:32 -0400 Content-Disposition: inline In-Reply-To: <1459423707-8956-5-git-send-email-bsingharora@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Mar 31, 2016 at 10:28:26PM +1100, Balbir Singh wrote: > Fix a race, described below > > lkvm stop ... handle_stop > kvm_cpu__reboot > kvm_cmd_run_exit > vcpus exit > ... > dev_exit > ... > ioport__unregister > ..serial... > kvm__pause --> br_write_lock > pthread_kill > > But the thread is already dead above. > > We mark the cpus as dying so that kvm_pause does nothing. > This should not break any semantics I'm not convinced that this solves the whole problem. The fact of the matter is that we're tearing down the VM whilst there may still be active vcpus, so I'd much rather delay the teardown until we know that the vcpus are all dead. Patch incoming. Will