From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbcF0NDt (ORCPT ); Mon, 27 Jun 2016 09:03:49 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42052 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbcF0NDr (ORCPT ); Mon, 27 Jun 2016 09:03:47 -0400 Date: Mon, 27 Jun 2016 06:02:57 -0700 From: tip-bot for Alex Thorlton Message-ID: Cc: sivanich@sgi.com, catalin.marinas@arm.com, athorlton@sgi.com, mingo@kernel.org, linux-kernel@vger.kernel.org, matt@codeblueprint.co.uk, hpa@zytor.com, linux@armlinux.org.uk, ard.biesheuvel@linaro.org, torvalds@linux-foundation.org, mark.rutland@arm.com, roy.franz@linaro.org, rja@sgi.com, will.deacon@arm.com, peterz@infradead.org, tglx@linutronix.de Reply-To: roy.franz@linaro.org, rja@sgi.com, mark.rutland@arm.com, torvalds@linux-foundation.org, will.deacon@arm.com, peterz@infradead.org, tglx@linutronix.de, athorlton@sgi.com, mingo@kernel.org, catalin.marinas@arm.com, sivanich@sgi.com, linux-kernel@vger.kernel.org, hpa@zytor.com, matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, linux@armlinux.org.uk In-Reply-To: <1466839230-12781-7-git-send-email-matt@codeblueprint.co.uk> References: <1466839230-12781-7-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros Git-Commit-ID: 21f866257c7027f8f49bfde83f559f9e58f9ee93 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: 21f866257c7027f8f49bfde83f559f9e58f9ee93 Gitweb: http://git.kernel.org/tip/21f866257c7027f8f49bfde83f559f9e58f9ee93 Author: Alex Thorlton AuthorDate: Sat, 25 Jun 2016 08:20:29 +0100 Committer: Ingo Molnar CommitDate: Mon, 27 Jun 2016 13:06:57 +0200 x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros Currently, the efi_thunk macro has some semi-duplicated code in it that can be replaced with the arch_efi_call_virt_setup/teardown macros. This commit simply replaces the duplicated code with those macros. Suggested-by: Matt Fleming Signed-off-by: Alex Thorlton Signed-off-by: Matt Fleming Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: Dimitri Sivanich Cc: Linus Torvalds Cc: Mark Rutland Cc: Peter Zijlstra Cc: Roy Franz Cc: Russ Anderson Cc: Russell King Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1466839230-12781-7-git-send-email-matt@codeblueprint.co.uk [ Renamed variables to the standard __ prefix. ] Signed-off-by: Ingo Molnar --- arch/x86/platform/efi/efi_64.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index b226b3f..5cb4301 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -466,22 +466,17 @@ extern efi_status_t efi64_thunk(u32, ...); #define efi_thunk(f, ...) \ ({ \ efi_status_t __s; \ - unsigned long flags; \ - u32 func; \ + unsigned long __flags; \ + u32 __func; \ \ - efi_sync_low_kernel_mappings(); \ - local_irq_save(flags); \ + local_irq_save(__flags); \ + arch_efi_call_virt_setup(); \ \ - efi_scratch.prev_cr3 = read_cr3(); \ - write_cr3((unsigned long)efi_scratch.efi_pgt); \ - __flush_tlb_all(); \ + __func = runtime_service32(f); \ + __s = efi64_thunk(__func, __VA_ARGS__); \ \ - func = runtime_service32(f); \ - __s = efi64_thunk(func, __VA_ARGS__); \ - \ - write_cr3(efi_scratch.prev_cr3); \ - __flush_tlb_all(); \ - local_irq_restore(flags); \ + arch_efi_call_virt_teardown(); \ + local_irq_restore(__flags); \ \ __s; \ })