diff options
| -rw-r--r-- | arch/x86/include/asm/efi.h | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 10 | ||||
| -rw-r--r-- | arch/x86/platform/efi/efi.c | 20 |
3 files changed, 23 insertions, 8 deletions
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 3d6b9f81cc68..acd86c850414 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
| @@ -134,6 +134,7 @@ extern void efi_setup_page_tables(void); | |||
| 134 | extern void __init old_map_region(efi_memory_desc_t *md); | 134 | extern void __init old_map_region(efi_memory_desc_t *md); |
| 135 | extern void __init runtime_code_page_mkexec(void); | 135 | extern void __init runtime_code_page_mkexec(void); |
| 136 | extern void __init efi_runtime_mkexec(void); | 136 | extern void __init efi_runtime_mkexec(void); |
| 137 | extern void __init efi_apply_memmap_quirks(void); | ||
| 137 | 138 | ||
| 138 | struct efi_setup_data { | 139 | struct efi_setup_data { |
| 139 | u64 fw_vendor; | 140 | u64 fw_vendor; |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 06853e670354..ce72964b2f46 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -1239,14 +1239,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 1239 | register_refined_jiffies(CLOCK_TICK_RATE); | 1239 | register_refined_jiffies(CLOCK_TICK_RATE); |
| 1240 | 1240 | ||
| 1241 | #ifdef CONFIG_EFI | 1241 | #ifdef CONFIG_EFI |
| 1242 | /* Once setup is done above, unmap the EFI memory map on | 1242 | if (efi_enabled(EFI_BOOT)) |
| 1243 | * mismatched firmware/kernel archtectures since there is no | 1243 | efi_apply_memmap_quirks(); |
| 1244 | * support for runtime services. | ||
| 1245 | */ | ||
| 1246 | if (efi_enabled(EFI_BOOT) && !efi_is_native()) { | ||
| 1247 | pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); | ||
| 1248 | efi_unmap_memmap(); | ||
| 1249 | } | ||
| 1250 | #endif | 1244 | #endif |
| 1251 | } | 1245 | } |
| 1252 | 1246 | ||
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 1a201ac7cef8..b97acecf3fd9 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #include <asm/tlbflush.h> | 52 | #include <asm/tlbflush.h> |
| 53 | #include <asm/x86_init.h> | 53 | #include <asm/x86_init.h> |
| 54 | #include <asm/rtc.h> | 54 | #include <asm/rtc.h> |
| 55 | #include <asm/uv/uv.h> | ||
| 55 | 56 | ||
| 56 | #define EFI_DEBUG | 57 | #define EFI_DEBUG |
| 57 | 58 | ||
| @@ -1210,3 +1211,22 @@ static int __init parse_efi_cmdline(char *str) | |||
| 1210 | return 0; | 1211 | return 0; |
| 1211 | } | 1212 | } |
| 1212 | early_param("efi", parse_efi_cmdline); | 1213 | early_param("efi", parse_efi_cmdline); |
| 1214 | |||
| 1215 | void __init efi_apply_memmap_quirks(void) | ||
| 1216 | { | ||
| 1217 | /* | ||
| 1218 | * Once setup is done earlier, unmap the EFI memory map on mismatched | ||
| 1219 | * firmware/kernel architectures since there is no support for runtime | ||
| 1220 | * services. | ||
| 1221 | */ | ||
| 1222 | if (!efi_is_native()) { | ||
| 1223 | pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); | ||
| 1224 | efi_unmap_memmap(); | ||
| 1225 | } | ||
| 1226 | |||
| 1227 | /* | ||
| 1228 | * UV doesn't support the new EFI pagetable mapping yet. | ||
| 1229 | */ | ||
| 1230 | if (is_uv_system()) | ||
| 1231 | set_bit(EFI_OLD_MEMMAP, &x86_efi_facility); | ||
| 1232 | } | ||
