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

From: Thomas Gleixner
Date: Thu Jan 31 2008 - 11:29:20 EST


On Thu, 31 Jan 2008, huang ying wrote:

> On Jan 31, 2008 9:00 PM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > On Thu, 31 Jan 2008, Huang, Ying wrote:
> >
> > > This patch makes ioremap() can be used to map pages as executable,
> > > this is needed by EFI support.
> >
> > > +extern void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
> > > + enum ioremap_mode mode,
> > > + enum ioremap_xmode xmode);
> > > +
> >
> > Why do you want to add a new API?
> >
> > addr = ioremap(phys_addr, len);
> > set_memory_x(addr);
> >
> > should do what you want already. I think Arjan was not very clear in
> > his reply yesterday.
>
> In current implementation, change_page_attr() can be used to change
> identity map only. At least I can find __pa() are used in
> change_page_attr_addr() to get physical address. So I think
> change_page_attr() should be fixed firstly.

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.

Thanks,

tglx
--
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/