From: Andy Lutomirski <luto@amacapital.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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: Sun, 5 Jul 2015 13:09:54 -0700 [thread overview]
Message-ID: <CALCETrXi6cpV89fBkkj34Vbnt2qZfsyag+6Hz63_u5kSLtz6kQ@mail.gmail.com> (raw)
In-Reply-To: <1436126184.3948.55.camel@kernel.crashing.org>
On Sun, Jul 5, 2015 at 12:56 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Sun, 2015-07-05 at 11:55 -0700, Andy Lutomirski wrote:
>>
>> At some point, it would also be nice if the various macros has
>> well-defined semantics. For example, x86 has:
>>
>> #define pgprot_noncached(prot) \
>> ((boot_cpu_data.x86 > 3) \
>> ? (__pgprot(pgprot_val(prot) | \
>> cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS))) \
>> : (prot))
>>
>> Putting aside the pointless boot_cpu_data check (surely the recent PAT
>> rework completely obsoletes it), what is
>> pgprot_noncached(pgprot_writecombine(x)) supposed to do? Currently it
>> results in garbage. Should it have well-defined behavior instead?
>
> Can it ? On powerpc it will just mean pgprot_noncached for example,
> those macros manipulate the same bits and it's not a bitmask, it's
> either unached or uncached with write combining.
I think it should mean pgprot_noncached on all arches. On x86, if it
does, it's purely by luck, since it only sets bits and doesn't clear
them.
>
>> I suspect the other arches all have their own unique glitches here.
>
> Correct. I'm still trying to get feedback on ARM for example.
>
> I don't think we can (or should try) to have completely identical semantics
> for everything, but we should try to find the common set that are guaranteed
> and, possibly, do a best effort for archs to individually document the
> remaining.
Agreed.
--Andy
next prev parent reply other threads:[~2015-07-05 20:10 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 [this message]
2015-07-06 9:33 ` Will Deacon
2015-07-06 22:02 ` Benjamin Herrenschmidt
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=CALCETrXi6cpV89fBkkj34Vbnt2qZfsyag+6Hz63_u5kSLtz6kQ@mail.gmail.com \
--to=luto@amacapital.net \
--cc=benh@kernel.crashing.org \
--cc=ksummit-discuss@lists.linuxfoundation.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