qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: Glauber Costa <glommer@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] don't call reset functions on cpu initialization
Date: Tue, 3 Nov 2009 21:24:59 +0100	[thread overview]
Message-ID: <761ea48b0911031224m685786a3v981616eb7cb92eef@mail.gmail.com> (raw)
In-Reply-To: <20091103201628.GD3118@mothafucka.localdomain>

On Tue, Nov 3, 2009 at 9:16 PM, Glauber Costa <glommer@redhat.com> wrote:
> On Tue, Nov 03, 2009 at 09:12:41PM +0100, Laurent Desnogues wrote:
>> On Tue, Nov 3, 2009 at 8:50 PM, Glauber Costa <glommer@redhat.com> 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_cond.
>> > This patch removes it entirely. All we need to do is call qemu_system_reset()
>> > 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 patch.
>> >
>> > Signed-off-by: Glauber Costa <glommer@redhat.com>
>> > ---
>> >  hw/apic.c            |    1 -
>> >  hw/e1000.c           |    1 -
>> >  hw/hpet.c            |    1 -
>> >  hw/i8254.c           |    2 --
>> >  hw/ide/piix.c        |    1 -
>> >  hw/piix4.c           |    1 -
>> >  hw/piix_pci.c        |    1 -
>> >  hw/rtl8139.c         |    2 +-
>> >  hw/serial.c          |    1 -
>> >  hw/usb-ohci.c        |    1 -
>> >  hw/usb-uhci.c        |    1 -
>> >  hw/vga.c             |    1 -
>> >  target-i386/helper.c |    1 -
>> >  vl.c                 |   15 +--------------
>> >  14 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)
>> >         return NULL;
>> >     }
>> >     mce_init(env);
>> > -    cpu_reset(env);
>>
>> Who will call cpu_reset for user mode QEMU then?
>
> I believe we can then call it explicitly right after we call cpu_init
> for user mode, then
>
> or can't we?

Can't say :-)

Perhaps the safest thing to do would be to #ifdef/ifndef that
call without moving it?


Laurent

  reply	other threads:[~2009-11-03 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 19:50 [Qemu-devel] [PATCH] don't call reset functions on cpu initialization Glauber Costa
2009-11-03 20:12 ` Laurent Desnogues
2009-11-03 20:16   ` Glauber Costa
2009-11-03 20:24     ` Laurent Desnogues [this message]
2009-11-04 16:51 ` [Qemu-devel] [PATCH] don't call reset functions on cpu initialization\ Marcelo Tosatti
2009-11-04 21:11   ` Glauber Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=761ea48b0911031224m685786a3v981616eb7cb92eef@mail.gmail.com \
    --to=laurent.desnogues@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=glommer@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).