]> xenbits.xensource.com Git - people/aperard/linux.git/commit
x86/decompressor: Move global symbol references to C code
authorArd Biesheuvel <ardb@kernel.org>
Mon, 7 Aug 2023 16:27:16 +0000 (18:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:45:14 +0000 (14:45 +0000)
commit5c4feadb0011983bbc4587bc61056c7b379d9969
tree5a9b09255f2aa19593f9ab8f1d481a25ec7183ef
parent463b51e90c576cd63269f8420c0a0b09152092e5
x86/decompressor: Move global symbol references to C code

commit 24388292e2d7fae79a0d4183cc91716b851299cf upstream.

It is no longer necessary to be cautious when referring to global
variables in the position independent decompressor code, now that it is
built using PIE codegen and makes an assertion in the linker script that
no GOT entries exist (which would require adjustment for the actual
runtime load address of the decompressor binary).

This means global variables can be referenced directly from C code,
instead of having to pass their runtime addresses into C routines from
asm code, which needs to happen at each call site. Do so for the code
that will be called directly from the EFI stub after a subsequent patch,
and avoid the need to duplicate this logic a third time.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230807162720.545787-20-ardb@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/boot/compressed/misc.c