[RFC PATCH 2/7] liveupdate: parse the incoming handover tree before late_time_init()

Ankit Soni Ankit.Soni at amd.com
Sun Oct 4 23:40:12 PDT 2026


LUO parses the handover tree from an early_initcall, which runs inside
rest_init() -- the last statement of start_kernel(). Anything earlier in
start_kernel() cannot see the incoming state, and cannot tell that it
cannot see it: luo_flb_retrieve_one() returns -ENODATA both before the
parse and when the previous kernel handed nothing over.

On x86 the IOMMU is such a consumer, because it is also the interrupt
remapping provider. amd_iommu_prepare() runs from late_time_init() via
enable_IR_x2apic() -> irq_remapping_prepare(), and reaches
init_iommu_one_late() long before any initcall.

Fix the ordering rather than teaching each consumer to cope. Call the
parse directly from start_kernel(), immediately before late_time_init().
Rename it to liveupdate_init_early() at the same time, since
liveupdate_early_init() was named after the early_initcall that no longer
exists.

Signed-off-by: Ankit Soni <Ankit.Soni at amd.com>
---
 include/linux/liveupdate.h   | 4 ++++
 init/main.c                  | 2 ++
 kernel/liveupdate/luo_core.c | 5 +----
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h
index 6051abc0612c..07dbe8366f76 100644
--- a/include/linux/liveupdate.h
+++ b/include/linux/liveupdate.h
@@ -229,6 +229,8 @@ struct liveupdate_flb {
 
 #ifdef CONFIG_LIVEUPDATE
 
+void liveupdate_init_early(void);
+
 /* Return true if live update orchestrator is enabled */
 bool liveupdate_enabled(void);
 
@@ -259,6 +261,8 @@ int liveupdate_get_token_outgoing(struct liveupdate_session *s,
 
 #else /* CONFIG_LIVEUPDATE */
 
+static inline void liveupdate_init_early(void) { }
+
 static inline bool liveupdate_enabled(void)
 {
 	return false;
diff --git a/init/main.c b/init/main.c
index 2613d3f9b3ce..221c22489c04 100644
--- a/init/main.c
+++ b/init/main.c
@@ -108,6 +108,7 @@
 #include <linux/time_namespace.h>
 #include <linux/unaligned.h>
 #include <linux/vdso_datastore.h>
+#include <linux/liveupdate.h>
 #include <net/net_namespace.h>
 
 #include <asm/io.h>
@@ -1145,6 +1146,7 @@ void start_kernel(void)
 	setup_per_cpu_pageset();
 	numa_policy_init();
 	acpi_early_init();
+	liveupdate_init_early();
 	if (late_time_init)
 		late_time_init();
 	sched_clock_init();
diff --git a/kernel/liveupdate/luo_core.c b/kernel/liveupdate/luo_core.c
index 91703715e993..54771d67d922 100644
--- a/kernel/liveupdate/luo_core.c
+++ b/kernel/liveupdate/luo_core.c
@@ -135,7 +135,7 @@ static int __init luo_early_startup(void)
 	return err;
 }
 
-static int __init liveupdate_early_init(void)
+void __init liveupdate_init_early(void)
 {
 	int err;
 
@@ -145,10 +145,7 @@ static int __init liveupdate_early_init(void)
 		luo_restore_fail("The incoming tree failed to initialize properly [%pe], disabling live update\n",
 				 ERR_PTR(err));
 	}
-
-	return err;
 }
-early_initcall(liveupdate_early_init);
 
 /* Called during boot to create outgoing LUO state */
 static int __init luo_state_setup(void)
-- 
2.43.0




More information about the kexec mailing list