public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/11] kdump: reduce vmcore size and capture time via linux,no-dump
@ 2026-04-29  6:58 Chen Wandun
  2026-04-29  6:58 ` [PATCH 01/11] of: reserved_mem: fix region count for nodes with multiple reg entries Chen Wandun
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Chen Wandun @ 2026-04-29  6:58 UTC (permalink / raw)
  To: kexec, linux-doc, linux-kernel, linux-arm-kernel, loongarch,
	linux-riscv, devicetree
  Cc: akpm, bhe, rppt, pasha.tatashin, pratyush, ruirui.yang, corbet,
	skhan, catalin.marinas, will, chenhuacai, kernel, pjw, palmer,
	aou, robh, saravanak, chenwandun, zhaomeijing, everyzhao

This series has two parts:

 - Patches 1-4 are OF reserved_mem bug fixes and small hardening
   changes. They stand on their own and at the same time prepare the
   ground for the feature work that follows (accurate region counts,
   consistent two-pass save/reserve state, and an early-out when the
   array is empty).

 - Patches 5-11 introduce a new 'linux,no-dump' reserved-memory
   device tree property and the kdump plumbing to honour it, split
   further as:

     * Patches 5-7: core OF changes - parse 'linux,no-dump' on
       /reserved-memory/ children, save /memreserve/ firmware regions
       into reserved_mem[] with no_dump defaulted on, and add generic
       no-dump crash_mem exclusion helpers.

     * Patches 8-10: arch kdump consumers - arm64, riscv and
       loongarch each call the helpers from patch 7 in their
       prepare_elf_headers() so that 'linux,no-dump' /reserved-memory/
       children and /memreserve/ regions are filtered out of the
       vmcore ELF PT_LOAD segments.

     * Patch 11: user-facing documentation in
       Documentation/admin-guide/kdump/kdump.rst.

Motivation
==========

On SoCs that carve out large firmware-owned reserved memory (GPU
firmware, DSP, modem, camera ISP, NPU, ...), kdump currently dumps
those carveouts as part of system RAM even though their contents are
firmware state that is not useful for kernel crash analysis. On a
machine with several hundred MiB of such carveouts, the overhead per
vmcore is substantial.

This series adds a declarative way for DT authors to mark such
regions:

    reserved-memory {
        npu_fw@a0000000 {
            reg = <0x0 0xa0000000 0x0 0x10000000>;
            linux,no-dump;
        };
    };

and also defaults /memreserve/ firmware regions (Trusted Firmware /
BL31 images, secondary-CPU spin-table pens, bootloader scratch per
Documentation/arch/arm64/booting.rst and upstream DTS files) to
no_dump=true.

Interaction with existing reserved-memory flags is kept simple:
'linux,no-dump' is an OS hint, it is redundant (but harmless) when
combined with 'no-map' and silently ignored on 'reusable' (CMA)
regions whose contents are relevant for crash analysis. The 'linux,'
prefix follows existing precedents like 'linux,cma-default' since
kdump is a Linux-specific concept.

Benefits
========

 - Smaller vmcore. The excluded firmware carveouts are omitted from
   the ELF PT_LOAD segments entirely, so the resulting dump file is
   smaller by roughly the sum of the tagged regions - on SoCs with
   hundreds of MiB of GPU/DSP/modem/NPU carveouts this is a
   substantial saving, both on disk and in transit to a dump server.

 - Faster kdump. The dump-capture kernel writes less data to storage
   or over the network, which directly shortens the crash-to-dump
   turnaround. Tools that walk the dump (makedumpfile, crash) also
   spend less time on regions that were never going to be useful
   anyway.

 - No existing behaviour change for DTs that do not opt in: regions
   without 'linux,no-dump' and systems without /memreserve/ entries
   are dumped exactly as before.

DT binding
==========

The 'linux,no-dump' property is maintained in dt-schema
(reserved-memory.yaml moved there from the kernel tree).
Corresponding PR:

  https://github.com/devicetree-org/dt-schema/pull/193

Follow-ups
==========

 - powerpc also uses kexec_file and /reserved-memory/, but its
   arch/powerpc/kexec/ranges.c uses the _guarded variant of
   crash_exclude_mem_range with dynamic realloc and collects
   additional RTAS/OPAL firmware ranges. Adapting it needs a small
   extra helper; left as a follow-up.

---

Chen Wandun (11):
  of: reserved_mem: fix region count for nodes with multiple reg entries
  of: reserved_mem: reject reserved memory outside physical address
    range
  of: reserved_mem: avoid unconditional save of reg entries in
    fdt_scan_reserved_mem_late()
  of: reserved_mem: skip reserved_mem array allocation when there is
    nothing to save
  of: reserved_mem: add linux,no-dump property support for reserved
    memory regions
  of: reserved_mem: save /memreserve/ entries into reserved_mem array
  of: reserved_mem: add no-dump crash_mem exclusion helpers
  arm64: kdump: exclude no-dump reserved memory regions from vmcore
  riscv: kdump: exclude no-dump reserved memory regions from vmcore
  loongarch: kdump: exclude no-dump reserved memory regions from vmcore
  Documentation: admin-guide: kdump: document linux,no-dump DT property

 Documentation/admin-guide/kdump/kdump.rst  |  59 ++++++
 arch/arm64/kernel/machine_kexec_file.c     |   6 +
 arch/loongarch/kernel/machine_kexec_file.c |   6 +
 arch/riscv/kernel/machine_kexec_file.c     |   4 +
 drivers/of/of_reserved_mem.c               | 233 ++++++++++++++++++---
 include/linux/of_reserved_mem.h            |  16 ++
 6 files changed, 295 insertions(+), 29 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-05-06  1:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29  6:58 [PATCH 00/11] kdump: reduce vmcore size and capture time via linux,no-dump Chen Wandun
2026-04-29  6:58 ` [PATCH 01/11] of: reserved_mem: fix region count for nodes with multiple reg entries Chen Wandun
2026-05-06  1:47   ` Rob Herring
2026-04-29  6:58 ` [PATCH 02/11] of: reserved_mem: reject reserved memory outside physical address range Chen Wandun
2026-05-06  1:51   ` Rob Herring
2026-04-29  6:58 ` [PATCH 03/11] of: reserved_mem: avoid unconditional save of reg entries in fdt_scan_reserved_mem_late() Chen Wandun
2026-04-29  6:58 ` [PATCH 04/11] of: reserved_mem: skip reserved_mem array allocation when there is nothing to save Chen Wandun
2026-04-29  6:58 ` [PATCH 05/11] of: reserved_mem: add linux,no-dump property support for reserved memory regions Chen Wandun
2026-04-29  6:58 ` [PATCH 06/11] of: reserved_mem: save /memreserve/ entries into reserved_mem array Chen Wandun
2026-04-29  6:58 ` [PATCH 07/11] of: reserved_mem: add no-dump crash_mem exclusion helpers Chen Wandun
2026-04-29  6:58 ` [PATCH 08/11] arm64: kdump: exclude no-dump reserved memory regions from vmcore Chen Wandun
2026-04-29  6:58 ` [PATCH 09/11] riscv: " Chen Wandun
2026-04-29  6:58 ` [PATCH 10/11] loongarch: " Chen Wandun
2026-04-29  6:58 ` [PATCH 11/11] Documentation: admin-guide: kdump: document linux,no-dump DT property Chen Wandun

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