]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc/kdump: Add support for crashkernel CMA reservation
authorSourabh Jain <sourabhjain@linux.ibm.com>
Fri, 7 Nov 2025 08:03:34 +0000 (13:33 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 11 Nov 2025 08:41:08 +0000 (14:11 +0530)
commitb4a96ab50f368afc2360ff539a20254ca2c9a889
tree11c05cb190dc8eb962d2d5b9058990e5bba4b935
parent8127c4fdf169465b631b62f7e45a042ced32dc77
powerpc/kdump: Add support for crashkernel CMA reservation

Commit 35c18f2933c5 ("Add a new optional ",cma" suffix to the
crashkernel= command line option") and commit ab475510e042 ("kdump:
implement reserve_crashkernel_cma") added CMA support for kdump
crashkernel reservation.

Extend crashkernel CMA reservation support to powerpc.

The following changes are made to enable CMA reservation on powerpc:

- Parse and obtain the CMA reservation size along with other crashkernel
  parameters
- Call reserve_crashkernel_cma() to allocate the CMA region for kdump
- Include the CMA-reserved ranges in the usable memory ranges for the
  kdump kernel to use.
- Exclude the CMA-reserved ranges from the crash kernel memory to
  prevent them from being exported through /proc/vmcore.

With the introduction of the CMA crashkernel regions,
crash_exclude_mem_range() needs to be called multiple times to exclude
both crashk_res and crashk_cma_ranges from the crash memory ranges. To
avoid repetitive logic for validating mem_ranges size and handling
reallocation when required, this functionality is moved to a new wrapper
function crash_exclude_mem_range_guarded().

To ensure proper CMA reservation, reserve_crashkernel_cma() is called
after pageblock_order is initialized.

Update kernel-parameters.txt to document CMA support for crashkernel on
powerpc architecture.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20251107080334.708028-1-sourabhjain@linux.ibm.com
Documentation/admin-guide/kernel-parameters.txt
arch/powerpc/include/asm/kexec.h
arch/powerpc/kernel/setup-common.c
arch/powerpc/kexec/core.c
arch/powerpc/kexec/ranges.c