[PATCH 4/5] efi/arm64: Expose struct efi_image_info via the image header
Ard Biesheuvel
ardb at kernel.org
Fri Nov 6 07:51:09 PST 2026
On Fri, 6 Nov 2026, at 15:34, Jason Gunthorpe wrote:
> On Fri, Nov 06, 2026 at 03:19:41PM +0100, Ard Biesheuvel wrote:
>> From: Ard Biesheuvel <ardb at kernel.org>
>>
>> The zboot compressed kernel and the uncompressed Image both contain a
>> copy of the EFI stub, and both are tightly coupled to the kernel image.
>>
>> However, the zboot stub is not linked into vmlinux like the ordinary EFI
>> stub is, and so it does not have direct access to its symbols. This is
>> needed today for things like image size and code size, but there are
>> more cases coming (DRTM) where both stubs need to have a consistent view
>> of these things.
>>
>> So add a struct efi_image_info that is built into vmlinux and exposed
>> via the image header, so that zboot can access it easily.
>
> I tried hard to avoid doing this because I didn't want to make the
> struct layout ABI. I really see only negatives to that.
>
> Putting it here and documenting it in the rst is going to encourage
> other bootloaders to look inside it and try to read the contents. :(
>
Fair point.
> The linker trick to inject the offset into zboot seemed better because
> it completely prevents it from being ABI as nothing but the EFI stubs
> can ever locate it.
>
> Also, I wanted it to eventually be cross arch and I don't know if
> other arches have any spare space like this.
>
Yeah so let's bring back the code injection hack but only for the
offset of image info.
What I would still like to avoid (compared to your proposal) are:
- having the efi_image_info pointer be a global that can be grabbed
from anywhere, even though in zboot, it only becomes valid after
the decompression has been performed;
- putting every shared variable in the linker script.
Please confirm whether those aspects look ok to you, and I'll respin
this quickly.
More information about the linux-arm-kernel
mailing list