kho: call kho_kexec_metadata_init() for both boot paths
Subsystems (3)
PATCH 1/1 kho: call kho_kexec_metadata_init() for both boot paths
kho_kexec_metadata_init() was placed after the fdt check, causing it to run only on the fresh boot path (no incoming FDT) and skipping metadata initialization on the KHO restore path.
The original patch[1] was based on commit 5c9e55fecf93658 ("Add linux-next specific files for 20260312"), which included commit d7176a010afce8 ("kho: fix deferred init of kho scratch"). That commit has since been rebased and reworked in linux-next, changing the code flow so that kho_kexec_metadata_init() is no longer reached on the restore path.
Fix this by moving the call before the fdt check so it runs regardless of whether an incoming FDT is present.
--- kernel/liveupdate/kexec_handover.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/liveupdate/kexec_handover.c +4 -4
@@ -1519,15 +1519,15 @@ static __init int kho_init(void)if (err) goto err_free_fdt; + err =kho_kexec_metadata_init (fdt); +if (err) + goto err_free_fdt; +if (fdt) {kho_in_debugfs_init (&kho_in.dbg, fdt);return 0 ; } - err =kho_kexec_metadata_init (fdt); -if (err) - goto err_free_fdt; -for (int i =0 ; i < kho_scratch_cnt; i++) {unsigned long base_pfn =PHYS_PFN (kho_scratch[i].addr);unsigned long count = kho_scratch[i].size >>PAGE_SHIFT ;
---
base-commit: db7efce4ae23ad5e42f5f55428f529ff62b86fab
change-id: 20260409-kho_fix_merge_issue-dab886bb4a15
Best regards,
Signature · 1 line
Breno Leitao <[email protected]>
Quoted 10 lines · Breno Leitao
kho_kexec_metadata_init()was placed after the fdt check, causing it to run only on the fresh boot path (no incoming FDT) and skipping metadata initialization on the KHO restore path.The original patch[1] was based on commit
5c9e55fecf93658("Add linux-next specific files for 20260312"), which included commitd7176a010afce8("kho: fix deferred init of kho scratch"). That commit has since been rebased and reworked in linux-next, changing the code flow so thatkho_kexec_metadata_init()is no longer reached on the restore path.
Quoted 6 lines
Fix this by moving the call before the fdt check so it runs regardless of whether an incoming FDT is present.
Fixes 047117e78331a ("kho: kexec-metadata: track previous kernel chain")Signed-off-by Breno Leitao <[email protected]>
Andrew, since the patch "kho: kexec-metadata: track previous kernel chain" is still in mm-unstable, please meld this patch into it if possible.
[...]
Signature · 2 lines
Regards, Pratyush Yadav
Quoted 10 lines · Breno Leitao
kho_kexec_metadata_init()was placed after the fdt check, causing it to run only on the fresh boot path (no incoming FDT) and skipping metadata initialization on the KHO restore path.The original patch[1] was based on commit
5c9e55fecf93658("Add linux-next specific files for 20260312"), which included commitd7176a010afce8("kho: fix deferred init of kho scratch"). That commit has since been rebased and reworked in linux-next, changing the code flow so thatkho_kexec_metadata_init()is no longer reached on the restore path.
Quoted 6 lines
Fix this by moving the call before the fdt check so it runs regardless of whether an incoming FDT is present.
Fixes 047117e78331a ("kho: kexec-metadata: track previous kernel chain")Signed-off-by Breno Leitao <[email protected]>
Quoted 3 lines
--- kernel/liveupdate/kexec_handover.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 2 lines
Sincerely yours, Mike.