From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932897AbcFOTEV (ORCPT ); Wed, 15 Jun 2016 15:04:21 -0400 Received: from relay3.sgi.com ([192.48.152.1]:35005 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753188AbcFOTET (ORCPT ); Wed, 15 Jun 2016 15:04:19 -0400 From: Alex Thorlton To: linux-kernel@vger.kernel.org Cc: Alex Thorlton , Russ Anderson , Dimitri Sivanich , Russell King , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ard Biesheuvel , Mark Rutland , Roy Franz , linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, x86@kernel.org Subject: [PATCH 3/3] Update efi_thunk to use the the arch_efi_call_virt* macros Date: Wed, 15 Jun 2016 14:04:15 -0500 Message-Id: <1466017455-236934-4-git-send-email-athorlton@sgi.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1466017455-236934-1-git-send-email-athorlton@sgi.com> References: <1466017455-236934-1-git-send-email-athorlton@sgi.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 6e7242b..4cc2b96 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; \ -- 1.8.5.6 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Thorlton Subject: [PATCH 3/3] Update efi_thunk to use the the arch_efi_call_virt* macros Date: Wed, 15 Jun 2016 14:04:15 -0500 Message-ID: <1466017455-236934-4-git-send-email-athorlton@sgi.com> References: <1466017455-236934-1-git-send-email-athorlton@sgi.com> Return-path: In-Reply-To: <1466017455-236934-1-git-send-email-athorlton-sJ/iWh9BUns@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Alex Thorlton , Russ Anderson , Dimitri Sivanich , Russell King , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ard Biesheuvel , Mark Rutland , Roy Franz , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-efi@vger.kernel.org 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-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org --- 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 6e7242b..4cc2b96 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; \ -- 1.8.5.6 From mboxrd@z Thu Jan 1 00:00:00 1970 From: athorlton@sgi.com (Alex Thorlton) Date: Wed, 15 Jun 2016 14:04:15 -0500 Subject: [PATCH 3/3] Update efi_thunk to use the the arch_efi_call_virt* macros In-Reply-To: <1466017455-236934-1-git-send-email-athorlton@sgi.com> References: <1466017455-236934-1-git-send-email-athorlton@sgi.com> Message-ID: <1466017455-236934-4-git-send-email-athorlton@sgi.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 at lists.infradead.org Cc: linux-efi at vger.kernel.org Cc: x86 at kernel.org --- 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 6e7242b..4cc2b96 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; \ -- 1.8.5.6