From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: kvm: qemu: stop/start cpus before/after devices Date: Thu, 26 Mar 2009 13:36:40 -0300 Message-ID: <20090326163640.GA9927@amt.cnet> References: <20090324171652.GA3655@amt.cnet> <49CA1970.1090509@redhat.com> <20090325142619.GA28345@amt.cnet> <20090325143932.GB28345@amt.cnet> <49CB52F2.3060203@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel , Dor Laor , Yaniv Kamay To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:43725 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753215AbZCZQg6 (ORCPT ); Thu, 26 Mar 2009 12:36:58 -0400 Content-Disposition: inline In-Reply-To: <49CB52F2.3060203@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Mar 26, 2009 at 12:03:30PM +0200, Avi Kivity wrote: > Marcelo Tosatti wrote: >> On Wed, Mar 25, 2009 at 11:26:19AM -0300, Marcelo Tosatti wrote: >> >>> On Wed, Mar 25, 2009 at 01:45:52PM +0200, Avi Kivity wrote: >>> >>>> Marcelo Tosatti wrote: >>>> >>>>> From: Yaniv Kamay >>>>> >>>>> Stop cpus before devices when stopping the VM, start cpus after devices >>>>> when starting VM. >>>>> >>>>> >>>> Why is this needed? >>>> >>> A vcpu could access a stopped device otherwise. >> >> Actually on vm_stop its safe because the order happens to be correct, >> but on vm_start its the other way around (vcpus start first, and they >> should be started last). >> > > But, we are holding qemu_mutex. How can vcpus access the devices? You're right, they can't. But its not bad to make it explicit, instead of relying on the locking behaviour?