diff options
author | Baskov Evgeniy <baskov@ispras.ru> | 2022-03-03 17:21:19 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2022-05-03 15:31:01 +0200 |
commit | 3ba75c1316390b2bc39c19cb8f0f85922ab3f9ed (patch) | |
tree | ee6e870c0cfd2bbe66fd585d0620267e7bae3acf /drivers/firmware/efi/libstub/x86-stub.c | |
parent | aa480379d8bdb33920d68acfd90f823c8af32578 (diff) | |
download | linux-3ba75c1316390b2bc39c19cb8f0f85922ab3f9ed.tar.gz linux-3ba75c1316390b2bc39c19cb8f0f85922ab3f9ed.tar.bz2 linux-3ba75c1316390b2bc39c19cb8f0f85922ab3f9ed.zip |
efi: libstub: declare DXE services table
UEFI DXE services are not yet used in kernel code
but are required to manipulate page table memory
protection flags.
Add required declarations to use DXE services functions.
Signed-off-by: Baskov Evgeniy <baskov@ispras.ru>
Link: https://lore.kernel.org/r/20220303142120.1975-2-baskov@ispras.ru
[ardb: ignore absent DXE table but warn if the signature check fails]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/x86-stub.c')
-rw-r--r-- | drivers/firmware/efi/libstub/x86-stub.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 01ddd4502e28..cda60aba2f12 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -22,6 +22,7 @@ #define MAXMEM_X86_64_4LEVEL (1ull << 46) const efi_system_table_t *efi_system_table; +const efi_dxe_services_table_t *efi_dxe_table; extern u32 image_offset; static efi_loaded_image_t *image = NULL; @@ -677,11 +678,17 @@ unsigned long efi_main(efi_handle_t handle, efi_status_t status; efi_system_table = sys_table_arg; - /* Check if we were booted by the EFI firmware */ if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) efi_exit(handle, EFI_INVALID_PARAMETER); + efi_dxe_table = get_efi_config_table(EFI_DXE_SERVICES_TABLE_GUID); + if (efi_dxe_table && + efi_dxe_table->hdr.signature != EFI_DXE_SERVICES_TABLE_SIGNATURE) { + efi_warn("Ignoring DXE services table: invalid signature\n"); + efi_dxe_table = NULL; + } + /* * If the kernel isn't already loaded at a suitable address, * relocate it. |