linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Enhancing semantics with memremap() - aliasing with memremap()
@ 2016-05-24 23:36 Luis R. Rodriguez
  2016-05-31 16:58 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2016-05-24 23:36 UTC (permalink / raw)
  To: Dan Williams, Toshi Kani
  Cc: Paul McKenney, Will Deacon, Christoph Hellwig, X86 ML,
	linux-kernel, linux-arch, Julia Lawall, Benjamin Herrenschmidt,
	Borislav Petkov

Dan, Toshi, Christoph,

I recall a while ago while memremap() was being introduced we
discussed making stronger semantics for memremap() a desirable future
goal [0], along with removal cleanups of ioremap_cache(). This was
when only 2 types were being considered, WB and WT. I see we now have
WC as well for the memremap() family.

Among one of the semantic topics, on the x86 side of things we seem to
have at least concluded we want to at the very least start by
completely discouraging and warning alias uses for different
conflicting types. A recent patch by Toshi helps to find these at run
time, however it may be possible to do this proactively semantically
with Coccinelle as well, but we first need an example test driver with
all known invalid uses cases to write up some grammar rules for the
hunt.

A much much longer term goal would be properly identify only those
valid uses for aliasing, and have a special API for them. This will
take time for the above reaons. During the memremap() review we seemed
to have agreed that making stronger semantics for memremap() was also
desirable, more aimed towards addressing this as a future goal.

Is it a good time for that now? I would hope identifying proper
aliasing uses for memremap() might be a bit easier now than for
ioremap() given its not used as widely. It may be an easier target to
also write some grammar rules for it as well.

[0] http://lkml.kernel.org/r/CAPcyv4g0-CcFRCWPBdKB7h0zZEO5qzT-N9YLYJw9sb=_HYnXiA@mail.gmail.com>

  Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enhancing semantics with memremap() - aliasing with memremap()
  2016-05-24 23:36 Enhancing semantics with memremap() - aliasing with memremap() Luis R. Rodriguez
@ 2016-05-31 16:58 ` Christoph Hellwig
  2016-05-31 17:25   ` Luis R. Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2016-05-31 16:58 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Dan Williams, Toshi Kani, Paul McKenney, Will Deacon,
	Christoph Hellwig, X86 ML, linux-kernel, linux-arch,
	Julia Lawall, Benjamin Herrenschmidt, Borislav Petkov

On Tue, May 24, 2016 at 04:36:42PM -0700, Luis R. Rodriguez wrote:
> Is it a good time for that now? I would hope identifying proper
> aliasing uses for memremap() might be a bit easier now than for
> ioremap() given its not used as widely. It may be an easier target to
> also write some grammar rules for it as well.

So you want an explicit opt-in flag to allow aliasing?  Sounds fine to
me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enhancing semantics with memremap() - aliasing with memremap()
  2016-05-31 16:58 ` Christoph Hellwig
@ 2016-05-31 17:25   ` Luis R. Rodriguez
  2016-05-31 17:27     ` Luis R. Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2016-05-31 17:25 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Luis R. Rodriguez, Dan Williams, Toshi Kani, Paul McKenney,
	Will Deacon, X86 ML, linux-kernel, linux-arch, Julia Lawall,
	Benjamin Herrenschmidt, Borislav Petkov

On Tue, May 31, 2016 at 09:58:28AM -0700, Christoph Hellwig wrote:
> On Tue, May 24, 2016 at 04:36:42PM -0700, Luis R. Rodriguez wrote:
> > Is it a good time for that now? I would hope identifying proper
> > aliasing uses for memremap() might be a bit easier now than for
> > ioremap() given its not used as widely. It may be an easier target to
> > also write some grammar rules for it as well.
> 
> So you want an explicit opt-in flag to allow aliasing?  Sounds fine to
> me.
  
Yup! Can the default then safely already be no-aliasing then?

  Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enhancing semantics with memremap() - aliasing with memremap()
  2016-05-31 17:25   ` Luis R. Rodriguez
@ 2016-05-31 17:27     ` Luis R. Rodriguez
  2016-05-31 23:31       ` Kani, Toshimitsu
  0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2016-05-31 17:27 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Christoph Hellwig, Dan Williams, Toshi Kani, Paul McKenney,
	Will Deacon, X86 ML, linux-kernel, linux-arch, Julia Lawall,
	Benjamin Herrenschmidt, Borislav Petkov

On Tue, May 31, 2016 at 07:25:14PM +0200, Luis R. Rodriguez wrote:
> On Tue, May 31, 2016 at 09:58:28AM -0700, Christoph Hellwig wrote:
> > On Tue, May 24, 2016 at 04:36:42PM -0700, Luis R. Rodriguez wrote:
> > > Is it a good time for that now? I would hope identifying proper
> > > aliasing uses for memremap() might be a bit easier now than for
> > > ioremap() given its not used as widely. It may be an easier target to
> > > also write some grammar rules for it as well.
> > 
> > So you want an explicit opt-in flag to allow aliasing?  Sounds fine to
> > me.
>   
> Yup! Can the default then safely already be no-aliasing then?

Or if aliasing is truly not needed as often a different API, this
maybe useful later if we pick up again module namespace stuff.

  Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enhancing semantics with memremap() - aliasing with memremap()
  2016-05-31 17:27     ` Luis R. Rodriguez
@ 2016-05-31 23:31       ` Kani, Toshimitsu
  0 siblings, 0 replies; 5+ messages in thread
From: Kani, Toshimitsu @ 2016-05-31 23:31 UTC (permalink / raw)
  To: mcgrof
  Cc: toshi.kani, linux-kernel, hch, dan.j.williams, x86, paulmck,
	will.deacon, bp, julia.lawall, linux-arch, benh

On Tue, 2016-05-31 at 19:27 +0200, Luis R. Rodriguez wrote:
> On Tue, May 31, 2016 at 07:25:14PM +0200, Luis R. Rodriguez wrote:
> > 
> > On Tue, May 31, 2016 at 09:58:28AM -0700, Christoph Hellwig wrote:
> > > 
> > > On Tue, May 24, 2016 at 04:36:42PM -0700, Luis R. Rodriguez wrote:
> > > > 
> > > > Is it a good time for that now? I would hope identifying proper
> > > > aliasing uses for memremap() might be a bit easier now than for
> > > > ioremap() given its not used as widely. It may be an easier target
> > > > to also write some grammar rules for it as well.
> > > 
> > > So you want an explicit opt-in flag to allow aliasing?  Sounds fine to
> > > me.
> >   
> > Yup! Can the default then safely already be no-aliasing then?
>
> Or if aliasing is truly not needed as often a different API, this
> maybe useful later if we pick up again module namespace stuff.

I agree that we should be able to change memremap() to fail an aliasing
request since it's a relatively new interface.  ioremap() needs to start
from adding a warning message.

Thanks,
-Toshi 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-01  0:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 23:36 Enhancing semantics with memremap() - aliasing with memremap() Luis R. Rodriguez
2016-05-31 16:58 ` Christoph Hellwig
2016-05-31 17:25   ` Luis R. Rodriguez
2016-05-31 17:27     ` Luis R. Rodriguez
2016-05-31 23:31       ` Kani, Toshimitsu

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).