Re: [PATCH 4/5] x86: add executable mapping support to ioremap

From: Andi Kleen
Date: Thu Jan 31 2008 - 11:44:38 EST


On Thu, Jan 31, 2008 at 05:37:05PM +0100, Thomas Gleixner wrote:
> On Thu, 31 Jan 2008, Andi Kleen wrote:
>
> > > There is nothing to fix. It works on virtual addresses.
> > >
> > > The __pa() in change_page_attr_addr() is only used to check for the
> > > high alias mapping of the kernel, but the call to change_page_attr
> > > uses the virtual address.
> >
> > But __pa() doesn't work for ioremap ...
>
> If it does not, then __pa() needs to be fixed, nothing else.

No if, it doesn't.

Changing that seems like a slippery rope. Would you want to make it work for
user space addresses then too? It would certainly become
much more heavyweight because it requires much more checks
and then a page table lookup.

For a fairly uncommon case.

I always thought the cheap direct va<->pa conversions to be one of the basic
design principles of the Linux VM. It's surprising you want to throw
that overboard that quickly.

Better check at least with Linus first, it's a fairly fundamental change.

To be honest IMHO the simplest way to fix this problem would be to just put the
pgprot_t argument back into __ioremap(). Then you wouldn't have all
these problems.

-Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/