]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/efi/mixed: Remove dependency on legacy startup_32 code
authorArd Biesheuvel <ardb@kernel.org>
Tue, 7 Jan 2025 16:55:07 +0000 (17:55 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 21 Feb 2025 15:54:31 +0000 (16:54 +0100)
commit6e2da8d87c9c1133d8d6e1f93a0bc0c416dbc8ee
treec892a1ec5825bb87193ab0ae4e6b5ffac5582efc
parentd545e182a8bb37bce3c00d89ab88e33414add1c3
x86/efi/mixed: Remove dependency on legacy startup_32 code

The EFI mixed mode startup code calls into startup_32 in the legacy
decompressor with a mocked up boot_params struct, only to get it to set
up the 1:1 mapping of the lower 4 GiB of memory and switch to a GDT that
supports 64-bit mode.

In order to be able to reuse the EFI mixed mode startup code in EFI
zboot images, which do not incorporate the legacy decompressor code,
decouple it, by dealing with the GDT and IDT directly.

Doing so makes it possible to construct a GDT that is compatible with
the one the firmware uses, with one additional entry for a 64-bit mode
code segment appended. This removes the need entirely to switch between
GDTs and IDTs or data segment selector values and all of this code can
be removed.

Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/boot/compressed/efi_mixed.S
arch/x86/boot/compressed/head_64.S