Skip to content

Commit

Permalink
arm64: ignore DT memreserve entries when booting in UEFI mode
Browse files Browse the repository at this point in the history
UEFI provides its own method for marking regions to reserve, via the
memory map which is also used to initialise memblock. So when using the
UEFI memory map, ignore any memreserve entries present in the DT.

Reported-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Leif Lindholm authored and Will Deacon committed Aug 19, 2014
1 parent 49d947f commit 86c8b27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/arm64/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ static __init void reserve_regions(void)
if (uefi_debug)
pr_cont("\n");
}

set_bit(EFI_MEMMAP, &efi.flags);
}


Expand Down
4 changes: 3 additions & 1 deletion arch/arm64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/of_fdt.h>
#include <linux/dma-mapping.h>
#include <linux/dma-contiguous.h>
#include <linux/efi.h>

#include <asm/fixmap.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -148,7 +149,8 @@ void __init arm64_memblock_init(void)
memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
#endif

early_init_fdt_scan_reserved_mem();
if (!efi_enabled(EFI_MEMMAP))
early_init_fdt_scan_reserved_mem();

/* 4GB maximum for 32-bit only capable devices */
if (IS_ENABLED(CONFIG_ZONE_DMA))
Expand Down

0 comments on commit 86c8b27

Please sign in to comment.