efi/arm-init: Reserve rather than unmap the memory map for ARM as well
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 25 Apr 2016 20:07:02 +0000 (21:07 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 28 Apr 2016 09:34:05 +0000 (11:34 +0200)
Now that ARM has a fully functional memremap() implementation, there is
no longer a need to remove the UEFI memory map from the linear mapping
in order to be able to create a permanent mapping for it using generic
code.

So remove the 'IS_ENABLED(CONFIG_ARM)' conditional we added in:

7cc8cbcf82d1 ("efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping")

... and revert to using memblock_reserve() for both ARM and arm64.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1461614832-17633-31-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/arm-init.c

index 7a3318d..ef90f0c 100644 (file)
@@ -244,20 +244,9 @@ void __init efi_init(void)
        efi_memattr_init();
        early_memunmap(efi.memmap.map, params.mmap_size);
 
-       if (IS_ENABLED(CONFIG_ARM)) {
-               /*
-                * ARM currently does not allow ioremap_cache() to be called on
-                * memory regions that are covered by struct page. So remove the
-                * UEFI memory map from the linear mapping.
-                */
-               memblock_mark_nomap(params.mmap & PAGE_MASK,
-                                   PAGE_ALIGN(params.mmap_size +
-                                              (params.mmap & ~PAGE_MASK)));
-       } else {
-               memblock_reserve(params.mmap & PAGE_MASK,
-                                PAGE_ALIGN(params.mmap_size +
-                                           (params.mmap & ~PAGE_MASK)));
-       }
+       memblock_reserve(params.mmap & PAGE_MASK,
+                        PAGE_ALIGN(params.mmap_size +
+                                   (params.mmap & ~PAGE_MASK)));
 
        init_screen_info();
 }