[PATCH 0/2] kexec-tools: Fix split crash kernel reservations
Rui Qi
qirui.001 at bytedance.com
Tue Aug 18 05:35:05 PDT 2026
Hi,
This series fixes two kexec-tools issues seen with split crash kernel
reservations.
The first patch makes --print-ckr-size prefer
/sys/kernel/kexec_crash_size. This restores the option's original
user-visible contract: report the same crash kernel reserved size and
unit as the kernel sysfs attribute when that attribute is available.
The existing arch load-range based calculation is kept as a fallback for
older kernels.
The second patch fixes the RISC-V kexec_load crash path. RISC-V records
all Crash kernel ranges from /proc/iomem, but it currently writes only
the selected load range to linux,usable-memory-range. On systems with
high/low crash kernel reservations, that prevents the crash kernel from
seeing the low reservation after boot.
Keep placing the crash image segments in the selected load range, but
pass all crash kernel ranges to the crash kernel through
linux,usable-memory-range. This follows the split-reservation handoff
model already used by arm64 kexec-tools, where
linux,usable-memory-range = <BASE1 SIZE1 BASE2 SIZE2> advertises both
high and low crash kernel ranges to the crash dump kernel.
Tested on riscv64 with:
/proc/iomem:
f7e00000-ffdfffff : Crash kernel (128 MiB low)
1f88c00000-1ff6bfffff : Crash kernel (1760 MiB high)
/sys/kernel/kexec_crash_size:
1979711488
With the patched kexec binary:
kexec --print-ckr-size
1979711488
kexec -c -p ... followed by a panic completed kdump successfully.
The crash kernel reported both ranges as System RAM in /proc/iomem:
f7e00000-ffdfffff : System RAM
1f88c00000-1ff6bfffff : System RAM
The vmcore was saved successfully.
Rui Qi (2):
kexec: Print crash kernel reserved size from sysfs
RISC-V: Pass all crash kernel ranges to crash kernel
kexec/arch/riscv/crashdump-riscv.c | 14 ++++++++
kexec/arch/riscv/kexec-riscv.c | 35 +++++++++++++++++--
kexec/arch/riscv/kexec-riscv.h | 1 +
kexec/dt-ops.c | 55 ++++++++++++++++++++++++------
kexec/dt-ops.h | 5 ++-
kexec/kexec.c | 27 ++++++++++++---
6 files changed, 118 insertions(+), 19 deletions(-)
--
2.52.0
More information about the linux-riscv
mailing list