From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6grC-0003HL-TZ for qemu-devel@nongnu.org; Sat, 07 Nov 2009 03:41:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6gr7-0003AT-5X for qemu-devel@nongnu.org; Sat, 07 Nov 2009 03:41:13 -0500 Received: from [199.232.76.173] (port=42950 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6gr7-0003AI-08 for qemu-devel@nongnu.org; Sat, 07 Nov 2009 03:41:09 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:46662) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6gr6-0004YL-Lm for qemu-devel@nongnu.org; Sat, 07 Nov 2009 03:41:08 -0500 Received: by yxe26 with SMTP id 26so1499627yxe.4 for ; Sat, 07 Nov 2009 00:41:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20091106204115.GE12533@mothafucka.localdomain> References: <1257437115-22725-1-git-send-email-glommer@redhat.com> <20091106181153.GB12533@mothafucka.localdomain> <761ea48b0911061043i5dbaaab5td2e0d34cc4ed68a9@mail.gmail.com> <20091106204115.GE12533@mothafucka.localdomain> From: Blue Swirl Date: Sat, 7 Nov 2009 10:40:48 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] v3: don't call reset functions on cpu initialization Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: Laurent Desnogues , aliguori@us.ibm.com, qemu-devel@nongnu.org On Fri, Nov 6, 2009 at 10:41 PM, Glauber Costa wrote: > On Fri, Nov 06, 2009 at 09:01:45PM +0200, Blue Swirl wrote: >> On Fri, Nov 6, 2009 at 8:43 PM, Laurent Desnogues >> wrote: >> > On Fri, Nov 6, 2009 at 7:11 PM, Glauber Costa wro= te: >> >> On Fri, Nov 06, 2009 at 08:05:40PM +0200, Blue Swirl wrote: >> >>> On Thu, Nov 5, 2009 at 6:05 PM, Glauber Costa w= rote: >> > [...] >> >>> > --- a/target-i386/helper.c >> >>> > +++ b/target-i386/helper.c >> >>> > @@ -1885,7 +1885,9 @@ CPUX86State *cpu_x86_init(const char *cpu_mo= del) >> >>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 return NULL; >> >>> > =C2=A0 =C2=A0 } >> >>> > =C2=A0 =C2=A0 mce_init(env); >> >>> > +#ifdef CONFIG_USER_ONLY >> >>> > =C2=A0 =C2=A0 cpu_reset(env); >> >>> > +#endif >> >>> >> >>> Please push the call to *-user/main.c, just after call to cpu_init()= . >> >> I'd prefer it that way too. But cpu_reset is also called in some othe= r places, >> >> and Laurent suggested me to to this way. >> > >> > Yes, you'd have to remove all calls to cpu_reset from all CPUs. >> > And also add a call to cpu_reset to cpu_copy. >> > >> >> I don't really know much about -user, so I'm fine with whatever you g= uys agree on. >> > >> > I honestly don't care that much as long as all targets still work >> > in user mode :-) >> > >> > The aim was to make Glauber's patch less intrusive. >> >> Given that only the new calls to cpu_reset are important and the >> removals are much less so (double reset shouldn't be a problem), the >> least intrusive version would be to just add the new calls and do the >> clean up later. > Which IMHO, pretty much means apply it this way, and then later on move > the reset functions elsewhere for -user, if one wants to. Thanks, applied. While testing I noticed that the poor x86 emulator does not survive even five system_resets until BIOS refuses to boot. This happens without your patch. In comparison, I see no problems resetting Sparc32, Sparc64 or PPC.