From 1385c007d5376454d03683c31a6b29fc32b0b788 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Thu, 4 Mar 2021 09:53:14 +0800 Subject: [PATCH] arm64: mm: Move reserve_crashkernel() into mem_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mainline inclusion from mainline-5.11-rc1 commit 0a30c53573b07d5561457e41fb0ab046cd857da5 category: bugfix bugzilla: 50423 CVE: NA --------------------------------------------- crashkernel might reserve memory located in ZONE_DMA. We plan to delay ZONE_DMA's initialization after unflattening the devicetree and ACPI's boot table initialization, so move it later in the boot process. Specifically into bootmem_init() since request_standard_resources() depends on it. Signed-off-by: Nicolas Saenz Julienne Tested-by: Jeremy Linton Link: https://lore.kernel.org/r/20201119175400.9995-2-nsaenzjulienne@suse.de Signed-off-by: Catalin Marinas Signed-off-by: Jing Xiangfeng Reviewed-by: KefengĀ  Wang Signed-off-by: Zheng Zengkai --- arch/arm64/mm/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 794f992cb200..58c4da5786e9 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -355,8 +355,6 @@ void __init arm64_memblock_init(void) else arm64_dma32_phys_limit = PHYS_MASK + 1; - reserve_crashkernel(); - reserve_elfcorehdr(); high_memory = __va(memblock_end_of_DRAM() - 1) + 1; @@ -396,6 +394,12 @@ void __init bootmem_init(void) sparse_init(); zone_sizes_init(min, max); + /* + * request_standard_resources() depends on crashkernel's memory being + * reserved, so do it here. + */ + reserve_crashkernel(); + memblock_dump_all(); } -- GitLab