efi/libstub: Drop __pure getter for efi_system_table
authorArd Biesheuvel <ardb@kernel.org>
Thu, 16 Apr 2020 16:38:06 +0000 (18:38 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 24 Apr 2020 12:52:16 +0000 (14:52 +0200)
commitccc27ae77494252965aedca68588e7457829cfad
treee289300246a3b635e85a0f81aae340d1c6ca6fc2
parent544393707f3ca4f185ea1e41cc3206d1526c99cf
efi/libstub: Drop __pure getter for efi_system_table

The practice of using __pure getter functions to access global
variables in the EFI stub dates back to the time when we had to
carefully prevent GOT entries from being emitted, because we
could not rely on the toolchain to do this for us.

Today, we use the hidden visibility pragma for all EFI stub source
files, which now all live in the same subdirectory, and we apply a
sanity check on the objects, so we can get rid of these getter
functions and simply refer to global data objects directly.

Start with efi_system_table(), and convert it into a global variable.
While at it, make it a pointer-to-const, because we can.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/include/asm/efi.h
drivers/firmware/efi/libstub/efi-stub-helper.c
drivers/firmware/efi/libstub/efi-stub.c
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/fdt.c
drivers/firmware/efi/libstub/x86-stub.c