]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/efistub: Merge PE and handover entrypoints
authorArd Biesheuvel <ardb@kernel.org>
Sun, 26 Jan 2025 07:46:30 +0000 (08:46 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 21 Feb 2025 15:54:05 +0000 (16:54 +0100)
commitdac628e9563640e2de7878decc03a508b1ba319a
tree914b70b037bf60a52653dd581da46cdbcdac7721
parent2014c95afecee3e76ca4a56956a936e23283f05b
x86/efistub: Merge PE and handover entrypoints

The difference between the PE and handover entrypoints in the EFI stub
is that the former allocates a struct boot_params whereas the latter
expects one from the caller. Currently, these are two completely
separate entrypoints, duplicating some logic and both relying of
efi_exit() to return straight back to the firmware on an error.

Simplify this by making the PE entrypoint call the handover entrypoint
with NULL as the argument for the struct boot_params parameter. This
makes the code easier to follow, and removes the need to support two
different calling conventions in the mixed mode asm code.

While at it, move the assignment of boot_params_ptr into the function
that actually calls into the legacy decompressor, which is where its
value is required.

Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/boot/compressed/efi_mixed.S
drivers/firmware/efi/libstub/x86-stub.c