[PATCH v1 0/2] powerpc: enable Kexec HandOver (KHO)
Sourabh Jain
sourabhjain at linux.ibm.com
Mon Sep 28 01:32:24 PDT 2026
The first patch fixes the KHO scratch alignment check by moving it from
a compile-time static assertion to a runtime check. On powerpc,
CMA_MIN_ALIGNMENT_BYTES can depend on pageblock_order and it may not be a
compile-time constant with some configurations. The runtime check
allows KHO to be enabled for these configurations and disables KHO if
the required scratch alignment is not met.
The second patch enables KHO support for powerpc and adds the call to
early_init_dt_check_kho() from the powerpc architecture setup path,
where KHO information needs to be checked early during boot.
early_init_dt_check_kho() is also made public so that the powerpc code
can make use of it.
There is a generic issue with KHO scratch sizing when other memory
reservations, such as crashkernel, are made before the KHO scratch
reservation. Such reservations can be included when calculating the
scratch size and may cause the KHO scratch reservation to fail. This
will be addressed separately in a follow-up patch. To know more on
this [1]
Testing:
========
This series was tested in the following two environments with
CONFIG_TEST_KEXEC_HANDOVER enabled and the kho_test kernel module:
- pSeries LPAR
- pSeries guest running on PowerNV
- pSeries guest running on Pseries LPAR
The KHO test module successfully verified KHO state restoration:
> dmesg | grep -i kho
Linux version 7.3.0-rc4kho-ppc-upstream+ (root at ltcrain85-lp7.ltc.tadn.ibm.com) (gcc (GCC) 15.3.1 20260722 (Red Hat 15.3.1-1), GNU ld version 2.45.1-5.fc43) #2 SMP PREEMPT_DYNAMIC
KHO: found kexec handover data.
Kernel command line: BOOT_IMAGE=(ieee1275//vdevice/v-scsi at 3000006b/disk at 8100000000000000,gpt2)/vmlinuz-7.3.0-rc4kho-ppc-upstream+ root=/dev/mapper/fedora_root ro rd.lvm.lv=fedora
KHO: exec from: 7.3.0-rc4kho-ppc-upstream+ (count 5)
test_kho: KHO restore succeeded
Changelog:
==========
RFC: https://lore.kernel.org/all/20260821105609.983622-1-sourabhjain@linux.ibm.com/ [1]
v1:
- Drop the first patch from the RFC series, which added KEXEC_FILE as a
dependency of KEXEC_HANDOVER, and use select instead.
- Replace the SCRATCH_ALIGNMENT_BYTES static assertion with a runtime
check to fix the build failure on powerpc configurations where
CMA_MIN_ALIGNMENT_BYTES is not a compile-time constant.
- Remove the CRASH_DUMP dependency from ARCH_SUPPORTS_KEXEC_HANDOVER.
- Reuse the existing early_init_dt_check_kho() function to process the
KHO FDT properties.
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: linux-kernel at vger.kernel.org
Cc: linuxppc-dev at lists.ozlabs.org
Sourabh Jain (2):
kho: check scratch vs CMA alignment at runtime
powerpc: add support for Kexec HandOver (KHO)
arch/powerpc/Kconfig | 3 +++
arch/powerpc/kernel/setup-common.c | 2 ++
drivers/of/fdt.c | 2 +-
include/linux/of_fdt.h | 1 +
kernel/liveupdate/kexec_handover.c | 23 +++++++++++++++--------
5 files changed, 22 insertions(+), 9 deletions(-)
--
2.55.0
More information about the kexec
mailing list