Re: [PATCH] x86: EFI runtime code mapping enhancement

From: Andi Kleen
Date: Wed Feb 13 2008 - 06:31:42 EST


Huang, Ying wrote:
> This patch enhances EFI runtime code memory mapping as following:
>
> - Move __supported_pte_mask & _PAGE_NX checking before invoking
> runtime_code_page_mkexec(). This makes it possible for compiler to
> eliminate runtime_code_page_mkexec() on machine without NX support.
>
> - Use set_memory_x/nx in early_mapping_set_exec(). This eliminates the
> duplicated implementation.

It's a inefficiency because you split up the 2MB (or 1GB) pages
in the direct mapping, although that is not strictly needed. This
means everybody who happens to use memory in same 2M/1G region
will eat unnecessary TLB misses.

It would be generally better to only execute your code in
ioremap_cache() because that won't affect anybody else.

Eventually set_memory_x() will work correctly for ioremap() too
so that should work then.

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