Thread (17 messages) 17 messages, 4 authors, 2021-05-12
STALE1823d REVIEWED: 1 (0M)

[PATCH stable v5.10 1/7] arm64: mm: Move reserve_crashkernel() into mem_init()

From: Jing Xiangfeng <hidden>
Date: 2021-03-03 13:06:26
Also in: linux-arm-kernel, linux-mm, linux-riscv, lkml, stable
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

From: Nicolas Saenz Julienne <redacted>

commit 0a30c53573b07d5561457e41fb0ab046cd857da5 upstream

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 <redacted>
Tested-by: Jeremy Linton <redacted>
Link: https://lore.kernel.org/r/20201119175400.9995-2-nsaenzjulienne@suse.de (local)
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: <redacted>
Signed-off-by: Jing Xiangfeng <redacted>
---
 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 00576a960f11..686653e33250 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -386,8 +386,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;
@@ -427,6 +425,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();
 }
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help