From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0886E2C21F0 for ; Mon, 12 Jan 2026 10:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768213542; cv=none; b=fp7sBpXVX4NnSvw8+rj6NjW4X7Px2xz2WBd7OLRLTw0VgFkfHUQDaw1V9r8zKi8kNB3WpZVfGUnXJX/yid7E/M6QO6VpIJr+EAJbfmtnlVvBr2CF1lCxhTs0NwGkQVe6NgQXzvie9kIZO8Jel+trtauSn+TasHWl74U+YNRXGqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768213542; c=relaxed/simple; bh=iZB8w08zTJZOeuhUYutrmZtQ2wK2v16pDgwJWhcGpSU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N1N21Qf5GBThARh4PRqkqEHCmcFiDDmLYpUa4yPbDZO7lcu2BL9txB8BU3UyBsEgcJrG0Pll7vZXR3Z2462dLOTpSOjGmlrSyYLXxVKBwDE+cAzOaBe8lpm67q9KlV8o9XD4W4P5HM+HQw/LmUa0eMsbhHz6bx1Y6RxNVRpOfps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TB3TSWJy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TB3TSWJy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8994C19422; Mon, 12 Jan 2026 10:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768213541; bh=iZB8w08zTJZOeuhUYutrmZtQ2wK2v16pDgwJWhcGpSU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TB3TSWJyHUhoynAjWb06w7GIhKYoQDVMDrLeaOT0MyjqtCXWmRvgze14tZD7P/Aij oT7udaN4OUG/CI8sVA29DGFSF/v5h1VFOat9mN011g6JpkGPfSW50Kn/IqmKuckQGg L4w6njj6XBbg9UFgkKL1gks7m4swycKWV21aYcdp2FPiTRJFv6a5g7hOrV9zU6Fytr f6IqfCwKyzJ9fTSddo3Qk3g5INIYOh8v1UxrdwcElcfPv0PObPyj/klddRE3z7yxxH nH1xlOn92G7FHq3eDu2acNAfKG49EI7MwWD0/ritUdvPLFui90LZUCPn9VPt1441t9 3/2xOo4VMXz1w== Date: Mon, 12 Jan 2026 12:25:34 +0200 From: Mike Rapoport To: Jason Miu Cc: Alexander Graf , Andrew Morton , Baoquan He , Changyuan Lyu , David Matlack , David Rientjes , Jason Gunthorpe , Pasha Tatashin , Pratyush Yadav , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v4 2/2] kho: Remove finalize state and clients Message-ID: References: <20260109001127.2596222-1-jasonmiu@google.com> <20260109001127.2596222-3-jasonmiu@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260109001127.2596222-3-jasonmiu@google.com> 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 > --- > 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 ` :: > - > - $ 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.