There are three different ways the x86 kernel can call into EFI firmware at runtime, (native 64 bit, native 32 bit or mixed mode), and for each of them, we have a special wrapper routine written in assembler that deals with the peculiarities of ABI translation, 1:1 mapping of memory etc. The 64-bit version can be simplified, by getting rid of the FP register preserve/restore, which is redundant in most cases. The 32-bit version is only used to call the SetVirtualAddressMap EFI service, so with that taken into account, we can simplify it a lot as well. The mixed mode version can be simplified too, by using the stack instead of global variables to store context while the EFI call is in progress. Cc: Andy Lutomirski <luto@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Ard Biesheuvel (3): efi/x86: simplify 64-bit EFI firmware call wrapper efi/x86: simplify i386 efi_call_phys() firmware call wrapper efi/x86: simplify mixed mode call wrapper arch/x86/include/asm/efi.h | 3 +- arch/x86/platform/efi/efi_64.c | 4 + arch/x86/platform/efi/efi_stub_32.S | 106 +++----------------- arch/x86/platform/efi/efi_stub_64.S | 36 +------ arch/x86/platform/efi/efi_thunk_64.S | 106 ++++++-------------- arch/x86/platform/uv/bios_uv.c | 7 +- 6 files changed, 58 insertions(+), 204 deletions(-) -- 2.17.1