From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbcD1Kpu (ORCPT ); Thu, 28 Apr 2016 06:45:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48414 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752376AbcD1Kps (ORCPT ); Thu, 28 Apr 2016 06:45:48 -0400 Date: Thu, 28 Apr 2016 03:43:44 -0700 From: tip-bot for Mark Rutland Message-ID: Cc: peterz@infradead.org, ard.biesheuvel@linaro.org, hpa@zytor.com, leif.lindholm@linaro.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, mingo@kernel.org, bp@alien8.de, ricardo.neri-calderon@linux.intel.com, will.deacon@arm.com, mark.rutland@arm.com, matt@codeblueprint.co.uk, tglx@linutronix.de Reply-To: hpa@zytor.com, leif.lindholm@linaro.org, peterz@infradead.org, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, mingo@kernel.org, bp@alien8.de, ricardo.neri-calderon@linux.intel.com, tglx@linutronix.de, matt@codeblueprint.co.uk, mark.rutland@arm.com In-Reply-To: <1461614832-17633-35-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-35-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] x86/efi: Move to generic {__,}efi_call_virt() Git-Commit-ID: bc25f9dba149a1392b016a6d35300c8d79177298 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: bc25f9dba149a1392b016a6d35300c8d79177298 Gitweb: http://git.kernel.org/tip/bc25f9dba149a1392b016a6d35300c8d79177298 Author: Mark Rutland AuthorDate: Mon, 25 Apr 2016 21:07:06 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:34:09 +0200 x86/efi: Move to generic {__,}efi_call_virt() Now there's a common template for {__,}efi_call_virt(), remove the duplicate logic from the x86 EFI code. Signed-off-by: Mark Rutland Signed-off-by: Matt Fleming Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Catalin Marinas Cc: Leif Lindholm Cc: Peter Zijlstra Cc: Ricardo Neri Cc: Russell King Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-35-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- arch/x86/include/asm/efi.h | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 8747abe..fb085ce 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -33,28 +33,16 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); +#define arch_efi_call_virt_setup() kernel_fpu_begin() +#define arch_efi_call_virt_teardown() kernel_fpu_end() + /* * Wrap all the virtual calls in a way that forces the parameters on the stack. */ - -/* Use this macro if your virtual returns a non-void value */ -#define efi_call_virt(f, args...) \ -({ \ - efi_status_t __s; \ - kernel_fpu_begin(); \ - __s = ((efi_##f##_t __attribute__((regparm(0)))*) \ - efi.systab->runtime->f)(args); \ - kernel_fpu_end(); \ - __s; \ -}) - -/* Use this macro if your virtual call does not return any value */ -#define __efi_call_virt(f, args...) \ +#define arch_efi_call_virt(f, args...) \ ({ \ - kernel_fpu_begin(); \ ((efi_##f##_t __attribute__((regparm(0)))*) \ efi.systab->runtime->f)(args); \ - kernel_fpu_end(); \ }) #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) @@ -78,10 +66,8 @@ struct efi_scratch { u64 phys_stack; } __packed; -#define efi_call_virt(f, ...) \ +#define arch_efi_call_virt_setup() \ ({ \ - efi_status_t __s; \ - \ efi_sync_low_kernel_mappings(); \ preempt_disable(); \ __kernel_fpu_begin(); \ @@ -91,9 +77,13 @@ struct efi_scratch { write_cr3((unsigned long)efi_scratch.efi_pgt); \ __flush_tlb_all(); \ } \ - \ - __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \ - \ +}) + +#define arch_efi_call_virt(f, args...) \ + efi_call((void *)efi.systab->runtime->f, args) \ + +#define arch_efi_call_virt_teardown() \ +({ \ if (efi_scratch.use_pgd) { \ write_cr3(efi_scratch.prev_cr3); \ __flush_tlb_all(); \ @@ -101,15 +91,8 @@ struct efi_scratch { \ __kernel_fpu_end(); \ preempt_enable(); \ - __s; \ }) -/* - * All X86_64 virt calls return non-void values. Thus, use non-void call for - * virt calls that would be void on X86_32. - */ -#define __efi_call_virt(f, args...) efi_call_virt(f, args) - extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size, u32 type, u64 attribute);