All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Baumann <Andrew.Baumann@microsoft.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Grégory ESTRADE" <gregory.estrade@gmail.com>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Rob Herring" <robh@kernel.org>
Subject: Re: [Qemu-devel] [PATCH v4 4/8] bcm2835_peripherals: add rollup device for bcm2835 peripherals
Date: Tue, 26 Jan 2016 19:12:06 +0000	[thread overview]
Message-ID: <BLUPR0301MB20347E506B5172A98D5377229ED80@BLUPR0301MB2034.namprd03.prod.outlook.com> (raw)
In-Reply-To: <CAPokK=rXwURCOc=-W1v+2=Br2kZ4fDXdPUR6gc=UdyoVisY_Bw@mail.gmail.com>

> From: Peter Crosthwaite [mailto:crosthwaitepeter@gmail.com]
> Sent: Tuesday, 26 January 2016 00:03
> 
> On Mon, Jan 25, 2016 at 10:23 PM, Andrew Baumann
> <Andrew.Baumann@microsoft.com> wrote:
> >> From: Peter Crosthwaite [mailto:crosthwaitepeter@gmail.com]
> >> Sent: Monday, 25 January 2016 22:14
> >>
> >> On Fri, Jan 15, 2016 at 3:58 PM, Andrew Baumann
> >> <Andrew.Baumann@microsoft.com> wrote:
> > [...]
> >> > +static void bcm2835_peripherals_init(Object *obj)
> >> > +{
> >> > +    BCM2835PeripheralState *s = BCM2835_PERIPHERALS(obj);
> >> > +
> >> > +    /* Memory region for peripheral devices, which we export to our
> >> parent */
> >> > +    memory_region_init_io(&s->peri_mr, obj, NULL, s, "bcm2835-
> >> peripherals",
> >> > +                          0x1000000);
> >>
> >> Should this just be normal memory_region_init?
> >
> > I think so -- it's just a container region, and I probably copy and pasted the
> API here. The two MR init APIs seem almost but not-quite identical when
> NULL callbacks are used. Can you briefly explain the difference?
> >
> 
> hmm I guess the defaulting to &unassigned_mem_ops. memory_region_init
> looks to assume you will populate the usable subregions. Are you
> relying on unassigned ops?

Actually, memory_region_initfn also sets the unassigned_ops, so the only difference appears to be mr->terminates, which is set to true for init_io. This flag affects the behaviour of render_memory_region(), which terminates early if !mr->terminates. So the difference is that the gaps between the subregions (i.e., the actual devices) wouldn't be rendered. But what difference this makes in practice is unclear to me. It can only matter if the CPU accesses an undefined / unimplemented device, but even then it looks to me like it would end up at the same unassigned ops code anyway, so I suspect it's irrelevant.

If memory_region_init works, I'll go with that.

Andrew

  reply	other threads:[~2016-01-26 19:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 23:58 [Qemu-devel] [PATCH v4 0/8] Raspberry Pi 2 support Andrew Baumann
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 1/8] bcm2835_mbox: add BCM2835 mailboxes Andrew Baumann
2016-01-26  5:54   ` Peter Crosthwaite
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 2/8] bcm2835_property: add bcm2835 property channel Andrew Baumann
2016-01-26  6:03   ` Peter Crosthwaite
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 3/8] bcm2835_ic: add bcm2835 interrupt controller Andrew Baumann
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 4/8] bcm2835_peripherals: add rollup device for bcm2835 peripherals Andrew Baumann
2016-01-26  6:14   ` Peter Crosthwaite
2016-01-26  6:23     ` Andrew Baumann
2016-01-26  8:03       ` Peter Crosthwaite
2016-01-26 19:12         ` Andrew Baumann [this message]
2016-01-26 19:40           ` Peter Maydell
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 5/8] bcm2836_control: add bcm2836 ARM control logic Andrew Baumann
2016-01-29  4:37   ` Peter Crosthwaite
2016-01-29  4:42     ` Andrew Baumann
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 6/8] bcm2836: add bcm2836 soc device Andrew Baumann
2016-01-29  4:50   ` Peter Crosthwaite
2016-01-15 23:58 ` [Qemu-devel] [PATCH v4 7/8] arm/boot: move highbank secure board setup code to common routine Andrew Baumann
2016-01-29  7:11   ` Peter Crosthwaite
     [not found] ` <1452902337-13844-9-git-send-email-Andrew.Baumann@microsoft.com>
2016-01-29  7:31   ` [Qemu-devel] [PATCH v4 8/8] raspi: add raspberry pi 2 machine Peter Crosthwaite
2016-01-29 21:50     ` Andrew Baumann
2016-01-29 22:22       ` Peter Crosthwaite
2016-01-29 22:28         ` Andrew Baumann
2016-01-29 22:40           ` Peter Crosthwaite
2016-01-29 22:43             ` Andrew Baumann

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=BLUPR0301MB20347E506B5172A98D5377229ED80@BLUPR0301MB2034.namprd03.prod.outlook.com \
    --to=andrew.baumann@microsoft.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=gregory.estrade@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robh@kernel.org \
    --cc=sw@weilnetz.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.