[RFC PATCH 0/3] powerpc: initial support for Kexec HandOver (KHO)
Sourabh Jain <[email protected]>
| Newsgroups | gmane.linux.kernel.kexec,gmane.linux.ports.ppc64.devel,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Andrew Morton <akpm-de/[email protected]> Cc: Baoquan He <[email protected]> Cc: Christophe Leroy (CS GROUP) <[email protected]> Cc: Hari Bathini <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Mahesh Salgaonkar <[email protected]> Cc: Michael Ellerman <mpe-Gsx/[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Pasha Tatashin <[email protected]> Cc: Pratyush Yadav <[email protected]> Cc: Ritesh Harjani (IBM) <[email protected]> Cc: Shivang Upadhyay <[email protected]> Cc: Shrikanth Hegde <[email protected]> Cc: Sourabh Jain <[email protected]> Cc: [email protected] Cc: [email protected] 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