aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Thorlton <[email protected]>2016-06-25 08:20:29 +0100
committerIngo Molnar <[email protected]>2016-06-27 13:06:57 +0200
commit21f866257c7027f8f49bfde83f559f9e58f9ee93 (patch)
tree7166638ab4533b0ee0e52c9bd32eafe0940a238d
parentd1be84a232e359ca9456c63e72cb0082d68311b6 (diff)
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 <[email protected]> Signed-off-by: Alex Thorlton <[email protected]> Signed-off-by: Matt Fleming <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Dimitri Sivanich <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Roy Franz <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Russell King <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Renamed variables to the standard __ prefix. ] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--arch/x86/platform/efi/efi_64.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index b226b3f497f1..5cb4301c4dcf 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; \
})