]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
liveupdate: kho: move to kernel/liveupdate
authorPasha Tatashin <pasha.tatashin@soleen.com>
Sat, 1 Nov 2025 14:23:23 +0000 (10:23 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 27 Nov 2025 22:24:33 +0000 (14:24 -0800)
Move KHO to kernel/liveupdate/ in preparation of placing all Live Update
core kernel related files to the same place.

[pasha.tatashin@soleen.com: disable the menu when DEFERRED_STRUCT_PAGE_INIT]
Link: https://lkml.kernel.org/r/CA+CK2bAvh9Oa2SLfsbJ8zztpEjrgr_hr-uGgF1coy8yoibT39A@mail.gmail.com
Link: https://lkml.kernel.org/r/20251101142325.1326536-8-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Changyuan Lyu <changyuanl@google.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Simon Horman <horms@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/core-api/kho/concepts.rst
MAINTAINERS
init/Kconfig
kernel/Kconfig.kexec
kernel/Makefile
kernel/liveupdate/Kconfig [new file with mode: 0644]
kernel/liveupdate/Makefile [new file with mode: 0644]
kernel/liveupdate/kexec_handover.c [moved from kernel/kexec_handover.c with 99% similarity]
kernel/liveupdate/kexec_handover_debug.c [moved from kernel/kexec_handover_debug.c with 100% similarity]
kernel/liveupdate/kexec_handover_debugfs.c [moved from kernel/kexec_handover_debugfs.c with 100% similarity]
kernel/liveupdate/kexec_handover_internal.h [moved from kernel/kexec_handover_internal.h with 100% similarity]

index 36d5c05cfb307ed318deb7401ee5ff8dbeebc6f4..d626d1dbd67847c2496f100e05a1d2fbd3ffeb67 100644 (file)
@@ -70,5 +70,5 @@ in the FDT. That state is called the KHO finalization phase.
 
 Public API
 ==========
-.. kernel-doc:: kernel/kexec_handover.c
+.. kernel-doc:: kernel/liveupdate/kexec_handover.c
    :export:
index a8a33db191bbf2532231e4982829411ef1327282..99fccc12c1f63f4e26d4cb117b0df8ee1fb279bd 100644 (file)
@@ -13799,7 +13799,7 @@ S:      Maintained
 F:     Documentation/admin-guide/mm/kho.rst
 F:     Documentation/core-api/kho/*
 F:     include/linux/kexec_handover.h
-F:     kernel/kexec_handover*
+F:     kernel/liveupdate/kexec_handover*
 F:     lib/test_kho.c
 F:     tools/testing/selftests/kho/
 
index 56a5dec1fdfcda4067e24942554bf53dc7c9a61a..5ec572cd075d26408d88c035433611d38788a1a2 100644 (file)
@@ -2156,6 +2156,8 @@ config TRACEPOINTS
 
 source "kernel/Kconfig.kexec"
 
+source "kernel/liveupdate/Kconfig"
+
 endmenu                # General setup
 
 source "arch/Kconfig"
index cc6743137946f8ca3c7ddd890829c11662988bff..15632358bcf711cd65013b88431568a95458b397 100644 (file)
@@ -94,40 +94,6 @@ 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
-       depends on !DEFERRED_STRUCT_PAGE_INIT
-       select MEMBLOCK_KHO_SCRATCH
-       select KEXEC_FILE
-       select LIBFDT
-       select CMA
-       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.
-
-config KEXEC_HANDOVER_DEBUG
-       bool "Enable Kexec Handover debug checks"
-       depends on KEXEC_HANDOVER
-       help
-         This option enables extra sanity checks for the Kexec Handover
-         subsystem. Since, KHO performance is crucial in live update
-         scenarios and the extra code might be adding overhead it is
-         only optionally enabled.
-
-config KEXEC_HANDOVER_DEBUGFS
-       bool "kexec handover debugfs interface"
-       default KEXEC_HANDOVER
-       depends on KEXEC_HANDOVER
-       select 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.
-
 config CRASH_DUMP
        bool "kernel crash dumps"
        default ARCH_DEFAULT_CRASH_DUMP
index 2cf7909a74e56f241ea901f221aca2dc8fa2fbfa..e83669841b8cc6c17b704eb12ea31e11fc18cad8 100644 (file)
@@ -52,6 +52,7 @@ obj-y += printk/
 obj-y += irq/
 obj-y += rcu/
 obj-y += livepatch/
+obj-y += liveupdate/
 obj-y += dma/
 obj-y += entry/
 obj-y += unwind/
@@ -82,9 +83,6 @@ obj-$(CONFIG_CRASH_DUMP_KUNIT_TEST) += crash_core_test.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
 obj-$(CONFIG_KEXEC_ELF) += kexec_elf.o
-obj-$(CONFIG_KEXEC_HANDOVER) += kexec_handover.o
-obj-$(CONFIG_KEXEC_HANDOVER_DEBUG) += kexec_handover_debug.o
-obj-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) += kexec_handover_debugfs.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
 obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup/
diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig
new file mode 100644 (file)
index 0000000..eae4283
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+menu "Live Update and Kexec HandOver"
+       depends on !DEFERRED_STRUCT_PAGE_INIT
+
+config KEXEC_HANDOVER
+       bool "kexec handover"
+       depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE
+       depends on !DEFERRED_STRUCT_PAGE_INIT
+       select MEMBLOCK_KHO_SCRATCH
+       select KEXEC_FILE
+       select LIBFDT
+       select CMA
+       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.
+
+config KEXEC_HANDOVER_DEBUG
+       bool "Enable Kexec Handover debug checks"
+       depends on KEXEC_HANDOVER
+       help
+         This option enables extra sanity checks for the Kexec Handover
+         subsystem. Since, KHO performance is crucial in live update
+         scenarios and the extra code might be adding overhead it is
+         only optionally enabled.
+
+config KEXEC_HANDOVER_DEBUGFS
+       bool "kexec handover debugfs interface"
+       default KEXEC_HANDOVER
+       depends on KEXEC_HANDOVER
+       select 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.
+
+endmenu
diff --git a/kernel/liveupdate/Makefile b/kernel/liveupdate/Makefile
new file mode 100644 (file)
index 0000000..f52ce1e
--- /dev/null
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_KEXEC_HANDOVER)           += kexec_handover.o
+obj-$(CONFIG_KEXEC_HANDOVER_DEBUG)     += kexec_handover_debug.o
+obj-$(CONFIG_KEXEC_HANDOVER_DEBUGFS)   += kexec_handover_debugfs.o
similarity index 99%
rename from kernel/kexec_handover.c
rename to kernel/liveupdate/kexec_handover.c
index 0a4a058fbf0c773bc8b1eae2193e85d825a01782..52cd4dc23e2a6e3b48db578355ecde24d1f55dd1 100644 (file)
@@ -26,8 +26,8 @@
  * KHO is tightly coupled with mm init and needs access to some of mm
  * internal APIs.
  */
-#include "../mm/internal.h"
-#include "kexec_internal.h"
+#include "../../mm/internal.h"
+#include "../kexec_internal.h"
 #include "kexec_handover_internal.h"
 
 #define KHO_FDT_COMPATIBLE "kho-v1"