Re: [PATCH] x86: fix oops caused by old EFI info on kexec boot
From: H. Peter Anvin
Date: Thu Dec 04 2025 - 18:19:15 EST
On 2025-12-04 13:40, James Le Cuirot wrote:
>>>
>>> It might be better to fix this in the generic EFI code, and simply
>>> wipe the EFI config table that the EFI stub created to pass the initrd
>>> info. That way, it works for all architectures, and there is no need
>>> for special x86 hacks.
>>
>> I.e.,
>>
>> --- a/drivers/firmware/efi/efi.c
>> +++ b/drivers/firmware/efi/efi.c
>> @@ -818,6 +818,7 @@
>> if (tbl) {
>> phys_initrd_start = tbl->base;
>> phys_initrd_size = tbl->size;
>> + tbl->base = tbl->size = 0;
>> early_memunmap(tbl, sizeof(*tbl));
>> }
>> }
>
> I can confirm that this fixes the problem. I had considered wiping the table,
> but I was trying to do it later, which seemed harder to do. I didn't consider
> wiping it immediately, but I now realise this data isn't needed afterwards. I
> only tested amd64, but I trust it will work for other architectures. Please go
> ahead with this.
>
Acked-by: H. Peter Anvin (Intel) <hpa@xxxxxxxxx>