From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure
Date: Wed, 7 Sep 2016 12:01:19 +1000 [thread overview]
Message-ID: <20160907020119.GF2780@voom.fritz.box> (raw)
In-Reply-To: <3af4c2d9-7263-7c54-0a12-c0b4108c65bd@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]
On Tue, Sep 06, 2016 at 04:42:58PM +0200, Cédric Le Goater wrote:
> On 09/06/2016 02:48 AM, David Gibson wrote:
> > On Mon, Sep 05, 2016 at 05:11:53PM +1000, Benjamin Herrenschmidt wrote:
> >> On Mon, 2016-09-05 at 13:39 +1000, David Gibson wrote:
> >>>> +static XScomDevice *xscom_find_target(XScomState *s, uint32_t
> >>> pcb_addr,
> >>>> + uint32_t *range)
> >>>> +{
> >>>> + BusChild *bc;
> >>>> +
> >>>> + QTAILQ_FOREACH(bc, &s->bus->bus.children, sibling) {
> >>>> + DeviceState *qd = bc->child;
> >>>> + XScomDevice *xd = XSCOM_DEVICE(qd);
> >>>> + unsigned int i;
> >>>> +
> >>>> + for (i = 0; i < MAX_XSCOM_RANGES; i++) {
> >>>> + if (xd->ranges[i].addr <= pcb_addr &&
> >>>> + (xd->ranges[i].addr + xd->ranges[i].size) >
> >>> pcb_addr) {
> >>>> + *range = i;
> >>>> + return xd;
> >>>> + }
> >>>> + }
> >>>> + }
> >>>
> >>> Hmm.. you could set up a SCOM local address space using the
> >>> infrastructure in memory.c, rather than doing your own dispatch.
> >>
> >> There are pros and cons to this approach. The memory.c stuff comes with
> >> quite a lot of baggage, not all of it very shinny to be honest ;-) I
> >> still *hate* how it forces upon us a whole 128-bit integer arithmetic
> >> library just so that it can represent 1_0000_0000_0000_0000 ...
> >
> > Ugh, yeah. I tried to argue against this when it first came in, but
> > was overruled.
> >
> >> It would be make more sense to use inclusive start/end instead and
> >> stick to 64-bits.
> >>
> >> That being said, we could do that. We'd have to shift the XSCOM
> >> addresses left by 3 since each address is an 8 bytes reigster and
> >> forbid non-8-bytes accesses.
> >
> > Ok. I'm not particularly fussed either way.
>
>
> The change does seem too invasive. I can give it a try in next
> version.
>
> When a memory region is triggered, the impacted device will have
> to convert the address with xscom_to_pcb_addr(). There is some
> dependency on the chip model because the translation is different.
> That would be an extra op in the xscom device model I guess.
Actually, I was still thinking of having an MR for the scom interface
unit, which does the xscom_to_pcb_addr() then re-issues the access in
the PCB address space.
But your suggestion might work too.
> Also, the main purpose of the XscomBus is to loop on the devices
> to populate the device tree. I am wondering if we could just use
> a simple list under the chip for that purpose.
>
> Thanks,
>
> C.
>
--
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: 801 bytes --]
next prev parent reply other threads:[~2016-09-07 2:04 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 16:34 [Qemu-devel] [PATCH v2 0/7] ppc/pnv: add a minimal platform Cédric Le Goater
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 1/7] ppc/pnv: add skeleton PowerNV platform Cédric Le Goater
2016-09-01 16:31 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-09-02 6:32 ` Cédric Le Goater
2016-09-02 6:39 ` Benjamin Herrenschmidt
2016-09-05 2:48 ` [Qemu-devel] " David Gibson
2016-09-05 6:06 ` Cédric Le Goater
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 2/7] ppc/pnv: add a PnvChip object Cédric Le Goater
2016-09-01 17:21 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-09-02 6:34 ` Cédric Le Goater
2016-09-05 2:58 ` [Qemu-devel] " David Gibson
2016-09-05 6:59 ` Benjamin Herrenschmidt
2016-09-05 7:41 ` Cédric Le Goater
2016-09-05 8:28 ` Benjamin Herrenschmidt
2016-09-06 0:49 ` David Gibson
2016-09-06 6:21 ` Cédric Le Goater
2016-09-05 7:41 ` David Gibson
2016-09-05 9:10 ` Cédric Le Goater
2016-09-06 0:50 ` David Gibson
2016-09-05 7:56 ` Cédric Le Goater
2016-09-06 0:52 ` David Gibson
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure Cédric Le Goater
2016-09-05 3:39 ` David Gibson
2016-09-05 7:11 ` Benjamin Herrenschmidt
2016-09-06 0:48 ` David Gibson
2016-09-06 14:42 ` Cédric Le Goater
2016-09-06 21:47 ` Benjamin Herrenschmidt
2016-09-06 21:49 ` Benjamin Herrenschmidt
2016-09-07 15:55 ` Cédric Le Goater
2016-09-07 19:48 ` Benjamin Herrenschmidt
2016-09-07 2:03 ` David Gibson
2016-09-07 15:47 ` Cédric Le Goater
2016-09-07 21:53 ` Benjamin Herrenschmidt
2016-09-08 8:52 ` Cédric Le Goater
2016-09-07 2:01 ` David Gibson [this message]
2016-09-06 14:42 ` Cédric Le Goater
2016-09-06 21:45 ` Benjamin Herrenschmidt
2016-09-07 2:02 ` David Gibson
2016-09-07 16:40 ` Cédric Le Goater
2016-09-07 1:59 ` David Gibson
2016-09-07 5:27 ` Benjamin Herrenschmidt
2016-09-07 5:46 ` David Gibson
2016-09-07 8:29 ` Benjamin Herrenschmidt
2016-09-05 4:16 ` [Qemu-devel] [Qemu-ppc] " Sam Bobroff
2016-09-06 14:51 ` Cédric Le Goater
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 4/7] ppc/pnv: add a core mask to PnvChip Cédric Le Goater
2016-09-02 8:03 ` Cédric Le Goater
2016-09-05 3:42 ` David Gibson
2016-09-05 11:13 ` Cédric Le Goater
2016-09-05 11:30 ` Benjamin Herrenschmidt
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 5/7] ppc/pnv: add a PnvCore object Cédric Le Goater
2016-09-05 4:02 ` David Gibson
2016-09-06 6:14 ` Cédric Le Goater
2016-09-07 1:48 ` David Gibson
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 6/7] ppc/pnv: add a XScomDevice to PnvCore Cédric Le Goater
2016-09-05 4:19 ` David Gibson
2016-09-06 13:54 ` Cédric Le Goater
2016-09-07 1:51 ` David Gibson
2016-08-31 16:34 ` [Qemu-devel] [PATCH v2 7/7] monitor: fix crash for platforms without a CPU 0 Cédric Le Goater
2016-09-05 4:27 ` David Gibson
2016-09-06 6:28 ` Cédric Le Goater
2016-09-07 1:49 ` 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=20160907020119.GF2780@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=clg@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).