Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1orB-0007Er-Ux for qemu-devel@nongnu.org; Wed, 06 May 2009 17:40:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1or7-0007CC-6F for qemu-devel@nongnu.org; Wed, 06 May 2009 17:40:49 -0400 Received: from [199.232.76.173] (port=38217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1or7-0007C5-0v for qemu-devel@nongnu.org; Wed, 06 May 2009 17:40:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:59138) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1or6-0005KA-I7 for qemu-devel@nongnu.org; Wed, 06 May 2009 17:40:44 -0400 Date: Wed, 6 May 2009 18:45:38 -0300 From: Glauber Costa Subject: Re: [Qemu-devel] [PATCH 1/4] move registering of cpu_reset to inside cpu_init Message-ID: <20090506214538.GI26401@poweredge.glommer> References: <1241621382-21577-1-git-send-email-glommer@redhat.com> <1241621382-21577-2-git-send-email-glommer@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Wed, May 06, 2009 at 10:36:16PM +0300, Blue Swirl wrote: > On 5/6/09, Glauber Costa wrote: > > This is not pc specific by any means. So we can be > > moved to inside cpu_x86_init(). > > > > This is part of an attempt to only initialize kvm state > > after everything is already properly initialized. If we don't > > do that, we can race against, for example, APIC state if kvm vcpus > > are ran in threads (happens in qemu-kvm.git, soon to happen here too) > > I'd move this too to exec.c. Sparc registers two reset functions, the > first one for the main cpu disables halted state, the second one for > non-boot cpus halts them on reset. I wonder why i386 does not do the > same. Probably because we were halting the cpu separatedly. Btw, after looking again, cpu_reset looks like an even better place to hold the halted change.