From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Benjamin Herrenschmidt
<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Cc: Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Kim Phillips
<kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Kumar Gala
<galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH] libfdt: add address translation support
Date: Wed, 14 May 2014 14:19:53 +1000 [thread overview]
Message-ID: <20140514041953.GD28789@voom> (raw)
In-Reply-To: <1399875252.17624.93.camel@pasglop>
[-- Attachment #1: Type: text/plain, Size: 2229 bytes --]
On Mon, May 12, 2014 at 04:14:12PM +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2014-05-12 at 16:10 +1000, Benjamin Herrenschmidt wrote:
> > On Mon, 2014-05-12 at 16:00 +1000, David Gibson wrote:
> > > I'm not all that impressed by this translation code - in particular
> > > the per-bus-type hooks don't make sense to me. AFAIK the
> > > interpretation of ranges is not bus specific. I think it will also
> > > fail in some cases with #address-cells > 2, which is unfortunate.
> > >
> > > I'm about to post my own implementation of address translation.
> >
> > Well, I came up with the original code which did per-bus type hooks.
> > There are cases where it is needed.
> >
> > Take PCI. The top word can contain completely unrelated stuff such
> > as the "prefetchable" attribute.
> >
> > It's perfectly legal to put a prefetchable BAR under a non-prefetchable
> > bridge window.
> >
> > However a translation scheme that doesn't know to know that bit
> > will fail.
>
> Oh and the other way around with IO vs. memory btw.
>
> > It's not far fetched, it happens on our machines today.
> >
> > And that's just one of the problems I had back then...
>
> Note that I'm just stating the problem :-) There may be a better way to
> address it. For example, for the one above specifically, well, we could
> have a per-bus-type list of masks to apply before translation (bits to
> ignore).
>
> I wish in fact OF had done that to begin with like we have
> interrupt-map-mask, maybe we should introduce that concept to limit the
> damage to existing well known cases like PCI and have anything new just
> tell us what to use for the compare.
>
> In fact, thinking more, the above mask trick might not fully work for
> PCI, we have to check the exact values, because I think the same field
> somewhat use an enumeration for 32-bit MEM, 64-bit MEM and IO ... oh
> well.
Hm, yeah. At this point I'm thinking a per-bus "quirks" mechanism
around the basic universal translation 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
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-05-14 4:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 16:57 [PATCH] libfdt: add address translation support Rob Herring
[not found] ` <1396371463-7516-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-01 18:59 ` Warner Losh
[not found] ` <4073722A-7162-4041-B1A2-8A992871FEC0-uzTCJ5RojNnQT0dZR+AlfA@public.gmane.org>
2014-04-02 5:43 ` David Gibson
[not found] ` <20140402054325.GC3496-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2014-04-02 14:53 ` Warner Losh
[not found] ` <AB306DF0-D50C-476A-8314-CFCE5C57BB2E-uzTCJ5RojNnQT0dZR+AlfA@public.gmane.org>
2014-04-02 23:37 ` David Gibson
2014-04-01 23:02 ` Scott Wood
[not found] ` <1396393358.32034.40.camel-88ow+0ZRuxG2UiBs7uKeOtHuzzzSOjJt@public.gmane.org>
2014-04-02 19:24 ` Kim Phillips
[not found] ` <20140402142403.9d3316f14520252a4a3474e0-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-04-02 21:01 ` Rob Herring
2014-04-15 14:03 ` Rob Herring
[not found] ` <CAL_JsqKMUHiPeU7iQDHZ=E6GzMxvXBB4L8Arg+m0JrfQsRkhtg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-28 18:12 ` Rob Herring
2014-04-15 21:57 ` Grant Likely
[not found] ` <CACxGe6uPerPT_cT+p1zvL20ERwuguDJWDHasxz5gAUe5kPQHNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-15 22:55 ` Rob Herring
2014-05-12 6:00 ` David Gibson
2014-05-12 6:10 ` Benjamin Herrenschmidt
2014-05-12 6:14 ` Benjamin Herrenschmidt
2014-05-14 4:19 ` David Gibson [this message]
2014-05-12 19:27 ` Rob Herring
[not found] ` <CAL_Jsq+zi72PAjQ+RGvUddLtHocgphPQQ9x2X0S0dYGOKz+Hgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-12 22:01 ` Benjamin Herrenschmidt
2014-05-14 4:20 ` David Gibson
2014-05-14 4:18 ` David Gibson
2014-05-14 5:23 ` Benjamin Herrenschmidt
2014-05-14 6:51 ` 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=20140514041953.GD28789@voom \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.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).