linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] efi/x86: clean up and simplify runtime call wrappers
@ 2019-12-26 15:14 Ard Biesheuvel
  2019-12-26 15:14 ` [PATCH 1/3] efi/x86: simplify 64-bit EFI firmware call wrapper Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Ard Biesheuvel @ 2019-12-26 15:14 UTC (permalink / raw)
  To: linux-efi
  Cc: nivedita, hdegoede, Ard Biesheuvel, Andy Lutomirski, Ingo Molnar

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@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>

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


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-12-28  9:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-26 15:14 [PATCH 0/3] efi/x86: clean up and simplify runtime call wrappers Ard Biesheuvel
2019-12-26 15:14 ` [PATCH 1/3] efi/x86: simplify 64-bit EFI firmware call wrapper Ard Biesheuvel
2019-12-27  2:42   ` Andy Lutomirski
2019-12-27 17:51   ` Arvind Sankar
2019-12-27 18:08     ` Arvind Sankar
2019-12-27 18:13       ` Ard Biesheuvel
2019-12-28  3:25         ` Andy Lutomirski
2019-12-28  4:43           ` Arvind Sankar
2019-12-28  5:29             ` Andy Lutomirski
2019-12-28  6:35               ` Arvind Sankar
2019-12-28  7:03                 ` Andy Lutomirski
2019-12-28  8:51                   ` Ard Biesheuvel
2019-12-28  9:00                     ` Andy Lutomirski
2019-12-28  9:27                       ` Ard Biesheuvel
2019-12-26 15:14 ` [PATCH 2/3] efi/x86: simplify i386 efi_call_phys() " Ard Biesheuvel
2019-12-26 15:14 ` [PATCH 3/3] efi/x86: simplify mixed mode " Ard Biesheuvel
2019-12-27  2:56   ` Andy Lutomirski
2019-12-27  8:04     ` Ard Biesheuvel
2019-12-27  4:34   ` Arvind Sankar
2019-12-27  8:05     ` Ard Biesheuvel
2019-12-27 12:52       ` Arvind Sankar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).