Skip to content

Commit bc21a29

Browse files
KAGA-KOKOsuryasaimadhu
authored andcommitted
x86/mce: Use idtentry_nmi_enter/exit()
The recent fix for NMI vs. IRQ state tracking missed to apply the cure to the MCE handler. Fixes: ba1f2b2 ("x86/entry: Fix NMI vs IRQ state tracking") Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 86a82ae commit bc21a29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,8 @@ void (*machine_check_vector)(struct pt_regs *) = unexpected_machine_check;
19041904

19051905
static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
19061906
{
1907+
bool irq_state;
1908+
19071909
WARN_ON_ONCE(user_mode(regs));
19081910

19091911
/*
@@ -1914,7 +1916,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
19141916
mce_check_crashing_cpu())
19151917
return;
19161918

1917-
nmi_enter();
1919+
irq_state = idtentry_enter_nmi(regs);
19181920
/*
19191921
* The call targets are marked noinstr, but objtool can't figure
19201922
* that out because it's an indirect call. Annotate it.
@@ -1925,7 +1927,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
19251927
if (regs->flags & X86_EFLAGS_IF)
19261928
trace_hardirqs_on_prepare();
19271929
instrumentation_end();
1928-
nmi_exit();
1930+
idtentry_exit_nmi(regs, irq_state);
19291931
}
19301932

19311933
static __always_inline void exc_machine_check_user(struct pt_regs *regs)

0 commit comments

Comments
 (0)