From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbcFYHVU (ORCPT ); Sat, 25 Jun 2016 03:21:20 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36615 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbcFYHUo (ORCPT ); Sat, 25 Jun 2016 03:20:44 -0400 From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Alex Thorlton , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Catalin Marinas , Dimitri Sivanich , Ingo Molnar , Mark Rutland , Roy Franz , Russ Anderson , Russell King , Will Deacon Subject: [PATCH 6/7] x86/efi: Update efi_thunk to use the the arch_efi_call_virt* macros Date: Sat, 25 Jun 2016 08:20:29 +0100 Message-Id: <1466839230-12781-7-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1466839230-12781-1-git-send-email-matt@codeblueprint.co.uk> References: <1466839230-12781-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Thorlton 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. Signed-off-by: Alex Thorlton Suggested-by: Matt Fleming Cc: Russ Anderson Cc: Dimitri Sivanich Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Ard Biesheuvel Cc: Mark Rutland Cc: Roy Franz Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Matt Fleming --- arch/x86/platform/efi/efi_64.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 6e7242be1c87..4cc2b9688dc2 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -469,18 +469,13 @@ extern efi_status_t efi64_thunk(u32, ...); unsigned long flags; \ u32 func; \ \ - efi_sync_low_kernel_mappings(); \ local_irq_save(flags); \ - \ - efi_scratch.prev_cr3 = read_cr3(); \ - write_cr3((unsigned long)efi_scratch.efi_pgt); \ - __flush_tlb_all(); \ + arch_efi_call_virt_setup(); \ \ func = runtime_service32(f); \ - __s = efi64_thunk(func, __VA_ARGS__); \ + __s = efi64_thunk(func, __VA_ARGS__); \ \ - write_cr3(efi_scratch.prev_cr3); \ - __flush_tlb_all(); \ + arch_efi_call_virt_teardown(); \ local_irq_restore(flags); \ \ __s; \ -- 2.7.3