Move KHO to kernel/liveupdate/ in preparation of placing all Live Update
core kernel related files to the same place.

Signed-off-by: Pasha Tatashin <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Mike Rapoport (Microsoft) <[email protected]>
---
 Documentation/core-api/kho/concepts.rst       |  2 +-
 MAINTAINERS                                   |  2 +-
 init/Kconfig                                  |  2 +
 kernel/Kconfig.kexec                          | 34 ----------------
 kernel/Makefile                               |  4 +-
 kernel/liveupdate/Kconfig                     | 39 +++++++++++++++++++
 kernel/liveupdate/Makefile                    |  5 +++
 kernel/{ => liveupdate}/kexec_handover.c      |  4 +-
 .../{ => liveupdate}/kexec_handover_debug.c   |  0
 .../{ => liveupdate}/kexec_handover_debugfs.c |  0
 .../kexec_handover_internal.h                 |  0
 11 files changed, 51 insertions(+), 41 deletions(-)
 create mode 100644 kernel/liveupdate/Kconfig
 create mode 100644 kernel/liveupdate/Makefile
 rename kernel/{ => liveupdate}/kexec_handover.c (99%)
 rename kernel/{ => liveupdate}/kexec_handover_debug.c (100%)
 rename kernel/{ => liveupdate}/kexec_handover_debugfs.c (100%)
 rename kernel/{ => liveupdate}/kexec_handover_internal.h (100%)

diff --git a/Documentation/core-api/kho/concepts.rst 
b/Documentation/core-api/kho/concepts.rst
index 36d5c05cfb30..d626d1dbd678 100644
--- a/Documentation/core-api/kho/concepts.rst
+++ b/Documentation/core-api/kho/concepts.rst
@@ -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:
diff --git a/MAINTAINERS b/MAINTAINERS
index bdd0a1260421..764df916fae7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13795,7 +13795,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:     tools/testing/selftests/kho/
 
 KEYS-ENCRYPTED
diff --git a/init/Kconfig b/init/Kconfig
index cab3ad28ca49..0605de5d96c0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2138,6 +2138,8 @@ config TRACEPOINTS
 
 source "kernel/Kconfig.kexec"
 
+source "kernel/liveupdate/Kconfig"
+
 endmenu                # General setup
 
 source "arch/Kconfig"
diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec
index cc6743137946..15632358bcf7 100644
--- a/kernel/Kconfig.kexec
+++ b/kernel/Kconfig.kexec
@@ -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
diff --git a/kernel/Makefile b/kernel/Makefile
index 2cf7909a74e5..e83669841b8c 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -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
index 000000000000..1379a4c40b09
--- /dev/null
+++ b/kernel/liveupdate/Kconfig
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+menu "Live Update and Kexec HandOver"
+
+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
index 000000000000..f52ce1ebcf86
--- /dev/null
+++ b/kernel/liveupdate/Makefile
@@ -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
diff --git a/kernel/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
similarity index 99%
rename from kernel/kexec_handover.c
rename to kernel/liveupdate/kexec_handover.c
index 3adf86c7c2db..be945c133a2f 100644
--- a/kernel/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -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"
diff --git a/kernel/kexec_handover_debug.c 
b/kernel/liveupdate/kexec_handover_debug.c
similarity index 100%
rename from kernel/kexec_handover_debug.c
rename to kernel/liveupdate/kexec_handover_debug.c
diff --git a/kernel/kexec_handover_debugfs.c 
b/kernel/liveupdate/kexec_handover_debugfs.c
similarity index 100%
rename from kernel/kexec_handover_debugfs.c
rename to kernel/liveupdate/kexec_handover_debugfs.c
diff --git a/kernel/kexec_handover_internal.h 
b/kernel/liveupdate/kexec_handover_internal.h
similarity index 100%
rename from kernel/kexec_handover_internal.h
rename to kernel/liveupdate/kexec_handover_internal.h
-- 
2.51.1.930.gacf6e81ea2-goog


Reply via email to