Skip to content

Commit 517e499

Browse files
committed
x86/entry: Cleanup idtentry_entry/exit_user
Cleanup the temporary defines and use irqentry_ instead of idtentry_. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 167fd21 commit 517e499

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

arch/x86/include/asm/idtentry.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
#include <asm/irq_stack.h>
1313

14-
/* Temporary define */
15-
#define idtentry_enter_user irqentry_enter_from_user_mode
16-
#define idtentry_exit_user irqentry_exit_to_user_mode
17-
1814
typedef struct idtentry_state {
1915
bool exit_rcu;
2016
} idtentry_state_t;

arch/x86/kernel/cpu/mce/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,11 +1927,11 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
19271927

19281928
static __always_inline void exc_machine_check_user(struct pt_regs *regs)
19291929
{
1930-
idtentry_enter_user(regs);
1930+
irqentry_enter_from_user_mode(regs);
19311931
instrumentation_begin();
19321932
machine_check_vector(regs);
19331933
instrumentation_end();
1934-
idtentry_exit_user(regs);
1934+
irqentry_exit_to_user_mode(regs);
19351935
}
19361936

19371937
#ifdef CONFIG_X86_64

arch/x86/kernel/traps.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -638,18 +638,18 @@ DEFINE_IDTENTRY_RAW(exc_int3)
638638
return;
639639

640640
/*
641-
* idtentry_enter_user() uses static_branch_{,un}likely() and therefore
642-
* can trigger INT3, hence poke_int3_handler() must be done
643-
* before. If the entry came from kernel mode, then use nmi_enter()
644-
* because the INT3 could have been hit in any context including
645-
* NMI.
641+
* irqentry_enter_from_user_mode() uses static_branch_{,un}likely()
642+
* and therefore can trigger INT3, hence poke_int3_handler() must
643+
* be done before. If the entry came from kernel mode, then use
644+
* nmi_enter() because the INT3 could have been hit in any context
645+
* including NMI.
646646
*/
647647
if (user_mode(regs)) {
648-
idtentry_enter_user(regs);
648+
irqentry_enter_from_user_mode(regs);
649649
instrumentation_begin();
650650
do_int3_user(regs);
651651
instrumentation_end();
652-
idtentry_exit_user(regs);
652+
irqentry_exit_to_user_mode(regs);
653653
} else {
654654
nmi_enter();
655655
instrumentation_begin();
@@ -901,12 +901,12 @@ static __always_inline void exc_debug_user(struct pt_regs *regs,
901901
*/
902902
WARN_ON_ONCE(!user_mode(regs));
903903

904-
idtentry_enter_user(regs);
904+
irqentry_enter_from_user_mode(regs);
905905
instrumentation_begin();
906906

907907
handle_debug(regs, dr6, true);
908908
instrumentation_end();
909-
idtentry_exit_user(regs);
909+
irqentry_exit_to_user_mode(regs);
910910
}
911911

912912
#ifdef CONFIG_X86_64

0 commit comments

Comments
 (0)