x86/entry: Cleanup idtentry_entry/exit_user
authorThomas Gleixner <tglx@linutronix.de>
Wed, 22 Jul 2020 22:00:06 +0000 (00:00 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 24 Jul 2020 13:05:00 +0000 (15:05 +0200)
Cleanup the temporary defines and use irqentry_ instead of idtentry_.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20200722220520.602603691@linutronix.de
arch/x86/include/asm/idtentry.h
arch/x86/kernel/cpu/mce/core.c
arch/x86/kernel/traps.c

index f7d48ea51ab3568c87f6233c34491ae4b1f8222d..bf59f72140cc98d4292e4d282f0c3734779e22fb 100644 (file)
 
 #include <asm/irq_stack.h>
 
-/* Temporary define */
-#define idtentry_enter_user    irqentry_enter_from_user_mode
-#define idtentry_exit_user     irqentry_exit_to_user_mode
-
 typedef struct idtentry_state {
        bool exit_rcu;
 } idtentry_state_t;
index 6d7aa5642688111ea513332a365b68bcd161d564..97ff8313544f564b143efd791ff9a3910d597852 100644 (file)
@@ -1927,11 +1927,11 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
 
 static __always_inline void exc_machine_check_user(struct pt_regs *regs)
 {
-       idtentry_enter_user(regs);
+       irqentry_enter_from_user_mode(regs);
        instrumentation_begin();
        machine_check_vector(regs);
        instrumentation_end();
-       idtentry_exit_user(regs);
+       irqentry_exit_to_user_mode(regs);
 }
 
 #ifdef CONFIG_X86_64
index ab6828e360f2a0a76a6ff516f5295c266d421405..59c7f54753b4ad4ef18bcccf07939de0a9700844 100644 (file)
@@ -638,18 +638,18 @@ DEFINE_IDTENTRY_RAW(exc_int3)
                return;
 
        /*
-        * idtentry_enter_user() uses static_branch_{,un}likely() and therefore
-        * can trigger INT3, hence poke_int3_handler() must be done
-        * before. If the entry came from kernel mode, then use nmi_enter()
-        * because the INT3 could have been hit in any context including
-        * NMI.
+        * irqentry_enter_from_user_mode() uses static_branch_{,un}likely()
+        * and therefore can trigger INT3, hence poke_int3_handler() must
+        * be done before. If the entry came from kernel mode, then use
+        * nmi_enter() because the INT3 could have been hit in any context
+        * including NMI.
         */
        if (user_mode(regs)) {
-               idtentry_enter_user(regs);
+               irqentry_enter_from_user_mode(regs);
                instrumentation_begin();
                do_int3_user(regs);
                instrumentation_end();
-               idtentry_exit_user(regs);
+               irqentry_exit_to_user_mode(regs);
        } else {
                nmi_enter();
                instrumentation_begin();
@@ -901,12 +901,12 @@ static __always_inline void exc_debug_user(struct pt_regs *regs,
         */
        WARN_ON_ONCE(!user_mode(regs));
 
-       idtentry_enter_user(regs);
+       irqentry_enter_from_user_mode(regs);
        instrumentation_begin();
 
        handle_debug(regs, dr6, true);
        instrumentation_end();
-       idtentry_exit_user(regs);
+       irqentry_exit_to_user_mode(regs);
 }
 
 #ifdef CONFIG_X86_64