* [PATCH 0/8] arm64: crash: Add crash hotplug support
@ 2026-07-23 13:12 Jinjie Ruan
2026-07-23 13:12 ` [PATCH 1/8] powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr() Jinjie Ruan
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
When CPU or memory hotplug events occur, the elfcorehdr in the kdump image
becomes stale, potentially leading to incomplete crash dumps.
Currently, userspace udev rules reload the entire kdump image upon such
events, which is inefficient and leaves kdump inactive for a long time.
Commit 247262756121 ("crash: add generic infrastructure for crash hotplug
support") introduced a kernel mechanism to update only the elfcorehdr.
This patch set implements crash hotplug support for arm64.
It also addresses and fixes several critical pre-existing code issues
and Sashiko AI review findings extracted from the previous patch set,
following Baoquan's suggestions.
The major improvements and fixes included in this series are:
- Fix powerpc memory leak, null-ptr-def and overlapping memory
range truncation bug.
- Fix several memory leaks for arm64.
- Simplify arm64 load_other_segments().
- Implement infrastructure for arm64 crash memory hotplug support.
This patch set is rebased on liveupdate/crashkernel-cma.
Link: https://lore.kernel.org/all/20260601094805.2928614-1-ruanjinjie@huawei.com/
Jinjie Ruan (8):
powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr()
powerpc/kexec_file: Fix null-ptr-def in extra size calculation
powerpc/kexec_file: Prevent kexec range truncation
kexec: Extract kexec_free_segment_cma() from kimage_free_cma()
arm64: kexec_file: Fix CMA page leaks in segment placement retry loops
arm64: kexec_file: Fix image->elf_headers memory leak during retry
loop
arm64: kexec_file: Simplify load_other_segments()
arm64: crash: Add crash hotplug support
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/kexec.h | 13 +++
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/crash.c | 148 +++++++++++++++++++++++++
arch/arm64/kernel/kexec_image.c | 1 +
arch/arm64/kernel/machine_kexec_file.c | 76 ++++++-------
arch/powerpc/kexec/crash.c | 2 +-
arch/powerpc/kexec/file_load_64.c | 2 +-
arch/powerpc/kexec/ranges.c | 12 +-
include/linux/kexec.h | 2 +
kernel/kexec_core.c | 25 +++--
11 files changed, 223 insertions(+), 63 deletions(-)
create mode 100644 arch/arm64/kernel/crash.c
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/8] powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr()
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 2/8] powerpc/kexec_file: Fix null-ptr-def in extra size calculation Jinjie Ruan
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
In get_crash_memory_ranges(), if crash_exclude_mem_range() failed
after realloc_mem_ranges() has successfully allocated the cmem
memory, it just returns an error but leaves cmem pointing to
the allocated memory, nor is it freed in the caller
update_crash_elfcorehdr(), which cause a memory leak, goto out
to free the cmem.
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Fixes: 849599b702ef ("powerpc/crash: add crash memory hotplug support")
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/powerpc/kexec/crash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 60a917a6beaa..775895f31037 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -502,7 +502,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
ret = get_crash_memory_ranges(&cmem);
if (ret) {
pr_err("Failed to get crash mem range\n");
- return;
+ goto out;
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/8] powerpc/kexec_file: Fix null-ptr-def in extra size calculation
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
2026-07-23 13:12 ` [PATCH 1/8] powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr() Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 3/8] powerpc/kexec_file: Prevent kexec range truncation Jinjie Ruan
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
A static Sashiko AI review identified a potential NULL pointer
dereference in kexec_extra_fdt_size_ppc64().
On platforms without any reserved memory regions,
get_reserved_memory_ranges() can return 0 while leaving 'rmem'
unallocated as NULL. Passing it directly leads to a kernel panic when
evaluating 'rmem->nr_ranges'.
Add a NULL check for 'rmem' to prevent this crash.
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: stable@vger.kernel.org
Fixes: 0d3ff067331e ("powerpc/kexec_file: fix extra size calculation for kexec FDT")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/powerpc/kexec/file_load_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
index 8c72e12ea44e..6075b1c88511 100644
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -664,7 +664,7 @@ unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *
extra_size += (cpu_nodes - boot_cpu_node_count) * cpu_node_size();
/* Consider extra space for reserved memory ranges if any */
- if (rmem->nr_ranges > 0)
+ if (rmem && rmem->nr_ranges > 0)
extra_size += sizeof(struct fdt_reserve_entry) * rmem->nr_ranges;
return extra_size + kdump_extra_fdt_size_ppc64(image, cpu_nodes);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/8] powerpc/kexec_file: Prevent kexec range truncation
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
2026-07-23 13:12 ` [PATCH 1/8] powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr() Jinjie Ruan
2026-07-23 13:12 ` [PATCH 2/8] powerpc/kexec_file: Fix null-ptr-def in extra size calculation Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 4/8] kexec: Extract kexec_free_segment_cma() from kimage_free_cma() Jinjie Ruan
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
Sashiko AI review pointed out the following issue.
The __merge_memory_ranges() function incorrectly handles overlapping
memory ranges when merging them. Although sort_memory_ranges() sorts all
ranges by their start address in ascending order beforehand, the merge
logic remains defective in two ways:
1. It compares the current range's start against the previous element (i-1)
instead of the running target index (idx)
2. It unconditionally overwrites 'ranges[idx].end' with 'ranges[i].end'.
This logic flaw leads to critical memory truncation when a larger memory
range completely subsumes subsequent smaller ranges.
For example, consider a sorted input array with three ranges:
Range A (idx=0): [0x1000 - 0x9000]
Range B (i=1): [0x2000 - 0x5000] (completely inside Range A)
Range C (i=2): [0x6000 - 0x8000] (completely inside Range A)
1. When i=1 (Range B):
ranges[1].start (0x2000) <= ranges[0].end + 1 (0x9001) is TRUE.
The code executes: ranges[0].end = ranges[1].end, which erroneously
shrinks Range A's end from 0x9000 down to 0x5000.
2. When i=2 (Range C):
ranges[2].start (0x6000) <= ranges[1].end + 1 (0x5001) is FALSE.
The code falls into the else block, creating a broken new range.
As a result, valid memory fragments [0x5001 - 0x5fff] and [0x8001 - 0x9000]
are completely lost from the kexec exclude lists, potentially allowing
the crash kernel to overwrite active memory, causing data corruption
or crashes.
Fix this by ensuring the start of the current range is compared against the
end of the active merged range (idx), and use max() to safely prevent the
outer boundary from being truncated.
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: stable@vger.kernel.org
Fixes: 180adfc532a8 ("powerpc/kexec_file: Add helper functions for getting memory ranges")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/powerpc/kexec/ranges.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kexec/ranges.c b/arch/powerpc/kexec/ranges.c
index e5fea23b191b..539061d14a77 100644
--- a/arch/powerpc/kexec/ranges.c
+++ b/arch/powerpc/kexec/ranges.c
@@ -21,6 +21,7 @@
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/memblock.h>
+#include <linux/minmax.h>
#include <linux/crash_core.h>
#include <asm/sections.h>
#include <asm/kexec_ranges.h>
@@ -105,19 +106,16 @@ static void __merge_memory_ranges(struct crash_mem *mem_rngs)
struct range *ranges;
int i, idx;
- if (!mem_rngs)
+ if (!mem_rngs || mem_rngs->nr_ranges <= 1)
return;
idx = 0;
- ranges = &(mem_rngs->ranges[0]);
+ ranges = mem_rngs->ranges;
for (i = 1; i < mem_rngs->nr_ranges; i++) {
- if (ranges[i].start <= (ranges[i-1].end + 1))
- ranges[idx].end = ranges[i].end;
+ if (ranges[i].start <= (ranges[idx].end + 1))
+ ranges[idx].end = max(ranges[idx].end, ranges[i].end);
else {
idx++;
- if (i == idx)
- continue;
-
ranges[idx] = ranges[i];
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/8] kexec: Extract kexec_free_segment_cma() from kimage_free_cma()
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (2 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 3/8] powerpc/kexec_file: Prevent kexec range truncation Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 5/8] arm64: kexec_file: Fix CMA page leaks in segment placement retry loops Jinjie Ruan
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
The generic kimage_free_cma() relies on `image->nr_segments` to iterate
and free allocated CMA pages. However, during architecture-specific
segment placement retry loops (e.g., arm64's image_load()), a mid-way
failure will truncate `image->nr_segments` back to its initial value.
This truncation permanently hides any CMA pages allocated outside the
new boundary from global cleanup, causing silent background memory leaks.
To allow architecture-specific loaders to execute fine-grained memory
reclamation before truncation occurs, extract the single-pass CMA release
logic into a dedicated and exported helper:
void kexec_free_segment_cma(struct kimage *image, unsigned long idx);
Refactor the main kimage_free_cma() to invoke this helper sequentially
to maintain backward compatibility while expanding single-slot flexibility.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
include/linux/kexec.h | 2 ++
kernel/kexec_core.c | 25 ++++++++++++++-----------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 8a22bc9b8c6c..6f1eabda0300 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -532,6 +532,7 @@ extern bool kexec_file_dbg_print;
extern void *kimage_map_segment(struct kimage *image, int idx);
extern void kimage_unmap_segment(void *buffer);
+extern void kexec_free_segment_cma(struct kimage *image, unsigned long idx);
#else /* !CONFIG_KEXEC_CORE */
struct pt_regs;
struct task_struct;
@@ -543,6 +544,7 @@ static inline int kexec_crash_loaded(void) { return 0; }
static inline void *kimage_map_segment(struct kimage *image, int idx)
{ return NULL; }
static inline void kimage_unmap_segment(void *buffer) { }
+static inline void kexec_free_segment_cma(struct kimage *image, unsigned long idx) { }
#define kexec_in_progress false
#endif /* CONFIG_KEXEC_CORE */
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index dc770b9a6d05..ec7e86e085b0 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -554,22 +554,25 @@ static void kimage_free_entry(kimage_entry_t entry)
kimage_free_pages(page);
}
-static void kimage_free_cma(struct kimage *image)
+void kexec_free_segment_cma(struct kimage *image, unsigned long idx)
{
- unsigned long i;
+ u32 nr_pages = image->segment[idx].memsz >> PAGE_SHIFT;
+ struct page *cma = image->segment_cma[idx];
- for (i = 0; i < image->nr_segments; i++) {
- struct page *cma = image->segment_cma[i];
- u32 nr_pages = image->segment[i].memsz >> PAGE_SHIFT;
+ if (!cma)
+ return;
- if (!cma)
- continue;
+ arch_kexec_pre_free_pages(page_address(cma), nr_pages);
+ dma_release_from_contiguous(NULL, cma, nr_pages);
+ image->segment_cma[idx] = NULL;
+}
- arch_kexec_pre_free_pages(page_address(cma), nr_pages);
- dma_release_from_contiguous(NULL, cma, nr_pages);
- image->segment_cma[i] = NULL;
- }
+static void kimage_free_cma(struct kimage *image)
+{
+ unsigned long i;
+ for (i = 0; i < image->nr_segments; i++)
+ kexec_free_segment_cma(image, i);
}
void kimage_free(struct kimage *image)
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/8] arm64: kexec_file: Fix CMA page leaks in segment placement retry loops
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (3 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 4/8] kexec: Extract kexec_free_segment_cma() from kimage_free_cma() Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 6/8] arm64: kexec_file: Fix image->elf_headers memory leak during retry loop Jinjie Ruan
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
Sashiko AI code review pointed out, during kexec image placement retry
loops in image_load(), the loader attempts to find a suitable memory
hole for the kernel and its associated segments (initrd, dtb, etc.).
When a placement attempt fails midway, it restores `image->nr_segments` to
its initial state to purge failed segments.
However, this truncation causes a memory leak. Any CMA pages allocated
via kexec_add_buffer() during the failed attempt are tracked in
the `image->segment_cma` array. Because the subsequent cleanup
kimage_free_cma() cleanup only iterates up to the truncated `nr_segments`
boundary, these allocated CMA pages outside the new boundary permanently
leaked.
Fix this by using kexec_free_segment_cma() to explicitly release the
associated CMA buffers in the failure paths before `image->nr_segments`
is reduced.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Breno Leitao <leitao@debian.org>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Kees Cook <kees@kernel.org>
Cc: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: stable@vger.kernel.org
Fixes: 07d24902977e4 ("kexec: enable CMA based contiguous allocation")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm64/kernel/kexec_image.c | 1 +
arch/arm64/kernel/machine_kexec_file.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
index b70f4df15a1a..ffcb7f9075e6 100644
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -107,6 +107,7 @@ static void *image_load(struct kimage *image,
* We couldn't find space for the other segments; erase the
* kernel segment and try the next available hole.
*/
+ kexec_free_segment_cma(image, kernel_segment_number);
image->nr_segments -= 1;
kbuf.buf_min = kernel_segment->mem + kernel_segment->memsz;
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 854d872dfd0f..e48f29167b38 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -179,7 +179,10 @@ int load_other_segments(struct kimage *image,
return 0;
out_err:
- image->nr_segments = orig_segments;
+ while (image->nr_segments > orig_segments) {
+ kexec_free_segment_cma(image, image->nr_segments - 1);
+ image->nr_segments--;
+ }
kvfree(dtb);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/8] arm64: kexec_file: Fix image->elf_headers memory leak during retry loop
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (4 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 5/8] arm64: kexec_file: Fix CMA page leaks in segment placement retry loops Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 7/8] arm64: kexec_file: Simplify load_other_segments() Jinjie Ruan
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
Sashiko AI code review pointed out a potential memory leak of
image->elf_headers when load_other_segments() fails on error paths.
When load_other_segments() fails during the arm64 kexec_file file-load
path, execution jumps to the out_err label. While this path restores
`image->nr_segments`, it returns an error back to the caller without
freeing the allocated `image->elf_headers` vmalloc buffer.
Consequently, the retry loop in image_load() will allocate new ELF
headers on the next iteration and overwrite `image->elf_headers`,
permanently leaking the memory blocks allocated in previous iterations.
Fix this by explicitly freeing the stale `image->elf_headers` buffer
once the new headers buffer is allocated.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Breno Leitao <leitao@debian.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Benjamin Gwin <bgwin@google.com>
Cc: stable@vger.kernel.org
Fixes: 108aa503657e ("arm64: kexec_file: try more regions if loading segments fails")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm64/kernel/machine_kexec_file.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index e48f29167b38..2f750e5f4fcc 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -112,6 +112,10 @@ int load_other_segments(struct kimage *image,
vfree(headers);
goto out_err;
}
+
+ if (unlikely(image->elf_headers))
+ vfree(image->elf_headers);
+
image->elf_headers = headers;
image->elf_load_addr = kbuf.mem;
image->elf_headers_sz = headers_sz;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/8] arm64: kexec_file: Simplify load_other_segments()
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (5 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 6/8] arm64: kexec_file: Fix image->elf_headers memory leak during retry loop Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-23 13:12 ` [PATCH 8/8] arm64: crash: Add crash hotplug support Jinjie Ruan
2026-07-26 7:10 ` [PATCH 0/8] " Mike Rapoport
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
Use `kbuf` fields directly in crash_prepare_headers() so the local
variables "headers" and "headers_sz" can be removed.
Additionally, assign the allocated buffer to `image->elf_headers` before
calling kexec_add_buffer(). If kexec_add_buffer() fails, the explicit
vfree() in the error path can be eliminated, as the allocated elf header
memory will be automatically freed via `image->elf_headers` in
arch_kimage_file_post_load_cleanup().
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Breno Leitao <leitao@debian.org>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm64/kernel/machine_kexec_file.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 2f750e5f4fcc..3d907f8ee594 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -89,36 +89,30 @@ int load_other_segments(struct kimage *image,
kbuf.buf_min = kernel_load_addr + kernel_size;
#ifdef CONFIG_CRASH_DUMP
- /* load elf core header */
- void *headers;
- unsigned long headers_sz;
if (image->type == KEXEC_TYPE_CRASH) {
- ret = crash_prepare_headers(true, &headers, &headers_sz, NULL);
+ ret = crash_prepare_headers(true, &kbuf.buffer, &kbuf.bufsz, NULL);
if (ret) {
pr_err("Preparing elf core header failed\n");
goto out_err;
}
- kbuf.buffer = headers;
- kbuf.bufsz = headers_sz;
+ if (unlikely(image->elf_headers))
+ vfree(image->elf_headers);
+
+ image->elf_headers = kbuf.buffer;
+ image->elf_headers_sz = kbuf.bufsz;
+
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
- kbuf.memsz = headers_sz;
+ kbuf.memsz = kbuf.bufsz;
kbuf.buf_align = SZ_64K; /* largest supported page size */
kbuf.buf_max = ULONG_MAX;
kbuf.top_down = true;
ret = kexec_add_buffer(&kbuf);
- if (ret) {
- vfree(headers);
+ if (ret)
goto out_err;
- }
-
- if (unlikely(image->elf_headers))
- vfree(image->elf_headers);
- image->elf_headers = headers;
image->elf_load_addr = kbuf.mem;
- image->elf_headers_sz = headers_sz;
kexec_dprintk("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
image->elf_load_addr, kbuf.bufsz, kbuf.memsz);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/8] arm64: crash: Add crash hotplug support
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (6 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 7/8] arm64: kexec_file: Simplify load_other_segments() Jinjie Ruan
@ 2026-07-23 13:12 ` Jinjie Ruan
2026-07-26 7:10 ` [PATCH 0/8] " Mike Rapoport
8 siblings, 0 replies; 10+ messages in thread
From: Jinjie Ruan @ 2026-07-23 13:12 UTC (permalink / raw)
To: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, rppt, pasha.tatashin, pratyush, thuth, ruanjinjie,
vladimir.murzin, mark.rutland, ardb, james.morse, leitao,
yeoreum.yun, robh, kees, coxu, sourabhjain, ritesh.list, adityag,
hbathini, makb, piliu, graf, liaoyuanhong, jbouron, bauerman,
bgwin, linux-arm-kernel, linux-kernel, linuxppc-dev, kexec
When CPU or memory hotplug events occur, the elfcorehdr in the kdump image
becomes stale, potentially leading to incomplete crash dumps.
Currently, userspace udev rules reload the entire kdump image upon such
events, which is inefficient and leaves kdump inactive for a long time.
Commit 247262756121 ("crash: add generic infrastructure for crash hotplug
support") introduced a kernel mechanism to update only the elfcorehdr.
This patch enables that support for arm64.
On arm64, only memory hotplug events require elfcorehdr updates:
- Physical CPU hotplug is not supported.
- For ACPI based vCPU hotplug [1], the elfcorehdr is built using
for_each_possible_cpu(), so no update is needed.
The patch:
- Adds CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG (default y).
- Implements following arch functions to handle memory hotplug:
1. arch_crash_hotplug_support()
2. arch_crash_get_elfcorehdr_size()
3. arch_crash_handle_hotplug_event()
- Moves arch_get_system_nr_ranges() and arch_crash_populate_cmem()
from machine_kexec_file.c to crash.c for crash hotplug reuse.
Follows the approach of x86 commit ea53ad9cf73b ("x86/crash: add x86 crash
hotplug support") and powerpc commit b741092d5976 ("powerpc/crash: add
crash CPU hotplug support").
Tested with QEMU [2] virtual machine using:
-M virt,acpi=on,highmem=on
-smp cpus=1,maxcpus=3
-bios /usr/share/edk2/aarch64/QEMU_EFI.fd
-m 2G,slots=64,maxmem=16G
Only kexec_file_load path has been tested; kexec_load is expected to
work via KEXEC_CRASH_HOTPLUG_SUPPORT flag but not yet verified.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Breno Leitao <leitao@debian.org>
Cc: Kees Cook <kees@kernel.org>
[1]: https://lore.kernel.org/all/20240529133446.28446-1-Jonathan.Cameron@huawei.com/
[2]: https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v2
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/kexec.h | 13 +++
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/crash.c | 148 +++++++++++++++++++++++++
arch/arm64/kernel/machine_kexec_file.c | 53 ++++-----
5 files changed, 187 insertions(+), 32 deletions(-)
create mode 100644 arch/arm64/kernel/crash.c
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index b3afe0688919..bebebded5b96 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1666,6 +1666,9 @@ config ARCH_DEFAULT_CRASH_DUMP
config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
def_bool CRASH_RESERVE
+config ARCH_SUPPORTS_CRASH_HOTPLUG
+ def_bool y
+
config TRANS_TABLE
def_bool y
depends on HIBERNATION || KEXEC_CORE
diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h
index 892e5bebda95..4f3d4fc2807e 100644
--- a/arch/arm64/include/asm/kexec.h
+++ b/arch/arm64/include/asm/kexec.h
@@ -130,6 +130,19 @@ extern int load_other_segments(struct kimage *image,
char *cmdline);
#endif
+#ifdef CONFIG_CRASH_HOTPLUG
+#define pnum_hdr_sz(pnum) ((pnum) * sizeof(Elf64_Phdr) + sizeof(Elf64_Ehdr))
+
+void arch_crash_handle_hotplug_event(struct kimage *image, void *arg);
+#define arch_crash_handle_hotplug_event arch_crash_handle_hotplug_event
+
+int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags);
+#define arch_crash_hotplug_support arch_crash_hotplug_support
+
+unsigned int arch_crash_get_elfcorehdr_size(void);
+#define crash_get_elfcorehdr_size arch_crash_get_elfcorehdr_size
+#endif
+
#endif /* __ASSEMBLER__ */
#endif
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index d2690c3ec528..9bbac452994c 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -64,7 +64,7 @@ obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o \
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o
arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o
-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
+obj-$(CONFIG_CRASH_DUMP) += crash_dump.o crash.o
obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o
obj-$(CONFIG_ARM64_PTR_AUTH) += pointer_auth.o
diff --git a/arch/arm64/kernel/crash.c b/arch/arm64/kernel/crash.c
new file mode 100644
index 000000000000..4a8d074c49b8
--- /dev/null
+++ b/arch/arm64/kernel/crash.c
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Architecture specific functions for kexec based crash dumps.
+ */
+
+#define pr_fmt(fmt) "crash hp: " fmt
+
+#include <linux/kexec.h>
+#include <linux/elf.h>
+#include <linux/memblock.h>
+#include <linux/vmalloc.h>
+#include <linux/cacheflush.h>
+#include <linux/crash_core.h>
+
+#include <asm/kexec.h>
+
+#if defined(CONFIG_KEXEC_FILE) || defined(CONFIG_CRASH_HOTPLUG)
+unsigned int arch_get_system_nr_ranges(void)
+{
+ unsigned int nr_ranges = 2 + crashk_cma_cnt; /* for exclusion of crashkernel region */
+ phys_addr_t start, end;
+ u64 i;
+
+ for_each_mem_range(i, &start, &end)
+ nr_ranges++;
+
+ return nr_ranges;
+}
+
+int arch_crash_populate_cmem(struct crash_mem *cmem)
+{
+ phys_addr_t start, end;
+ u64 i;
+
+ for_each_mem_range(i, &start, &end) {
+ cmem->ranges[cmem->nr_ranges].start = start;
+ cmem->ranges[cmem->nr_ranges].end = end - 1;
+ cmem->nr_ranges++;
+ }
+
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_CRASH_HOTPLUG
+int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags)
+{
+#ifdef CONFIG_KEXEC_FILE
+ if (image->file_mode)
+ return 1;
+#endif
+ /*
+ * For kexec_load syscall, crash hotplug support requires
+ * KEXEC_CRASH_HOTPLUG_SUPPORT flag to be passed by userspace.
+ */
+ return kexec_flags & KEXEC_CRASH_HOTPLUG_SUPPORT;
+}
+
+unsigned int arch_crash_get_elfcorehdr_size(void)
+{
+ unsigned int phdr_cnt;
+
+ /* A program header for possible CPUs, vmcoreinfo and kernel_map */
+ phdr_cnt = 2 + num_possible_cpus();
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
+ phdr_cnt += CONFIG_CRASH_MAX_MEMORY_RANGES;
+
+ return pnum_hdr_sz(phdr_cnt);
+}
+
+/**
+ * update_crash_elfcorehdr() - Recreate the elfcorehdr and replace it with old
+ * elfcorehdr in the kexec segment array.
+ * @image: the active struct kimage
+ */
+static void update_crash_elfcorehdr(struct kimage *image)
+{
+ void *elfbuf = NULL, *old_elfcorehdr;
+ unsigned long mem, memsz;
+ unsigned long elfsz = 0;
+
+ /*
+ * Create the new elfcorehdr reflecting the changes to CPU and/or
+ * memory resources.
+ */
+ if (crash_prepare_headers(true, &elfbuf, &elfsz, NULL)) {
+ pr_err("unable to create new elfcorehdr");
+ goto out;
+ }
+
+ /*
+ * Obtain address and size of the elfcorehdr segment, and
+ * check it against the new elfcorehdr buffer.
+ */
+ mem = image->segment[image->elfcorehdr_index].mem;
+ memsz = image->segment[image->elfcorehdr_index].memsz;
+ if (elfsz > memsz) {
+ pr_err("update elfcorehdr elfsz %lu > memsz %lu",
+ elfsz, memsz);
+ goto out;
+ }
+
+ /*
+ * Copy new elfcorehdr over the old elfcorehdr at destination.
+ */
+ old_elfcorehdr = (void *)__va(mem);
+ if (!old_elfcorehdr) {
+ pr_err("mapping elfcorehdr segment failed\n");
+ goto out;
+ }
+
+ /*
+ * Temporarily invalidate the crash image while the
+ * elfcorehdr is updated.
+ */
+ xchg(&kexec_crash_image, NULL);
+ memcpy((void *)old_elfcorehdr, elfbuf, elfsz);
+ dcache_clean_inval_poc((unsigned long)old_elfcorehdr,
+ (unsigned long)old_elfcorehdr + elfsz);
+ xchg(&kexec_crash_image, image);
+ pr_debug("updated elfcorehdr\n");
+
+out:
+ vfree(elfbuf);
+}
+
+/**
+ * arch_crash_handle_hotplug_event() - Handle hotplug elfcorehdr changes
+ * @image: a pointer to kexec_crash_image
+ * @arg: struct memory_notify handler for memory hotplug case and
+ * NULL for CPU hotplug case.
+ *
+ * Update the kdump image based on the type of hotplug event:
+ * - CPU add and remove: No action is needed.
+ * - Memory add/remove: Update the elfcorehdr to reflect the current memory layout.
+ *
+ * Prepare the new elfcorehdr and replace the existing elfcorehdr.
+ */
+void arch_crash_handle_hotplug_event(struct kimage *image, void *arg)
+{
+ if ((image->file_mode || image->elfcorehdr_updated) &&
+ ((image->hp_action == KEXEC_CRASH_HP_ADD_CPU) ||
+ (image->hp_action == KEXEC_CRASH_HP_REMOVE_CPU)))
+ return;
+
+ update_crash_elfcorehdr(image);
+}
+#endif /* CONFIG_CRASH_HOTPLUG */
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 3d907f8ee594..35124f10b509 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -14,7 +14,6 @@
#include <linux/kernel.h>
#include <linux/kexec.h>
#include <linux/libfdt.h>
-#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/slab.h>
@@ -39,34 +38,6 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image)
return kexec_image_post_load_cleanup_default(image);
}
-#ifdef CONFIG_CRASH_DUMP
-unsigned int arch_get_system_nr_ranges(void)
-{
- unsigned int nr_ranges = 2 + crashk_cma_cnt; /* for exclusion of crashkernel region */
- phys_addr_t start, end;
- u64 i;
-
- for_each_mem_range(i, &start, &end)
- nr_ranges++;
-
- return nr_ranges;
-}
-
-int arch_crash_populate_cmem(struct crash_mem *cmem)
-{
- phys_addr_t start, end;
- u64 i;
-
- for_each_mem_range(i, &start, &end) {
- cmem->ranges[cmem->nr_ranges].start = start;
- cmem->ranges[cmem->nr_ranges].end = end - 1;
- cmem->nr_ranges++;
- }
-
- return 0;
-}
-#endif
-
/*
* Tries to add the initrd and DTB to the image. If it is not possible to find
* valid locations, this function will undo changes to the image and return non
@@ -89,8 +60,9 @@ int load_other_segments(struct kimage *image,
kbuf.buf_min = kernel_load_addr + kernel_size;
#ifdef CONFIG_CRASH_DUMP
+ unsigned long pnum = 0;
if (image->type == KEXEC_TYPE_CRASH) {
- ret = crash_prepare_headers(true, &kbuf.buffer, &kbuf.bufsz, NULL);
+ ret = crash_prepare_headers(true, &kbuf.buffer, &kbuf.bufsz, &pnum);
if (ret) {
pr_err("Preparing elf core header failed\n");
goto out_err;
@@ -101,9 +73,28 @@ int load_other_segments(struct kimage *image,
image->elf_headers = kbuf.buffer;
image->elf_headers_sz = kbuf.bufsz;
+ kbuf.memsz = kbuf.bufsz;
+
+#ifdef CONFIG_CRASH_HOTPLUG
+ /*
+ * The elfcorehdr segment size accounts for VMCOREINFO, kernel_map
+ * maximum CPUs and maximum memory ranges.
+ */
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
+ pnum = 2 + num_possible_cpus() + CONFIG_CRASH_MAX_MEMORY_RANGES;
+ else
+ pnum += 2 + num_possible_cpus();
+
+ if (pnum < (unsigned long)PN_XNUM) {
+ kbuf.memsz = pnum_hdr_sz(pnum);
+ image->elf_headers_sz = max(kbuf.memsz, kbuf.bufsz);
+ image->elfcorehdr_index = image->nr_segments;
+ } else {
+ pr_err("number of Phdrs %lu exceeds max\n", pnum);
+ }
+#endif
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
- kbuf.memsz = kbuf.bufsz;
kbuf.buf_align = SZ_64K; /* largest supported page size */
kbuf.buf_max = ULONG_MAX;
kbuf.top_down = true;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/8] arm64: crash: Add crash hotplug support
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
` (7 preceding siblings ...)
2026-07-23 13:12 ` [PATCH 8/8] arm64: crash: Add crash hotplug support Jinjie Ruan
@ 2026-07-26 7:10 ` Mike Rapoport
8 siblings, 0 replies; 10+ messages in thread
From: Mike Rapoport @ 2026-07-26 7:10 UTC (permalink / raw)
To: Jinjie Ruan
Cc: catalin.marinas, will, maddy, mpe, npiggin, chleroy, akpm,
baoquan.he, pasha.tatashin, pratyush, thuth, vladimir.murzin,
mark.rutland, ardb, james.morse, leitao, yeoreum.yun, robh, kees,
coxu, sourabhjain, ritesh.list, adityag, hbathini, makb, piliu,
graf, liaoyuanhong, jbouron, bauerman, bgwin, linux-arm-kernel,
linux-kernel, linuxppc-dev, kexec
Hi Jinjie,
On Thu, Jul 23, 2026 at 09:12:34PM +0800, Jinjie Ruan wrote:
> When CPU or memory hotplug events occur, the elfcorehdr in the kdump image
> becomes stale, potentially leading to incomplete crash dumps.
>
> Currently, userspace udev rules reload the entire kdump image upon such
> events, which is inefficient and leaves kdump inactive for a long time.
>
> Commit 247262756121 ("crash: add generic infrastructure for crash hotplug
> support") introduced a kernel mechanism to update only the elfcorehdr.
> This patch set implements crash hotplug support for arm64.
>
> It also addresses and fixes several critical pre-existing code issues
> and Sashiko AI review findings extracted from the previous patch set,
> following Baoquan's suggestions.
>
> The major improvements and fixes included in this series are:
>
> - Fix powerpc memory leak, null-ptr-def and overlapping memory
> range truncation bug.
>
> - Fix several memory leaks for arm64.
>
> - Simplify arm64 load_other_segments().
>
> - Implement infrastructure for arm64 crash memory hotplug support.
>
> This patch set is rebased on liveupdate/crashkernel-cma.
>
> Link: https://lore.kernel.org/all/20260601094805.2928614-1-ruanjinjie@huawei.com/
>
> Jinjie Ruan (8):
> powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr()
> powerpc/kexec_file: Fix null-ptr-def in extra size calculation
> powerpc/kexec_file: Prevent kexec range truncation
It's weird to see powerpc fixes in a series that adds a feature for arm64.
Judging by the subjects, they are completely unrelated to to crash support
for hotplug and should be sent as a separate set.
> kexec: Extract kexec_free_segment_cma() from kimage_free_cma()
> arm64: kexec_file: Fix CMA page leaks in segment placement retry loops
> arm64: kexec_file: Fix image->elf_headers memory leak during retry
> loop
> arm64: kexec_file: Simplify load_other_segments()
> arm64: crash: Add crash hotplug support
>
> arch/arm64/Kconfig | 3 +
> arch/arm64/include/asm/kexec.h | 13 +++
> arch/arm64/kernel/Makefile | 2 +-
> arch/arm64/kernel/crash.c | 148 +++++++++++++++++++++++++
> arch/arm64/kernel/kexec_image.c | 1 +
> arch/arm64/kernel/machine_kexec_file.c | 76 ++++++-------
> arch/powerpc/kexec/crash.c | 2 +-
> arch/powerpc/kexec/file_load_64.c | 2 +-
> arch/powerpc/kexec/ranges.c | 12 +-
> include/linux/kexec.h | 2 +
> kernel/kexec_core.c | 25 +++--
> 11 files changed, 223 insertions(+), 63 deletions(-)
> create mode 100644 arch/arm64/kernel/crash.c
>
> --
> 2.34.1
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-07-26 7:10 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 13:12 [PATCH 0/8] arm64: crash: Add crash hotplug support Jinjie Ruan
2026-07-23 13:12 ` [PATCH 1/8] powerpc/crash: Fix possible memory leak in update_crash_elfcorehdr() Jinjie Ruan
2026-07-23 13:12 ` [PATCH 2/8] powerpc/kexec_file: Fix null-ptr-def in extra size calculation Jinjie Ruan
2026-07-23 13:12 ` [PATCH 3/8] powerpc/kexec_file: Prevent kexec range truncation Jinjie Ruan
2026-07-23 13:12 ` [PATCH 4/8] kexec: Extract kexec_free_segment_cma() from kimage_free_cma() Jinjie Ruan
2026-07-23 13:12 ` [PATCH 5/8] arm64: kexec_file: Fix CMA page leaks in segment placement retry loops Jinjie Ruan
2026-07-23 13:12 ` [PATCH 6/8] arm64: kexec_file: Fix image->elf_headers memory leak during retry loop Jinjie Ruan
2026-07-23 13:12 ` [PATCH 7/8] arm64: kexec_file: Simplify load_other_segments() Jinjie Ruan
2026-07-23 13:12 ` [PATCH 8/8] arm64: crash: Add crash hotplug support Jinjie Ruan
2026-07-26 7:10 ` [PATCH 0/8] " Mike Rapoport
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.