Commit 517e4992 authored by Thomas Gleixner's avatar Thomas Gleixner

x86/entry: Cleanup idtentry_entry/exit_user

Cleanup the temporary defines and use irqentry_ instead of idtentry_.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20200722220520.602603691@linutronix.de
parent 167fd210
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include <asm/irq_stack.h> #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 { typedef struct idtentry_state {
bool exit_rcu; bool exit_rcu;
} idtentry_state_t; } idtentry_state_t;
......
...@@ -1927,11 +1927,11 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs) ...@@ -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) static __always_inline void exc_machine_check_user(struct pt_regs *regs)
{ {
idtentry_enter_user(regs); irqentry_enter_from_user_mode(regs);
instrumentation_begin(); instrumentation_begin();
machine_check_vector(regs); machine_check_vector(regs);
instrumentation_end(); instrumentation_end();
idtentry_exit_user(regs); irqentry_exit_to_user_mode(regs);
} }
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
......
...@@ -638,18 +638,18 @@ DEFINE_IDTENTRY_RAW(exc_int3) ...@@ -638,18 +638,18 @@ DEFINE_IDTENTRY_RAW(exc_int3)
return; return;
/* /*
* idtentry_enter_user() uses static_branch_{,un}likely() and therefore * irqentry_enter_from_user_mode() uses static_branch_{,un}likely()
* can trigger INT3, hence poke_int3_handler() must be done * and therefore can trigger INT3, hence poke_int3_handler() must
* before. If the entry came from kernel mode, then use nmi_enter() * be done before. If the entry came from kernel mode, then use
* because the INT3 could have been hit in any context including * nmi_enter() because the INT3 could have been hit in any context
* NMI. * including NMI.
*/ */
if (user_mode(regs)) { if (user_mode(regs)) {
idtentry_enter_user(regs); irqentry_enter_from_user_mode(regs);
instrumentation_begin(); instrumentation_begin();
do_int3_user(regs); do_int3_user(regs);
instrumentation_end(); instrumentation_end();
idtentry_exit_user(regs); irqentry_exit_to_user_mode(regs);
} else { } else {
nmi_enter(); nmi_enter();
instrumentation_begin(); instrumentation_begin();
...@@ -901,12 +901,12 @@ static __always_inline void exc_debug_user(struct pt_regs *regs, ...@@ -901,12 +901,12 @@ static __always_inline void exc_debug_user(struct pt_regs *regs,
*/ */
WARN_ON_ONCE(!user_mode(regs)); WARN_ON_ONCE(!user_mode(regs));
idtentry_enter_user(regs); irqentry_enter_from_user_mode(regs);
instrumentation_begin(); instrumentation_begin();
handle_debug(regs, dr6, true); handle_debug(regs, dr6, true);
instrumentation_end(); instrumentation_end();
idtentry_exit_user(regs); irqentry_exit_to_user_mode(regs);
} }
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment