From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: 赵小强 <zxq_yx_007@163.com>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Alexander Graf" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 0/4] QOM'ify work for ppc
Date: Thu, 5 Jan 2017 11:20:07 +1100 [thread overview]
Message-ID: <20170105002007.GA13763@umbus.fritz.box> (raw)
In-Reply-To: <CAFEAcA91zZTPzXGfRSGSQM9kK5cG4Ci-hm7Q4Jd5odfxT+OHHw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]
On Wed, Jan 04, 2017 at 05:04:02PM +0000, Peter Maydell wrote:
> On 4 January 2017 at 03:28, David Gibson <david@gibson.dropbear.id.au> wrote:
> > On Tue, Jan 03, 2017 at 10:02:21PM +0800, 赵小强 wrote:
> >> Hi,david:
> >>
> >> To my understanding,what must be put in the realize function is
> >> code which depends on property values. What's the benefit of
> >> moving memory region initialization into realize function? I can
> >> not figure out, can you make some explanations?
> >
> > If nothing else it's better in realize() for consistency with other
> > devices.
>
> I'm not sure we're terribly consistent at all, really. My understanding
> was about the same as 赵小强 -- put stuff in init unless it has to
> go in realize because it depends on properties or might fail or
> has permanent effects on the simulation.
> Lots of existing devices do memory_region_init* calls in
> their init functions.
> We should probably write down our preferences somewhere, perhaps
> http://wiki.qemu.org/Documentation/QOMConventions
>
> > I'm not familiar enough with the details to be sure, but I also think
> > it's not safe in instance_init. Once memory regions are registered,
> > the device can potentially interact with other devices in the virtual
> > machine. realize() is sequenced to expect that, instance_init is not.
>
> Hmm, that doesn't sound right to me. The other devices will only
> interact with the memory regions when the calling code has
> finished doing the create/realize/map memory regions sequence --
> an MR on its own doesn't do anything unless somebody maps it into
> an address space.
Huh. Ok, I guess I was wrong.
Alright, 赵小强, feel free to repost addressing just the other
comments and I'll merge.
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-01-05 0:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-31 1:18 [Qemu-devel] [PATCH 0/4] QOM'ify work for ppc xiaoqiang zhao
2016-12-31 1:18 ` [Qemu-devel] [PATCH 1/4] hw/gpio: QOM'ify mpc8xxx.c xiaoqiang zhao
2016-12-31 1:18 ` [Qemu-devel] [PATCH 2/4] hw/ppc: QOM'ify e500.c xiaoqiang zhao
2016-12-31 1:18 ` [Qemu-devel] [PATCH 3/4] hw/ppc: QOM'ify ppce500_spin.c xiaoqiang zhao
2016-12-31 1:18 ` [Qemu-devel] [PATCH 4/4] hw/ppc: QOM'ify spapr_vio.c xiaoqiang zhao
2017-01-02 22:28 ` David Gibson
2017-01-02 22:28 ` [Qemu-devel] [PATCH 0/4] QOM'ify work for ppc David Gibson
2017-01-03 14:02 ` 赵小强
2017-01-04 3:28 ` David Gibson
2017-01-04 13:59 ` 赵小强
2017-01-04 17:04 ` Peter Maydell
2017-01-05 0:20 ` David Gibson [this message]
2017-01-05 0:53 ` 赵小强
2017-01-05 1:28 ` 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=20170105002007.GA13763@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=zxq_yx_007@163.com \
/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).