From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0E54C2D0DA for ; Thu, 26 Dec 2019 15:16:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A4C120828 for ; Thu, 26 Dec 2019 15:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577373405; bh=qte1HoMpw27seoR6IIS/kRXFxFkUuB5Z5+JuN2Zl9p0=; h=From:To:Cc:Subject:Date:List-ID:From; b=jC816Pk/WE9hx5gCHoW3kuz0BNIk8VT+VMtLMJHyzmDPBm/UPQYZIkiGTvor/5Btk pwSyFYRw8b2a0w9GznEFS5dWAqdMpmqS1+dzyBlQxCP1mguzutSCWYoA1PUTTgra0W ySaM87jaTl0y9GrRAQ0DsYuc/D1M2u7C++gT96Z4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbfLZPQp (ORCPT ); Thu, 26 Dec 2019 10:16:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:34172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbfLZPQp (ORCPT ); Thu, 26 Dec 2019 10:16:45 -0500 Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D9472075E; Thu, 26 Dec 2019 15:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577373404; bh=qte1HoMpw27seoR6IIS/kRXFxFkUuB5Z5+JuN2Zl9p0=; h=From:To:Cc:Subject:Date:From; b=XhWgznf14w2wtohUFYRPZz0scFpAKcAjQHXYeXY0BnT4u7dgY4HbHUF10gLao7nTv T878iJpxR695CEE1eywczymE9YraZzekX0AWdWev2hv/MfhO2KVyvsgNd69tOEmRDf rymiutBRxKHsPdukwvtLIFAznTqaq5lLotf0hOi0= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: nivedita@alum.mit.edu, hdegoede@redhat.com, Ard Biesheuvel , Andy Lutomirski , Ingo Molnar Subject: [PATCH 0/3] efi/x86: clean up and simplify runtime call wrappers Date: Thu, 26 Dec 2019 16:14:04 +0100 Message-Id: <20191226151407.29716-1-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org 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 Cc: Ingo Molnar 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