The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] powerpc: initial support for Kexec HandOver (KHO)
@ 2026-08-21 10:56 Sourabh Jain
  2026-08-21 10:56 ` [RFC PATCH 1/3] kernel/liveupdate: make KEXEC_HANDOVER depend on KEXEC_FILE instead of selecting it Sourabh Jain
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sourabh Jain @ 2026-08-21 10:56 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Sourabh Jain, Aditya Gupta, Alexander Graf, Andrew Morton,
	Baoquan He, Christophe Leroy (CS GROUP), Hari Bathini,
	Madhavan Srinivasan, Mahesh Salgaonkar, Michael Ellerman,
	Mike Rapoport, Nicholas Piggin, Pasha Tatashin, Pratyush Yadav,
	Ritesh Harjani (IBM), Shivang Upadhyay, Shrikanth Hegde, kexec,
	linux-kernel

This series adds initial powerpc support for Kexec HandOver (KHO),
allowing state to be preserved across kexec on powerpc. Posting as RFC
because some of the patches are workarounds for issues I ran into, and
I'd like input on how best to address them.

Patch 1 is a small Kconfig fix needed to unblock patch 2. It won't be
needed once the ordering problem described under patch 2 is
addressed properly.

Patch 2 wires up ARCH_SUPPORTS_KEXEC_HANDOVER and adds the code to
retrieve the KHO FDT and scratch region from /chosen on boot. On
powerpc, crashkernel memory is reserved very early, from arch-specific
code, while KHO's scratch region is reserved later, from generic code
(kho_memory_init()). Crashkernel reservation always runs first, so by
the time KHO reserves its scratch region, not enough memory is left
and the reservation fails. Until scratch reservation can be moved
ahead of crashkernel reservation, this patch makes KHO and CRASH_DUMP
mutually exclusive on powerpc as a stopgap. The failure scenario and
the reasoning behind this restriction are described in the commit
message with an example.

Patch 3 excludes TRANSPARENT_HUGEPAGE and HUGETLB_PAGE from
ARCH_SUPPORTS_KEXEC_HANDOVER, since KHO's static_assert() on
SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES fails to build
when either is enabled -- pageblock_order isn't a compile-time
constant on powerpc in that configuration.

With all three patches applied, CONFIG_TEST_KEXEC_HANDOVER passes on
powerpc.

Open questions I'd appreciate feedback on:

 - How should KHO scratch reservation and powerpc's crashkernel
   reservation be ordered so both can be enabled together, given that
   scratch reservation currently happens in generic code
   (kho_memory_init())?

- Excluding THP/HUGETLB_PAGE is a workaround for the build failure.
  Looking for input on how to handle CMA_MIN_ALIGNMENT_BYTES when
  pageblock_order is non-constant.

Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: kexec@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Sourabh Jain (3):
  kernel/liveupdate: make KEXEC_HANDOVER depend on KEXEC_FILE instead of
    selecting it
  powerpc: add support for Kexec HandOver (KHO)
  powerpc/kho: exclude THP and HUGETLB_PAGE

 arch/powerpc/Kconfig               |  6 ++++++
 arch/powerpc/kernel/setup-common.c | 33 ++++++++++++++++++++++++++++++
 kernel/liveupdate/Kconfig          |  2 +-
 3 files changed, 40 insertions(+), 1 deletion(-)

-- 
2.55.0


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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 10:56 [RFC PATCH 0/3] powerpc: initial support for Kexec HandOver (KHO) Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 1/3] kernel/liveupdate: make KEXEC_HANDOVER depend on KEXEC_FILE instead of selecting it Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 2/3] powerpc: add support for Kexec HandOver (KHO) Sourabh Jain
2026-08-21 11:56   ` Pratyush Yadav
2026-08-23 15:41     ` Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 3/3] powerpc/kho: exclude THP and HUGETLB_PAGE Sourabh Jain
2026-08-21 11:34   ` Pratyush Yadav
2026-08-23 13:52     ` Sourabh Jain

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