Re: [PATCH v6 1/8] efi: Pass KHO state to the next kernel in a configuration table

From: Ard Biesheuvel

Date: Fri Nov 27 2026 - 10:45:22 EST




On Thu, 19 Nov 2026, at 09:22, George Guo wrote:
> Hi Huacai, Ard, Pratyush,
>
> On Wed, Nov 04 2026, Huacai Chen wrote:
>> I prefer to keep it in LoongArch until a second architecture, and I
>> think Ard is the same. But this is not a strong objection to Pratyush.
>
> Kexin Liu and I have tried x86 as the second user, to see whether the
> common table holds up. It needed only small changes:
>
> - The x86 EFI stub installs the table, as the LoongArch stub does.
> install_kho_table() moves from efi-stub.c to efi-stub-helper.c so
> that the x86 stub can call it.
>
> - kexec_file_load() skips the SETUP_KEXEC_KHO record when the table
> exists and the next kernel will get efi_info. Otherwise, for example
> on a legacy BIOS boot or with noefi, it falls back to setup_data.
>
> - When there is no SETUP_KEXEC_KHO record, the decompressor's KASLR
> code looks up the KHO bootmem areas in the table, so the kernel is
> not decompressed onto preserved memory.
>
> The table layout did not change. The only change to the common code is
> that efi_kho_table_found() is no longer __init, since x86 calls it at
> kexec load time.
>
> Tested in QEMU on x86_64. With OVMF, the KHO vmtest and
> luo_kexec_simple pass, and the second kernel finds the KHO state
> through the table. With SeaBIOS, the KHO vmtest passes through
> setup_data.
>
> So I would like to keep the table common in v7.

Fair enough.

> Would you prefer the
> x86 patches in the same series, so that the generic code comes with a
> second user, or as a separate series on top?
>

I'd like to see both tbh, but only if it is not too much of a hassle.