ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Will Deacon <will.deacon@arm.com>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Semantics of MMIO mapping attributes accross archs
Date: Tue, 07 Jul 2015 08:02:06 +1000	[thread overview]
Message-ID: <1436220126.3948.74.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150706093333.GD30342@arm.com>

On Mon, 2015-07-06 at 10:33 +0100, Will Deacon wrote:
> 
> We've ended up doing whatever drivers start to rely on from running on
> x86, which gives rise to some sort of de-facto semantics, but it's not
> necessarily efficient or portable.

Correct, which is why I would like to start documenting what is
mandated/guaranteed and separately what is the expected behaviour for
non-guaranteed bits on each arch.

> On arm64, ioremap == ioremap_nocache, which gives strong ordering
> guarantees but forbids things like unaligned access.

Ok, same for us. Except ordering guarantees aren't even that strong ...

>  ioremap_wc gives a
> more relaxed mapping, which is non-cached but allows re-ordering and
> unaligned access.

Ok, our other mapping (G=0) weakens ordering even more but won't allow
unaligned either. We don't have a non-cachable mapping that allows
unaligned accesses at all in fact :-( I've been fighting with our HW
guys on that one, but they keep thinking it's not useful.
 
> ioremap_wt is new and strange, but rmk and I were going down the same
> route as ioremap_wc for that, because people expect to be able to do
> blind memcpy with those pointers.

Ok, powerpc architecturally supports WT but no recent implementation
does. I'm not sure what is the practical purpose.

> As for ordering of writeX/readX wrt DMA, our IO accessors are so
> insanely
> heavyweight that I don't think the ioremap flavour matters atm.

This is the same for us, but that also means in our case that writeX
will not combine on ioremap_wc(), only relaxed_writeX() might after we
change it to be something else than writeX(). What is the situation for
you ?

Ben.

  reply	other threads:[~2015-07-06 22:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-04  8:17 Benjamin Herrenschmidt
2015-07-04 14:12 ` Dan Williams
2015-07-05  3:02   ` Benjamin Herrenschmidt
2015-07-05 18:55     ` Andy Lutomirski
2015-07-05 19:56       ` Benjamin Herrenschmidt
2015-07-05 20:09         ` Andy Lutomirski
2015-07-06  9:33         ` Will Deacon
2015-07-06 22:02           ` Benjamin Herrenschmidt [this message]
2015-07-07  9:56             ` Will Deacon
2015-07-07 10:29               ` Will Deacon
2015-07-06  9:52       ` Catalin Marinas
2015-07-06 17:14         ` Andy Lutomirski
2015-07-06 22:04           ` Benjamin Herrenschmidt
2015-07-06 19:11       ` Luck, Tony
2015-07-07  0:01 ` Luis R. Rodriguez

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=1436220126.3948.74.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=will.deacon@arm.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