From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5PkC-0005Ui-Aa for qemu-devel@nongnu.org; Tue, 03 Nov 2009 15:12:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5PkB-0005Tx-J5 for qemu-devel@nongnu.org; Tue, 03 Nov 2009 15:12:43 -0500 Received: from [199.232.76.173] (port=36208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5PkB-0005Tq-FD for qemu-devel@nongnu.org; Tue, 03 Nov 2009 15:12:43 -0500 Received: from fg-out-1718.google.com ([72.14.220.152]:58381) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5PkB-00060u-5C for qemu-devel@nongnu.org; Tue, 03 Nov 2009 15:12:43 -0500 Received: by fg-out-1718.google.com with SMTP id 16so538821fgg.10 for ; Tue, 03 Nov 2009 12:12:41 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1257277805-637-1-git-send-email-glommer@redhat.com> References: <1257277805-637-1-git-send-email-glommer@redhat.com> Date: Tue, 3 Nov 2009 21:12:41 +0100 Message-ID: <761ea48b0911031212h1e55a6aav3d0678a515a7fc5e@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] don't call reset functions on cpu initialization From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 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: aliguori@us.ibm.com, qemu-devel@nongnu.org On Tue, Nov 3, 2009 at 8:50 PM, Glauber Costa wrote: > There is absolutely no need to call reset functions when initializing > devices. Since we are already registering them, calling qemu_system_reset= () > should suffice. Actually, it is what happens when we reboot the machine, > and using the same process instead of a special case semantics will even > allow us to find bugs easier. > > Furthermore, the fact that we initialize things like the cpu quite early, > leads to the need to introduce synchronization stuff like qemu_system_con= d. > This patch removes it entirely. All we need to do is call qemu_system_res= et() > only when we're already sure the system is up and running > > I tested it with qemu (with and without io-thread) and qemu-kvm, and it > seems to be doing okay - although qemu-kvm uses a slightly different patc= h. > > Signed-off-by: Glauber Costa > --- > =A0hw/apic.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/e1000.c =A0 =A0 =A0 =A0 =A0 | =A0 =A01 - > =A0hw/hpet.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/i8254.c =A0 =A0 =A0 =A0 =A0 | =A0 =A02 -- > =A0hw/ide/piix.c =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/piix4.c =A0 =A0 =A0 =A0 =A0 | =A0 =A01 - > =A0hw/piix_pci.c =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/rtl8139.c =A0 =A0 =A0 =A0 | =A0 =A02 +- > =A0hw/serial.c =A0 =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/usb-ohci.c =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/usb-uhci.c =A0 =A0 =A0 =A0| =A0 =A01 - > =A0hw/vga.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A01 - > =A0target-i386/helper.c | =A0 =A01 - > =A0vl.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 15 +-------------- > =A014 files changed, 2 insertions(+), 28 deletions(-) [...] > diff --git a/target-i386/helper.c b/target-i386/helper.c > index c961544..957b3fc 100644 > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model) > =A0 =A0 =A0 =A0 return NULL; > =A0 =A0 } > =A0 =A0 mce_init(env); > - =A0 =A0cpu_reset(env); Who will call cpu_reset for user mode QEMU then? Laurent