Re: [PATCH v4 02/30] kho: make debugfs interface optional

From: Pasha Tatashin

Date: Mon Oct 06 2025 - 14:03:31 EST


On Mon, Oct 6, 2025 at 12:31 PM Pratyush Yadav <pratyush@xxxxxxxxxx> wrote:
>
> On Mon, Sep 29 2025, Pasha Tatashin wrote:
>
> > Currently, KHO is controlled via debugfs interface, but once LUO is
> > introduced, it can control KHO, and the debug interface becomes
> > optional.
> >
> > Add a separate config CONFIG_KEXEC_HANDOVER_DEBUG that enables
> > the debugfs interface, and allows to inspect the tree.
> >
> > Move all debugfs related code to a new file to keep the .c files
> > clear of ifdefs.
> >
> > Co-developed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> > ---
> > MAINTAINERS | 3 +-
> > kernel/Kconfig.kexec | 10 ++
> > kernel/Makefile | 1 +
> > kernel/kexec_handover.c | 255 +++++--------------------------
> > kernel/kexec_handover_debug.c | 218 ++++++++++++++++++++++++++
> > kernel/kexec_handover_internal.h | 44 ++++++
> > 6 files changed, 311 insertions(+), 220 deletions(-)
> > create mode 100644 kernel/kexec_handover_debug.c
> > create mode 100644 kernel/kexec_handover_internal.h
> >
> [...]
> > --- a/kernel/Kconfig.kexec
> > +++ b/kernel/Kconfig.kexec
> > @@ -109,6 +109,16 @@ config KEXEC_HANDOVER
> > to keep data or state alive across the kexec. For this to work,
> > both source and target kernels need to have this option enabled.
> >
> > +config KEXEC_HANDOVER_DEBUG
>
> Nit: can we call it KEXEC_HANDOVER_DEBUGFS instead? I think we would
> like to add a KEXEC_HANDOVER_DEBUG at some point to control debug
> asserts for KHO, and the naming would get confusing. And renaming config
> symbols is kind of a pain.

Done.

>
> > + bool "kexec handover debug interface"
> > + depends on KEXEC_HANDOVER
> > + depends on DEBUG_FS
> > + help
> > + Allow to control kexec handover device tree via debugfs
> > + interface, i.e. finalize the state or aborting the finalization.
> > + Also, enables inspecting the KHO fdt trees with the debugfs binary
> > + blobs.
> > +
> [...]
>
> --
> Regards,
> Pratyush Yadav