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

Mike Rapoport rppt at kernel.org
Thu Oct 8 00:59:40 PDT 2026


Hi,

On Mon, Oct 05, 2026 at 06:40:12AM +0000, Ankit Soni wrote:
> 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().

Why do you suggest to call it exactly here?
Order of the calls in start_kernel() is quite sensitive and placing a call
in a certain place needs more elaborate explanation.

> Rename it to liveupdate_init_early() at the same time, since
> liveupdate_early_init() was named after the early_initcall that no longer
> exists.

No strong feeling about this, but we do have other _early_init() functions
unrelated to initcalls.
 
> 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(-)

-- 
Sincerely yours,
Mike.



More information about the kexec mailing list