Re: [PATCH 2/4] x86: set_memory_xx enhancement

Andi Kleen
2008-02-01T11:07:45Z

On Friday 01 February 2008 10:34:52 Huang, Ying wrote:
> This patch makes set_memory_xx can be used on arbitrary memory mapping
> (besides identity mapping), such as memory mapped with ioremap. The
> physical address is added to the set_memory_xx functions as another
> parameter.

Well as you can see it's incredible complicated. And it's not even
needed because there is no need to change the direct mapping and
add more TLB misses for all users who happen to share the same 2MB area
just to get an executable mapping somewhere. All this effort is only
really needed for uncacheable mappings where the architecture requires
coherency. Or for mappings where cache coherency is not ensured.

It would be much simpler to just fix ioremap to allow executable
mappings again. And remove set_memory_x() again because it is much
less efficient than ioremap for this.

-Andi