[RFC PATCH 0/3] powerpc: initial support for Kexec HandOver (KHO)

Sourabh Jain sourabhjain at linux.ibm.com
Fri Aug 21 03:56:06 PDT 2026


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




More information about the kexec mailing list