Skip to content

Commit 33412b8

Browse files
Ard BiesheuvelIngo Molnar
authored andcommitted
efi/arm: Revert deferred unmap of early memmap mapping
Commit: 3ea8649 ("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: 3ea8649 ("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>
1 parent ef1491e commit 33412b8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/firmware/efi/arm-init.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ void __init efi_init(void)
265265
(params.mmap & ~PAGE_MASK)));
266266

267267
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();
268272
}
269273

270274
static int __init register_gop_device(void)

drivers/firmware/efi/arm-runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int __init arm_enable_runtime_services(void)
110110
{
111111
u64 mapsize;
112112

113-
if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) {
113+
if (!efi_enabled(EFI_BOOT)) {
114114
pr_info("EFI services will not be available.\n");
115115
return 0;
116116
}

drivers/firmware/efi/memmap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
118118

119119
void __init efi_memmap_unmap(void)
120120
{
121+
if (!efi_enabled(EFI_MEMMAP))
122+
return;
123+
121124
if (!efi.memmap.late) {
122125
unsigned long size;
123126

0 commit comments

Comments
 (0)