aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-01-08 04:54:58 -0500
committerWill Deacon <will.deacon@arm.com>2015-01-08 06:57:04 -0500
commit0e63ea48b4d8035dd0e91a3fa6fb79458b47adfb (patch)
treef41c85cb2c67e218c879d13661b9fdc89f316047 /arch
parent59c68329a00eee7759568bc7a5383407d0d40be1 (diff)
arm64/efi: add missing call to early_ioremap_reset()
The early ioremap support introduced by patch bf4b558eba92 ("arm64: add early_ioremap support") failed to add a call to early_ioremap_reset() at an appropriate time. Without this call, invocations of early_ioremap etc. that are done too late will go unnoticed and may cause corruption. This is exactly what happened when the first user of this feature was added in patch f84d02755f5a ("arm64: add EFI runtime services"). The early mapping of the EFI memory map is unmapped during an early initcall, at which time the early ioremap support is long gone. Fix by adding the missing call to early_ioremap_reset() to setup_arch(), and move the offending early_memunmap() to right after the point where the early mapping of the EFI memory map is last used. Fixes: f84d02755f5a ("arm64: add EFI runtime services") Cc: <stable@vger.kernel.org> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/efi.c2
-rw-r--r--arch/arm64/kernel/setup.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index 6fac253bc783..2bb4347d0edf 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -326,6 +326,7 @@ void __init efi_idmap_init(void)
326 326
327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */ 327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
328 efi_setup_idmap(); 328 efi_setup_idmap();
329 early_memunmap(memmap.map, memmap.map_end - memmap.map);
329} 330}
330 331
331static int __init remap_region(efi_memory_desc_t *md, void **new) 332static int __init remap_region(efi_memory_desc_t *md, void **new)
@@ -380,7 +381,6 @@ static int __init arm64_enter_virtual_mode(void)
380 } 381 }
381 382
382 mapsize = memmap.map_end - memmap.map; 383 mapsize = memmap.map_end - memmap.map;
383 early_memunmap(memmap.map, mapsize);
384 384
385 if (efi_runtime_disabled()) { 385 if (efi_runtime_disabled()) {
386 pr_info("EFI runtime services will be disabled.\n"); 386 pr_info("EFI runtime services will be disabled.\n");
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index b80991166754..20fe2932ad0c 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -402,6 +402,7 @@ void __init setup_arch(char **cmdline_p)
402 request_standard_resources(); 402 request_standard_resources();
403 403
404 efi_idmap_init(); 404 efi_idmap_init();
405 early_ioremap_reset();
405 406
406 unflatten_device_tree(); 407 unflatten_device_tree();
407 408