[PATCH v6 1/8] efi: Pass KHO state to the next kernel in a configuration table
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 29 10:47:11 PDT 2026
> From: George Guo <guodongtai at kylinos.cn>
>
> KHO has to give the next kernel two addresses: the KHO FDT and the
> bootmem area list. arm64 and riscv put them under /chosen in the boot
> FDT. LoongArch systems booting with EFI and ACPI do not require a boot
> FDT, so KHO needs another way to pass this information.
>
> Add a Linux EFI configuration table for them, under
> LINUX_EFI_KEXEC_HANDOVER_GUID. It points to a struct linux_efi_kho_data.
>
> - On a cold boot, the LoongArch EFI stub installs the table, zeroed.
> Each kexec'd kernel is given the same EFI system table, so it finds
> the same table.
>
> - In early boot, efi_config_parse_tables() reserves the table so
> neither the page allocator nor kexec segments use it, and calls
> kho_populate() if the table holds KHO state.
>
> - Provide efi_kho_update() to update the table before kexec. Map the
> table during boot so updates do not require allocation or mapping
> at panic time.
>
> - efi_kho_table_found() tells architecture code whether the table was
> found at boot, so it can turn KHO off when the table is missing.
>
> Only the LoongArch stub installs the table, and only with
> CONFIG_KEXEC_HANDOVER. Elsewhere there is no table and this code does
> nothing.
>
> Signed-off-by: George Guo <guodongtai at kylinos.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029172956.20791-1-dongtai.guo@linux.dev?part=1
More information about the kexec
mailing list