[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWTMHgHXy9Z-cKeb@kernel.org>
Date: Mon, 12 Jan 2026 12:25:34 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Jason Miu <jasonmiu@...gle.com>
Cc: Alexander Graf <graf@...zon.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Baoquan He <bhe@...hat.com>, Changyuan Lyu <changyuanl@...gle.com>,
David Matlack <dmatlack@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Jason Gunthorpe <jgg@...dia.com>,
Pasha Tatashin <pasha.tatashin@...een.com>,
Pratyush Yadav <pratyush@...nel.org>, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v4 2/2] kho: Remove finalize state and clients
On Thu, Jan 08, 2026 at 04:11:27PM -0800, Jason Miu wrote:
> Eliminate the `kho_finalize()` function and its associated state from
> the KHO subsystem. The transition to a radix tree for memory tracking
> makes the explicit "finalize" state and its serialization step
> obsolete.
>
> Remove the `kho_finalize()` and `kho_finalized()` APIs and their stub
> implementations. Update KHO client code and the debugfs interface to
> no longer call or depend on the `kho_finalize()` mechanism.
>
> Complete the move towards a stateless KHO, simplifying the overall
> design by removing unnecessary state management.
>
> Signed-off-by: Jason Miu <jasonmiu@...gle.com>
> ---
> Documentation/admin-guide/mm/kho.rst | 52 ++++-----------------
> Documentation/core-api/kho/index.rst | 17 ++-----
> kernel/liveupdate/kexec_handover.c | 21 +--------
> kernel/liveupdate/kexec_handover_debugfs.c | 23 ---------
> kernel/liveupdate/kexec_handover_internal.h | 3 --
> kernel/liveupdate/luo_core.c | 12 +----
> kernel/liveupdate/luo_flb.c | 2 +-
> tools/testing/selftests/kho/init.c | 20 --------
> 8 files changed, 16 insertions(+), 134 deletions(-)
>
> diff --git a/Documentation/admin-guide/mm/kho.rst b/Documentation/admin-guide/mm/kho.rst
> index 6dc18ed4b886..57d5690dce77 100644
> --- a/Documentation/admin-guide/mm/kho.rst
> +++ b/Documentation/admin-guide/mm/kho.rst
> @@ -28,20 +28,10 @@ per NUMA node scratch regions on boot.
> Perform a KHO kexec
> ===================
>
> -First, before you perform a KHO kexec, you need to move the system into
> -the :ref:`KHO finalization phase <kho-finalization-phase>` ::
> -
> - $ echo 1 > /sys/kernel/debug/kho/out/finalize
> -
> -After this command, the KHO FDT is available in
> -``/sys/kernel/debug/kho/out/fdt``. Other subsystems may also register
> -their own preserved sub FDTs under
> -``/sys/kernel/debug/kho/out/sub_fdts/``.
> -
> -Next, load the target payload and kexec into it. It is important that you
> -use the ``-s`` parameter to use the in-kernel kexec file loader, as user
> -space kexec tooling currently has no support for KHO with the user space
> -based file loader ::
> +To perform a KHO kexec, load the target payload and kexec into it. It
> +is important that you use the ``-s`` parameter to use the in-kernel
> +kexec file loader, as user space kexec tooling currently has no
> +support for KHO with the user space based file loader ::
>
> # kexec -l /path/to/bzImage --initrd /path/to/initrd -s
> # kexec -e
> @@ -52,40 +42,19 @@ For example, if you used ``reserve_mem`` command line parameter to create
> an early memory reservation, the new kernel will have that memory at the
> same physical address as the old kernel.
>
> -Abort a KHO exec
> -================
> -
> -You can move the system out of KHO finalization phase again by calling ::
> -
> - $ echo 0 > /sys/kernel/debug/kho/out/active
> -
> -After this command, the KHO FDT is no longer available in
> -``/sys/kernel/debug/kho/out/fdt``.
> -
> debugfs Interfaces
> ==================
>
> +These debugfs interfaces are available when the kernel is compiled with
> +``CONFIG_KEXEC_HANDOVER_DEBUGFS`` set to y.
s/set to y/enabled/
> ``/sys/kernel/debug/kho/out/sub_fdts/``
> - In the KHO finalization phase, KHO producers register their own
> - FDT blob under this directory.
> + KHO producers can register their own FDT blob under this directory.
"own FDT or another binary blob ..."
> diff --git a/Documentation/core-api/kho/index.rst b/Documentation/core-api/kho/index.rst
> index 7ddc4d3ecac5..286a6d0b9956 100644
> --- a/Documentation/core-api/kho/index.rst
> +++ b/Documentation/core-api/kho/index.rst
> @@ -9,8 +9,9 @@ Kexec Handover Subsystem
> Overview
> ========
>
> -Kexec HandOver (KHO) is a mechanism that allows Linux to preserve memory
> -regions, which could contain serialized system states, across kexec.
> +Kexec HandOver (KHO) is a mechanism that allows Linux to preserve
> +memory regions, containing kernel data structures in their live,
> +in-memory format, across kexec.
I'm not sure about "live, in-memory format". memfd does preserve some
serialized state rather than "live memfd".
The existing phrasing is general enough and I'd leave it as is.
> diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c
> index 4c437de5c0b0..ddc9110a2b45 100644
> --- a/kernel/liveupdate/luo_flb.c
> +++ b/kernel/liveupdate/luo_flb.c
> @@ -630,7 +630,7 @@ int __init luo_flb_setup_incoming(void *fdt_in)
> * data handle, and the final reference count. This allows the new kernel to
> * find the appropriate handler and reconstruct the FLB's state.
> *
> - * Context: Called from liveupdate_reboot() just before kho_finalize().
> + * Context: Called from liveupdate_reboot() just before return.
Just
Called from liveupdate_reboot()
is enough IMO.
> */
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists