[PATCH v5 11/16] kexec: add config option for KHO
Baoquan He
bhe at redhat.com
Mon Mar 24 23:57:50 PDT 2025
On 03/24/25 at 12:18pm, Dave Young wrote:
> On Thu, 20 Mar 2025 at 23:05, Changyuan Lyu <changyuanl at google.com> wrote:
> >
> > From: Alexander Graf <graf at amazon.com>
> >
> > We have all generic code in place now to support Kexec with KHO. This
> > patch adds a config option that depends on architecture support to
> > enable KHO support.
> >
> > Signed-off-by: Alexander Graf <graf at amazon.com>
> > Co-developed-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> > Co-developed-by: Changyuan Lyu <changyuanl at google.com>
> > Signed-off-by: Changyuan Lyu <changyuanl at google.com>
> > ---
> > kernel/Kconfig.kexec | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec
> > index 4d111f871951..57db99e758a8 100644
> > --- a/kernel/Kconfig.kexec
> > +++ b/kernel/Kconfig.kexec
> > @@ -95,6 +95,21 @@ config KEXEC_JUMP
> > Jump between original kernel and kexeced kernel and invoke
> > code in physical address mode via KEXEC
> >
> > +config KEXEC_HANDOVER
> > + bool "kexec handover"
> > + depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE
> > + select MEMBLOCK_KHO_SCRATCH
> > + select KEXEC_FILE
> > + select DEBUG_FS
> > + select LIBFDT
> > + select CMA
> > + select XXHASH
> > + help
> > + Allow kexec to hand over state across kernels by generating and
> > + passing additional metadata to the target kernel. This is useful
> > + to keep data or state alive across the kexec. For this to work,
> > + both source and target kernels need to have this option enabled.
> > +
>
> Have you tested kdump? In my mind there are two issues, one is with
> CMA enabled, it could cause kdump crashkernel memory reservation
> failures more often due to the fragmented low memory. Secondly, in
kho scracth memorys are reserved much later than crashkernel, we may not
need to worry about it.
====================
start_kernel()
......
-->setup_arch(&command_line);
-->arch_reserve_crashkernel();
......
-->mm_core_init();
-->kho_memory_init();
> kdump kernel dump the crazy scratch memory in vmcore is not very
> meaningful. Otherwise I suspect this is not tested under kdump. If
> so please disable this option for kdump.
Yeah, it's not meaningful to dump out scratch memorys into vmcore. We
may need to dig them out from eflcorehdr. While it's an optimization,
kho scratch is not big relative to the entire system memory. It can be
done in later stage. My personal opinion.
More information about the linux-arm-kernel
mailing list