aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-11-14 12:55:41 -0500
committerIngo Molnar <mingo@kernel.org>2018-11-15 04:04:46 -0500
commit33412b8673135b18ea42beb7f5117ed0091798b6 (patch)
tree295397f138be8c59b37fb654675b46c25e27a5bd /drivers/firmware
parentef1491e791308317bb9851a0ad380c4a68b58d54 (diff)
efi/arm: Revert deferred unmap of early memmap mapping
Commit: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT") deferred the unmap of the early mapping of the UEFI memory map to accommodate the ACPI BGRT code, which looks up the memory type that backs the BGRT table to validate it against the requirements of the UEFI spec. Unfortunately, this causes problems on ARM, which does not permit early mappings to persist after paging_init() is called, resulting in a WARN() splat. Since we don't support the BGRT table on ARM anway, let's revert ARM to the old behaviour, which is to take down the early mapping at the end of efi_init(). Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/arm-init.c4
-rw-r--r--drivers/firmware/efi/arm-runtime.c2
-rw-r--r--drivers/firmware/efi/memmap.c3
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index 388a929baf95..1a6a77df8a5e 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -265,6 +265,10 @@ void __init efi_init(void)
265 (params.mmap & ~PAGE_MASK))); 265 (params.mmap & ~PAGE_MASK)));
266 266
267 init_screen_info(); 267 init_screen_info();
268
269 /* ARM does not permit early mappings to persist across paging_init() */
270 if (IS_ENABLED(CONFIG_ARM))
271 efi_memmap_unmap();
268} 272}
269 273
270static int __init register_gop_device(void) 274static int __init register_gop_device(void)
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 922cfb813109..a00934d263c5 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -110,7 +110,7 @@ static int __init arm_enable_runtime_services(void)
110{ 110{
111 u64 mapsize; 111 u64 mapsize;
112 112
113 if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) { 113 if (!efi_enabled(EFI_BOOT)) {
114 pr_info("EFI services will not be available.\n"); 114 pr_info("EFI services will not be available.\n");
115 return 0; 115 return 0;
116 } 116 }
diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
index fa2904fb841f..38b686c67b17 100644
--- a/drivers/firmware/efi/memmap.c
+++ b/drivers/firmware/efi/memmap.c
@@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
118 118
119void __init efi_memmap_unmap(void) 119void __init efi_memmap_unmap(void)
120{ 120{
121 if (!efi_enabled(EFI_MEMMAP))
122 return;
123
121 if (!efi.memmap.late) { 124 if (!efi.memmap.late) {
122 unsigned long size; 125 unsigned long size;
123 126