[PATCH v1 2/8] s390/kdump: Reserve crashkernel CMA memory
From: Mikhail Zaslonko
Date: Thu Nov 12 2026 - 07:02:06 EST
Parse the ",cma" suffix of crashkernel= and reserve the CMA memory with
reserve_crashkernel_cma(). A kdump kernel does not reserve any, it uses
the CMA memory of the crashed kernel instead.
Signed-off-by: Mikhail Zaslonko <zaslonko@xxxxxxxxxxxxx>
---
arch/s390/kernel/setup.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b60284328fe3..0251bd35954a 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -598,12 +598,12 @@ static void __init reserve_pgtables(void)
static void __init reserve_crashkernel(void)
{
#ifdef CONFIG_CRASH_DUMP
- unsigned long long crash_base, crash_size;
+ unsigned long long crash_base, crash_size, cma_size = 0;
phys_addr_t low, high;
int rc;
rc = parse_crashkernel(boot_command_line, ident_map_size,
- &crash_size, &crash_base, NULL, NULL, NULL);
+ &crash_size, &crash_base, NULL, &cma_size, NULL);
crash_base = ALIGN(crash_base, KEXEC_CRASH_MEM_ALIGN);
crash_size = ALIGN(crash_size, KEXEC_CRASH_MEM_ALIGN);
@@ -658,6 +658,13 @@ static void __init reserve_crashkernel(void)
crash_size >> 20, crash_base >> 20,
(unsigned long)memblock.memory.total_size >> 20);
os_info_crashkernel_add(crash_base, crash_size);
+
+ /*
+ * A kdump kernel is handed the CMA ranges of the crashed kernel
+ * instead of reserving its own.
+ */
+ if (!oldmem_data.start)
+ reserve_crashkernel_cma(cma_size);
#endif
}
--
2.55.0