qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: 赵小强 <zxq_yx_007@163.com>
Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 0/4] QOM'ify work for ppc
Date: Wed, 4 Jan 2017 14:28:12 +1100	[thread overview]
Message-ID: <20170104032811.GY12761@umbus.fritz.box> (raw)
In-Reply-To: <A1654386-0C53-4C64-BE97-A6804E1AA4F3@163.com>

[-- Attachment #1: Type: text/plain, Size: 1960 bytes --]

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 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.

>     Thanks for your review.
> 
> Best wishes !
> 
> > 在 2017年1月3日,06:28,David Gibson <david@gibson.dropbear.id.au> 写道:
> > 
> >> On Sat, Dec 31, 2016 at 09:18:27AM +0800, xiaoqiang zhao wrote:
> >> This is some QOM'ify work relate with ppc.
> >> See each commit message for details.
> >> 
> >> xiaoqiang zhao (4):
> >>  hw/gpio: QOM'ify mpc8xxx.c
> >>  hw/ppc: QOM'ify e500.c
> >>  hw/ppc: QOM'ify ppce500_spin.c
> >>  hw/ppc: QOM'ify spapr_vio.c
> >> 
> >> hw/gpio/mpc8xxx.c     | 20 +++++++++++---------
> >> hw/ppc/e500.c         | 17 ++++-------------
> >> hw/ppc/ppce500_spin.c | 18 ++++++++----------
> >> hw/ppc/spapr_vio.c    |  2 --
> >> 4 files changed, 23 insertions(+), 34 deletions(-)
> > 
> > Patches 1-3 all have the same problem - they move memory region
> > initialization and similar to an instance_init function.  This is not
> > how things are generally done in the qdev model.  Instead that phase
> > of initialization should be done from a dc->realize() function.
> > 
> 
> 

-- 
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 --]

  reply	other threads:[~2017-01-04  4:11 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 [this message]
2017-01-04 13:59       ` 赵小强
2017-01-04 17:04       ` Peter Maydell
2017-01-05  0:20         ` David Gibson
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=20170104032811.GY12761@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).