From patchwork Mon Apr 25 20:07:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66622 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1234464qge; Mon, 25 Apr 2016 13:10:58 -0700 (PDT) X-Received: by 10.98.64.144 with SMTP id f16mr51130556pfd.159.1461615057976; Mon, 25 Apr 2016 13:10:57 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 81si8370942pfq.221.2016.04.25.13.10.57; Mon, 25 Apr 2016 13:10:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965138AbcDYUK4 (ORCPT + 29 others); Mon, 25 Apr 2016 16:10:56 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37301 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965038AbcDYUIT (ORCPT ); Mon, 25 Apr 2016 16:08:19 -0400 Received: by mail-wm0-f43.google.com with SMTP id n3so145611747wmn.0 for ; Mon, 25 Apr 2016 13:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RfLodYbyG2wSo+Qh8BS0qqz1OcWmIj7MMeEHhELDgDE=; b=mamZ609xosReg8egRpi68iDDSchH9DGaxIieBAgOYtXG/m9lRZ+gcBaxw+3zX8hB0M STY7amDb+USl+z657zs2nMZj7GbSXKna9wCrpNMueNwZGrGx4gyDN26J9xUZmhS7VzuN saFrJ1G/LuPm7AafwRLaG4KkKA6tCzYBkDgxVnsV/QzusoTyZcfjAxqfnesalEPCHsIW TYD2PX1MwTltqrj1nrl452z71Mo44eMo4mqDOTQFotMeUaNgnWfX6xf1mm+fcgCKI1f7 bG+OBgph8ejy4KSy1QaJj/pPhdwmmIfwIpHkQR6joL5W2ALfQFwukbLiwyhpofF/JmJ8 sBfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RfLodYbyG2wSo+Qh8BS0qqz1OcWmIj7MMeEHhELDgDE=; b=mk+QCBB5UzGcNfAoEmcn1HkI78WwP7anmMlQdXKgfi06m/xxoD1QfSL0lDIQ6qvtRh uoh2+7FifILZ+rwaKMOFEZ6MXv5BOdTEo7V2mDNAeJ63rDOrtoQE3OC5dqIKQsKBBh8R wdNFoQdxGohI9pPfpLIP1GoOSJ8dn/G1KzGs7qdp0bcie8dPMw1cq2qtgAuVhM4VHaVC 8NC6qDfmTO/FumRPf876BT0keUf2k0t+c5Kum0QScvK0SAfmtLpOtBOzTAWnEaIKTcgn 3fdgBRZEZZ2/U4CkXx8+t41lyyrfbfECvgpwPXr7qT8HmAkszC3u3fpKJqNCYuVkAMmh aphQ== X-Gm-Message-State: AOPr4FXqR2on3CjzlO45MrJVJ3gsjNQeavzKzSWASrM15W3E5HWwj+LlSizQTE6lQ82nyQ== X-Received: by 10.194.55.10 with SMTP id n10mr36623770wjp.28.1461614898276; Mon, 25 Apr 2016 13:08:18 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id r75sm19772634wme.18.2016.04.25.13.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:08:17 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Mark Rutland , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Catalin Marinas , Leif Lindholm , Russell King , Will Deacon Subject: [PATCH 32/40] arm64/efi: Move to generic {__,}efi_call_virt Date: Mon, 25 Apr 2016 21:07:04 +0100 Message-Id: <1461614832-17633-33-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland Now there's a common template for {__,}efi_call_virt, remove the duplicate logic from the arm64 efi code. Signed-off-by: Mark Rutland Acked-by: Will Deacon Reviewed-by: Ard Biesheuvel Cc: Catalin Marinas Cc: Leif Lindholm Cc: Matt Fleming Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: "H. Peter Anvin" Cc: Russell King Cc: Thomas Gleixner Signed-off-by: Matt Fleming --- arch/arm64/include/asm/efi.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) -- 2.7.3 diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 79dc8c237c7e..cfd4ae2e46c0 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -16,28 +16,21 @@ int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); #define efi_set_mapping_permissions efi_create_mapping -#define efi_call_virt(f, ...) \ +#define arch_efi_call_virt_setup() \ ({ \ - efi_##f##_t *__f; \ - efi_status_t __s; \ - \ kernel_neon_begin(); \ efi_virtmap_load(); \ - __f = efi.systab->runtime->f; \ - __s = __f(__VA_ARGS__); \ - efi_virtmap_unload(); \ - kernel_neon_end(); \ - __s; \ }) -#define __efi_call_virt(f, ...) \ +#define arch_efi_call_virt(f, args...) \ ({ \ efi_##f##_t *__f; \ - \ - kernel_neon_begin(); \ - efi_virtmap_load(); \ __f = efi.systab->runtime->f; \ - __f(__VA_ARGS__); \ + __f(args); \ +}) + +#define arch_efi_call_virt_teardown() \ +({ \ efi_virtmap_unload(); \ kernel_neon_end(); \ })