From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>,
Hari Bathini <hbathini@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10.y 1/2] powerpc/kexec: move *_memory_ranges functions to ranges.c
Date: Thu, 10 Sep 2026 22:30:47 -0400 [thread overview]
Message-ID: <20260911023048.75314-1-sashal@kernel.org> (raw)
In-Reply-To: <2026090926-voltage-around-ae2b@gregkh>
From: Sourabh Jain <sourabhjain@linux.ibm.com>
[ Upstream commit f5f0da5a7b18fab383bac92044fd8f4f288c9d38 ]
Move the following functions form kexec/{file_load_64.c => ranges.c} and
make them public so that components other than KEXEC_FILE can also use
these functions.
1. get_exclude_memory_ranges
2. get_reserved_memory_ranges
3. get_crash_memory_ranges
4. get_usable_memory_ranges
Later in the series get_crash_memory_ranges function is utilized for
in-kernel updates to kdump image during CPU/Memory hotplug or
online/offline events for both kexec_load and kexec_file_load syscalls.
Since the above functions are moved to ranges.c, some of the helper
functions in ranges.c are no longer required to be public. Mark them as
static and removed them from kexec_ranges.h header file.
Finally, remove the CONFIG_KEXEC_FILE build dependency for range.c
because it is required for other config, such as CONFIG_CRASH_DUMP.
No functional changes are intended.
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240326055413.186534-4-sourabhjain@linux.ibm.com
[Stable dependency adaptation for fa40f9dbdd4af53e7445d9135b5b207eb8adf372:
Keep only the linux/memblock.h and linux/crash_core.h include additions in
ranges.c. The target inserts linux/minmax.h between these headers; without
them its header hunk conflicts, while its range-merging fix already merges
cleanly with the stable implementation.
Drop the helper moves, visibility changes, and build-rule changes. This
stable tree predates the KEXEC_FILE/CRASH_DUMP split and keeps crash_mem
under CONFIG_KEXEC_FILE, so importing the broader refactor is unnecessary
for this fix. Retain the existing functions and configuration dependencies.
No functions or runtime behavior are added by this dependency.]
[ sashal: Reduced backport -- upstream f5f0da5a7b18f touches 4 file(s), this
backport carries 1. Not backported here:
arch/powerpc/include/asm/kexec_ranges.h
arch/powerpc/kexec/file_load_64.c
arch/powerpc/kexec/Makefile
This note is generated from the file lists only; see the resolution record
for the reasoning. ]
Stable-dep-of: fa40f9dbdd4a ("powerpc/kexec_file: Prevent kexec range truncation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/kexec/ranges.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kexec/ranges.c b/arch/powerpc/kexec/ranges.c
index 6b81c852feaba..4a3ac17263c8c 100644
--- a/arch/powerpc/kexec/ranges.c
+++ b/arch/powerpc/kexec/ranges.c
@@ -20,6 +20,8 @@
#include <linux/kexec.h>
#include <linux/of_device.h>
#include <linux/slab.h>
+#include <linux/memblock.h>
+#include <linux/crash_core.h>
#include <asm/sections.h>
#include <asm/kexec_ranges.h>
--
2.53.0
next prev parent reply other threads:[~2026-09-11 2:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:52 FAILED: patch "[PATCH] powerpc/kexec_file: Prevent kexec range truncation" failed to apply to 5.10-stable tree gregkh
2026-09-11 2:30 ` Sasha Levin [this message]
2026-09-11 2:30 ` [PATCH 5.10.y 2/2] powerpc/kexec_file: Prevent kexec range truncation Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260911023048.75314-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=hbathini@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=sourabhjain@linux.ibm.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox