All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org
Cc: nivedita@alum.mit.edu, hdegoede@redhat.com,
	Ard Biesheuvel <ardb@kernel.org>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 0/3] efi/x86: clean up and simplify runtime call wrappers
Date: Thu, 26 Dec 2019 16:14:04 +0100	[thread overview]
Message-ID: <20191226151407.29716-1-ardb@kernel.org> (raw)

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


             reply	other threads:[~2019-12-26 15:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 15:14 Ard Biesheuvel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191226151407.29716-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nivedita@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.