All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Ingo Molnar <mingo@kernel.org>, Toshi Kani <toshi.kani@hpe.com>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	Toshi Kani <toshi.kani@hp.com>,
	Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Dave Airlie <airlied@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org, X86 ML <x86@kernel.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Lutomirski <luto@kernel.org>,
	Brian Gerst <brgerst@gmail.com>
Subject: Re: Overlapping ioremap() calls, set_memory_*() semantics
Date: Wed, 13 Apr 2016 23:03:10 +0200	[thread overview]
Message-ID: <20160413210310.GE1990@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.2.20.1603211721070.25290@eddie.linux-mips.org>

On Mon, Mar 21, 2016 at 05:38:40PM +0000, Maciej W. Rozycki wrote:
> On Wed, 9 Mar 2016, Ingo Molnar wrote:
> 
> > > > So to go back to the original suggestion from Luis, I've quoted it, but
> > > > with a s/overlapping/aliased substitution:
> > > > 
> > > > > I had suggested long ago then that one possible resolution was for us
> > > > > to add an API that *enables* aliased ioremap() calls, and only use it
> > > > > on select locations in the kernel. This means we only have to convert a
> > > > > few users to that call to white list such semantics, and by default
> > > > > we'd disable aliased calls. To kick things off -- is this strategy
> > > > > agreeable for all other architectures?
> > > > 
> > > > I'd say that since the overwhelming majority of ioremap() calls are not
> > > > aliased, ever, thus making it 'harder' to accidentally alias is probably
> > > > a good idea.
> > > 
> > > Did you mean 'aliased' or 'aliased with different cache attribute'?  The former 
> > > check might be too strict.
> > 
> > I'd say even 'same attribute' aliasing is probably relatively rare.
> 
>  Please note that aliased cached mappings (any kinds of, not necessarily 
> from `ioremap') cause a lot of headache (read: handling trouble) with 
> architectures such as MIPS which support virtually indexed caches which 
> suffer from cache aliasing.  There is a risk of data corruption if the 
> same physical memory address space location is accessed through different 
> virtual mappings as not all hardware catches duplicate cache entries 
> created in such a case.
> 
>  We handle it in software for user mappings (although I keep having a 
> feeling something always keeps escaping, due to the vast diversity of 
> cache configurations possible), however I don't think we do for `ioremap', 
> so disallowing aliased `ioremap' mappings by default sounds like a good 
> idea to me.

Great, well lets do the work then.

  Luis

  reply	other threads:[~2016-04-13 21:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 21:28 Overlapping ioremap() calls, set_memory_*() semantics Luis R. Rodriguez
2016-03-04  9:44 ` Ingo Molnar
2016-03-04 18:18   ` Toshi Kani
2016-03-04 18:51     ` Luis R. Rodriguez
2016-03-04 21:39       ` Toshi Kani
2016-03-05 11:42       ` Ingo Molnar
2016-03-05 11:40     ` Ingo Molnar
2016-03-07 17:03       ` Toshi Kani
2016-03-08 12:16         ` Ingo Molnar
2016-03-09  0:29           ` Toshi Kani
2016-03-09  9:15             ` Ingo Molnar
2016-03-11 22:13               ` Toshi Kani
2016-03-16  1:45                 ` Luis R. Rodriguez
2016-03-16  1:45                   ` Luis R. Rodriguez
2016-03-16  1:45                   ` Luis R. Rodriguez
2016-03-17 22:44                   ` Toshi Kani
2016-04-13 21:16                     ` Luis R. Rodriguez
2016-04-15 14:47                       ` Toshi Kani
2016-04-16  9:20                         ` Ingo Molnar
2016-03-21 17:38               ` Maciej W. Rozycki
2016-04-13 21:03                 ` Luis R. Rodriguez [this message]
2016-03-11  6:47         ` Andy Lutomirski
2016-03-11 22:36           ` Toshi Kani
2016-03-13  1:02             ` Andy Lutomirski

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=20160413210310.GE1990@wotan.suse.de \
    --to=mcgrof@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=daniel.vetter@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=toshi.kani@hp.com \
    --cc=toshi.kani@hpe.com \
    --cc=x86@kernel.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 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.