linux_trampoline: Handle 64-bit framebuffer addresses

To support full 64-bit addresses, there is a new field `ext_lfb_base`
since Linux 4.1. It is unclear, however, how a loader is supposed to
know if the kernel is compatible with this. Filling these previously
reserved bits doesn't hurt, but an old kernel would probably ignore
them and not know that it's handling a clipped, invalid address. So
we play safe, and only allow 64-bit addresses for kernels after the
2.15 version bump of the boot protocol.

Change-Id: Ib20184cf207f092062a91ac3e6aa819b956efd33
Signed-off-by: Nico Huber <nico.h@gmx.de>
Co-authored-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76479
Reviewed-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Nico Huber
2023-07-14 23:15:17 +02:00
committed by Martin L Roth
parent 6a50e555fc
commit 6e133fa470
3 changed files with 31 additions and 16 deletions

View File

@ -265,6 +265,10 @@ int parse_bzImage_to_payload(const struct buffer *input,
* this information for its jump to real Linux. */
params.kernel_start = kernel_base;
/* To make decisions based on the protocol version,
copy that as well. */
params.param_block_version = hdr->protocol_version;
if (bzp_add_kernel(&bzp, input, setup_size) != 0)
return -1;