From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D13E83B0AE2 for ; Fri, 11 Sep 2026 02:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789093852; cv=none; b=iUUTLaRUPD5CDwTVUpMTq2AOArqIOzg764oQjufeeRdEzsyRcyolFHFR3aCjEaQwmg1q8KerZAlkUcni5ju/OkSwZuUwYnSMi1HOmLgftzDaxM5K/dVko0evIqpfWcopEBdLsBqLtcEGO4BFENyEUoO4OHVepWOxJd1hbuumLDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789093852; c=relaxed/simple; bh=D855O1T2sLT64KN98vTApZW0xL9D2MGJchhQp84M3Ck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QCQE/t/1/8OUq0m/ho/W7t/Da3IpzDO/O0DYFp703JZch83iFw7uJRYJO/9OYkQUPc+a3Hf24FH9XXzRs67FciQvUpA9Qn+JjGpcw6e1EBr5V8XfXjk03uOXLFU6VX+gGIqnm1taYkER/trsYobX/IZKUExFcmH45pwg/T0lTXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YpRRSYPq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YpRRSYPq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E52A31F000FF; Fri, 11 Sep 2026 02:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789093850; bh=Ayikjz/wVXdq3L5cv1iLEAPVLAROFvRbgqL1TKFD18s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YpRRSYPq+DF8Qw2t7g2W1Bdw9Vke3giA9pDrhI2spZlR/I62vfcrociLiGgRX43Pv xROOZ3k4rRrO6aY865fnNvJYSzFHYR+iMzJVi+r13tnyEgVsZR+KlSzaMzFPiWC8+n FNas+cg1t6OXKR0dLrq5nnJMdcIPCH9klDx59yKJzLAWuOCwXnJLpOdfZvU/tDWWck PYkNZPprMtJIB4x+/yaCJHu1KKwV3cVaJGW+HHoVJ5SanKikDhKsl9GxXeL/zOKp7l e3ua9yprkjz9JsGR/QhPsgyDc3zW1S85mTi7lh+aOGXZG9uCw+Wt2eITgIiG0P5xkZ Z9BaEUngktJBQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Sourabh Jain , Hari Bathini , Michael Ellerman , Sasha Levin 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 Message-ID: <20260911023048.75314-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026090926-voltage-around-ae2b@gregkh> References: <2026090926-voltage-around-ae2b@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sourabh Jain [ 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 Acked-by: Hari Bathini Signed-off-by: Michael Ellerman 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 --- 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 #include #include +#include +#include #include #include -- 2.53.0