]> git.openpandora.org Git - pandora-kernel.git/commitdiff
x86: EFI runtime code mapping enhancement
authorHuang, Ying <ying.huang@intel.com>
Wed, 13 Feb 2008 09:22:41 +0000 (17:22 +0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 13 Feb 2008 15:20:35 +0000 (16:20 +0100)
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.

This patch has been tested on Intel x86_64 platform with EFI64/32
firmware.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/efi.c
arch/x86/kernel/efi_64.c

index b4d523276f404069eeb49815c86ed68f3b6d10ee..cbdf9bacc5758e76132ca77dcc5a36d27ccf01fb 100644 (file)
@@ -384,9 +384,6 @@ static void __init runtime_code_page_mkexec(void)
        efi_memory_desc_t *md;
        void *p;
 
-       if (!(__supported_pte_mask & _PAGE_NX))
-               return;
-
        /* Make EFI runtime service code area executable */
        for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
                md = p;
@@ -476,7 +473,8 @@ void __init efi_enter_virtual_mode(void)
        efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
        efi.reset_system = virt_efi_reset_system;
        efi.set_virtual_address_map = virt_efi_set_virtual_address_map;
-       runtime_code_page_mkexec();
+       if (__supported_pte_mask & _PAGE_NX)
+               runtime_code_page_mkexec();
        early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
        memmap.map = NULL;
 }
Simple merge