From: David Gibson <david@gibson.dropbear.id.au>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: agraf@suse.de, "Igor Mammedov" <imammedo@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] pseries: Use new hook to correct reset sequence
Date: Fri, 3 Aug 2012 12:37:26 +1000 [thread overview]
Message-ID: <20120803023726.GH12733@truffala.fritz.box> (raw)
In-Reply-To: <87lihx84m4.fsf@codemonkey.ws>
On Thu, Aug 02, 2012 at 02:40:19PM -0500, Anthony Liguori wrote:
> Andreas Färber <afaerber@suse.de> writes:
>
> > Am 02.08.2012 20:29, schrieb Anthony Liguori:
> >> Andreas Färber <afaerber@suse.de> writes:
> >>
> >>> Anthony was favoring moving reset code out of machines and expressed
> >>> dislike for looping through CPUs, which my above patch took into
> >>> account. The ordering issue between CPU and devices is still unsolved there.
> >>>
> >>> Some on-list comments from Anthony would be nice, since we are moving
> >>> into opposing directions here - having the sPAPR machine be more in
> >>> control vs. moving code away from the PC machine into target-i386 CPU
> >>> and/or common CPU code.
> >>
> >> I already commented on the first patch because I had a feeling you'd
> >> post something like this ;-)
> >
> > I was not cc'ed. :(
> >
> >> Regarding reset:
> >>
> >> 1) Devices should implement DeviceState::reset()
> >>
> >> 2) If a device doesn't implement ::reset(), it should call
> >> qemu_register_reset()
> >>
> >> 3) Reset should propagate through the device model, starting with the
> >> top-level machine which is logically what's plugged into the wall and
> >> is the source of power in the first place.
> >
> > So you changed your opinion over night?
>
> No.
>
> > I wanted to keep the reset callbacks in the machine. You applied a patch
> > breaking that pattern and argued you wanted to move reset code *out* of
> > the machine. Now you say the machine should *propagate* reset. Sorry,
> > that's unlogical to me...
>
> You're not listening carefully. Just a friendly piece of advise--
> instead of sending knee-jerk emails, spend some time going back and
> re-reading these discussions.
>
> This has been discussed literally to death now for years.
>
> Reset propagates. There is unanimous consensus that this is the Right
> Way to model reset. There is also wide consensus that reset typically
> will propagate through the composition tree although in some cases,
> reset actually propagates through the bus (this mostly affects devices
> that are children of /peripheral paths though).
>
> The "root" of the composition tree is the machine. The machine in the
> abstract sense, not the QEMUMachine sense. QEMUMachine::init() should
> eventually become trivial--just create a handful of devices that
> represent the core components of the machine with everything else being
> created through composition.
So what code controls the order in which "the machine in the abstract
sense" initiates the reset at the top-leve?
> Open coded logic in QEMUMachine::init is always bad. Handling reset for
> a specific device in QEMUMachine::init is bad. That goes against the
> idea of making QEMUMachine::init trivial.
>
> However, reset does logically start at QEMUMachine. That doesn't mean
> that QEMUMachine should be explicitly resetting devices in a specific
> order. This is why I was quick to comment on David's patch because the
> argument about having a controller that determines reset ordering was
> silly. While this does exist on some architectures,
Some platforms; architecture does not imply a particular platform -
this is one of the more subtle and pervasive x86-isms around.
> it's not at all
> typical.
So? If it sometimes exists, we need to support that model. The
argument that "real" hardware never has reset order dependencies is
simply incorrect.
> Reset should flow with QEMUMachine::reset just playing the
> role of deciding whether it starts propagating from.
>
> The only machines that can have complex reset logic are ones that can
> afford to take an extremely long time to startup--typically doing a
> tremendous amount of self-checks in the process. These are not common
> among the types of machines QEMU simulates.
"having at least one order dependency in reset" != "complex and slow
reset logic".
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2012-08-03 2:37 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 2:10 [Qemu-devel] [0/2] Allow machine to control ordering of reset David Gibson
2012-08-02 2:10 ` [Qemu-devel] [PATCH 1/2] Allow QEMUMachine to override reset sequencing David Gibson
2012-08-02 2:37 ` Anthony Liguori
2012-08-02 3:50 ` Benjamin Herrenschmidt
2012-08-02 15:17 ` Paolo Bonzini
2012-08-02 20:46 ` Benjamin Herrenschmidt
2012-08-02 20:58 ` Anthony Liguori
2012-08-03 2:54 ` David Gibson
2012-08-03 3:08 ` David Gibson
2012-08-02 15:00 ` Lluís Vilanova
2012-08-03 2:25 ` David Gibson
2012-08-02 2:10 ` [Qemu-devel] [PATCH 2/2] pseries: Use new hook to correct reset sequence David Gibson
2012-08-02 15:44 ` Andreas Färber
2012-08-02 18:29 ` Anthony Liguori
2012-08-02 18:38 ` Andreas Färber
2012-08-02 19:40 ` Anthony Liguori
2012-08-03 2:37 ` David Gibson [this message]
2012-08-03 13:50 ` Anthony Liguori
2012-08-03 13:57 ` Peter Maydell
2012-08-03 14:22 ` Anthony Liguori
2012-08-03 14:35 ` Peter Maydell
2012-08-03 14:51 ` Andreas Färber
2012-08-03 15:01 ` Andreas Färber
2012-08-03 16:21 ` Anthony Liguori
2012-08-07 22:02 ` Benjamin Herrenschmidt
2012-08-07 22:32 ` Andreas Färber
2012-08-08 0:00 ` Anthony Liguori
2012-08-08 7:58 ` Peter Maydell
2012-08-08 8:44 ` David Gibson
2012-08-08 1:45 ` David Gibson
2012-08-08 15:22 ` Andreas Färber
2012-08-09 0:12 ` David Gibson
2012-08-03 2:31 ` David Gibson
2012-08-03 15:13 ` Andreas Färber
2012-08-06 0:31 ` David Gibson
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=20120803023726.GH12733@truffala.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=imammedo@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).