]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kho: add Kconfig option to enable KHO by default
authorPasha Tatashin <pasha.tatashin@soleen.com>
Fri, 14 Nov 2025 19:00:02 +0000 (14:00 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 27 Nov 2025 22:24:37 +0000 (14:24 -0800)
Currently, Kexec Handover must be explicitly enabled via the kernel
command line parameter `kho=on`.

For workloads that rely on KHO as a foundational requirement (such as the
upcoming Live Update Orchestrator), requiring an explicit boot parameter
adds redundant configuration steps.

Introduce CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT.  When selected, KHO
defaults to enabled.  This is equivalent to passing kho=on at boot.  The
behavior can still be disabled at runtime by passing kho=off.

Link: https://lkml.kernel.org/r/20251114190002.3311679-14-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: Dave Vasilevsky <dave@vasilevsky.ca>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Kees Cook <kees@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/liveupdate/Kconfig
kernel/liveupdate/kexec_handover.c

index eae4283093323d2ebebea308282dc2ed139c84d9..a973a54447dea18051967e74b22e1b7b13ee08f2 100644 (file)
@@ -37,4 +37,18 @@ config KEXEC_HANDOVER_DEBUGFS
          Also, enables inspecting the KHO fdt trees with the debugfs binary
          blobs.
 
+config KEXEC_HANDOVER_ENABLE_DEFAULT
+       bool "Enable kexec handover by default"
+       depends on KEXEC_HANDOVER
+       help
+         Enable Kexec Handover by default. This avoids the need to
+         explicitly pass 'kho=on' on the kernel command line.
+
+         This is useful for systems where KHO is a prerequisite for other
+         features, such as Live Update, ensuring the mechanism is always
+         active.
+
+         The default behavior can still be overridden at boot time by
+         passing 'kho=off'.
+
 endmenu
index a7f876ece44510443d0009fcdd9a74fc0cefeb5f..224bdf5becb687a9ea5aeedb6b4b6facab070adb 100644 (file)
@@ -52,7 +52,7 @@ union kho_page_info {
 
 static_assert(sizeof(union kho_page_info) == sizeof(((struct page *)0)->private));
 
-static bool kho_enable __ro_after_init;
+static bool kho_enable __ro_after_init = IS_ENABLED(CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT);
 
 bool kho_is_enabled(void)
 {