Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] kexec-tools: Fix split crash kernel reservations
@ 2026-08-18 12:35 Rui Qi
  2026-08-18 12:35 ` [PATCH 1/2] kexec: Print crash kernel reserved size from sysfs Rui Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rui Qi @ 2026-08-18 12:35 UTC (permalink / raw)
  To: kexec; +Cc: horms, linux-riscv, Rui Qi

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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-24 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 12:35 [PATCH 0/2] kexec-tools: Fix split crash kernel reservations Rui Qi
2026-08-18 12:35 ` [PATCH 1/2] kexec: Print crash kernel reserved size from sysfs Rui Qi
2026-08-18 12:35 ` [PATCH 2/2] RISC-V: Pass all crash kernel ranges to crash kernel Rui Qi
2026-08-24 15:27 ` [PATCH 0/2] kexec-tools: Fix split crash kernel reservations Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox