Skip to content

Commit 7bd3643

Browse files
soleenakpm00
authored andcommitted
kho: add Kconfig option to enable KHO by default
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>
1 parent de51999 commit 7bd3643

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

kernel/liveupdate/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,18 @@ config KEXEC_HANDOVER_DEBUGFS
3737
Also, enables inspecting the KHO fdt trees with the debugfs binary
3838
blobs.
3939

40+
config KEXEC_HANDOVER_ENABLE_DEFAULT
41+
bool "Enable kexec handover by default"
42+
depends on KEXEC_HANDOVER
43+
help
44+
Enable Kexec Handover by default. This avoids the need to
45+
explicitly pass 'kho=on' on the kernel command line.
46+
47+
This is useful for systems where KHO is a prerequisite for other
48+
features, such as Live Update, ensuring the mechanism is always
49+
active.
50+
51+
The default behavior can still be overridden at boot time by
52+
passing 'kho=off'.
53+
4054
endmenu

kernel/liveupdate/kexec_handover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ union kho_page_info {
5252

5353
static_assert(sizeof(union kho_page_info) == sizeof(((struct page *)0)->private));
5454

55-
static bool kho_enable __ro_after_init;
55+
static bool kho_enable __ro_after_init = IS_ENABLED(CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT);
5656

5757
bool kho_is_enabled(void)
5858
{

0 commit comments

Comments
 (0)