v6 2026-10-30

LoongArch 增加 KHO 支持与自测 · v6

v6 系列用 EFI 配置表向下一内核传递 KHO 状态,新增 kho_disable,并启用 LoongArch KHO 与 vmtest。

原始补丁链接

子 Patch(8)

1/8
efi: Pass KHO state to the next kernel in a configuration table
[Re: [PATCH v6 1/8] efi: Pass KHO state to the next kernel in a configuration table] On Thu, 29 Oct 2026, at 18:29, George Guo wrote: > From: George Guo guodongtai@kylinos.cn > > KHO has to give the
2/8
kho: Write KHO state to the EFI table at kexec time
在 kernel_kexec()/__crash_kexec() 按即将运行镜像更新共享 EFI 表:有 KHO 状态则填充,否则清零;兼容 crash 与 kexec_load,并清除继承的无效表。
3/8
kho: Include linux/mm.h in kho_block.c
kho_block.c 的 virt_to_phys()/phys_to_virt() 在 LoongArch+KFENCE 下依赖 offset_in_page()/page_address(),显式包含 linux/mm.h 可避免隐式声明编译错误。
4/8
kho: Add kho_disable()
新增 kho_disable() 供架构在缺少 EFI 配置表时关闭 KHO;kexec 不经过 EFI stub,无法自行建表,避免后续 kexec 传出无效 KHO 状态。
5/8
LoongArch: Allow memblock arrays to resize
为 LoongArch 启用 memblock 数组扩容:kexec 后 kho_memory_init() 保留大量离散区间会撑爆 reserved 数组并 panic,需允许从空闲内存扩表。
6/8
LoongArch: Enable kexec handover (KHO)
在 64 位 LoongArch+EFI_STUB 上启用 ARCH_SUPPORTS_KEXEC_HANDOVER;KHO 状态经 stub 安装的 EFI 配置表传递,启动缺表即调用 kho_disable() 关闭。
7/8
selftests/kho: Add LoongArch vmtest support
LoongArch KHO vmtest 经 QEMU_EFI 启动 vmlinux.efi 让 stub 安装表,启用 PCI host、ACPI_SPCR_TABLE 与 SPARSEMEM_MANUAL,解决 earlycon 和延迟页初始化依赖。
8/8
selftests/liveupdate: Add LoongArch vmtest support
为 liveupdate vmtest 增加 LoongArch 配置、目标与交叉编译器检测,并纳入测试套件;经 EFI 固件启动 vmlinux.efi 安装 KHO 表,QEMU_EFI 不可用时跳过。