Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: ignore DT memreserve entries when booting in UEFI mode

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>

authored by

Leif Lindholm and committed by
Will Deacon
86c8b27a 49d947fa

+5 -1
+2
arch/arm64/kernel/efi.c
··· 188 188 if (uefi_debug) 189 189 pr_cont("\n"); 190 190 } 191 + 192 + set_bit(EFI_MEMMAP, &efi.flags); 191 193 } 192 194 193 195
+3 -1
arch/arm64/mm/init.c
··· 32 32 #include <linux/of_fdt.h> 33 33 #include <linux/dma-mapping.h> 34 34 #include <linux/dma-contiguous.h> 35 + #include <linux/efi.h> 35 36 36 37 #include <asm/fixmap.h> 37 38 #include <asm/sections.h> ··· 149 148 memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); 150 149 #endif 151 150 152 - early_init_fdt_scan_reserved_mem(); 151 + if (!efi_enabled(EFI_MEMMAP)) 152 + early_init_fdt_scan_reserved_mem(); 153 153 154 154 /* 4GB maximum for 32-bit only capable devices */ 155 155 if (IS_ENABLED(CONFIG_ZONE_DMA))