Skip to content

Commit 71ed49d

Browse files
committed
x86/entry: Make NMI use IDTENTRY_RAW
For no reason other than beginning brainmelt, IDTENTRY_NMI was mapped to IDTENTRY_IST. This is not a problem on 64bit because the IST default entry point maps to IDTENTRY_RAW which does not any entry handling. The surplus function declaration for the noist C entry point is unused and as there is no ASM code emitted for NMI this went unnoticed. On 32bit IDTENTRY_IST maps to a regular IDTENTRY which does the normal entry handling. That is clearly the wrong thing to do for NMI. Map it to IDTENTRY_RAW to unbreak it. The IDTENTRY_NMI mapping needs to stay to avoid emitting ASM code. Fixes: 6271fef ("x86/entry: Convert NMI to IDTENTRY_NMI") Reported-by: Naresh Kamboju <[email protected]> Debugged-by: Andy Lutomirski <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/CA+G9fYvF3cyrY+-iw_SZtpN-i2qA2BruHg4M=QYECU2-dNdsMw@mail.gmail.com
1 parent 15a416e commit 71ed49d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/x86/include/asm/idtentry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ __visible noinstr void func(struct pt_regs *regs, \
391391
#define DEFINE_IDTENTRY_MCE DEFINE_IDTENTRY_IST
392392
#define DEFINE_IDTENTRY_MCE_USER DEFINE_IDTENTRY_NOIST
393393

394-
#define DECLARE_IDTENTRY_NMI DECLARE_IDTENTRY_IST
395-
#define DEFINE_IDTENTRY_NMI DEFINE_IDTENTRY_IST
394+
#define DECLARE_IDTENTRY_NMI DECLARE_IDTENTRY_RAW
395+
#define DEFINE_IDTENTRY_NMI DEFINE_IDTENTRY_RAW
396396

397397
#define DECLARE_IDTENTRY_DEBUG DECLARE_IDTENTRY_IST
398398
#define DEFINE_IDTENTRY_DEBUG DEFINE_IDTENTRY_IST

arch/x86/kernel/nmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static DEFINE_PER_CPU(enum nmi_states, nmi_state);
476476
static DEFINE_PER_CPU(unsigned long, nmi_cr2);
477477
static DEFINE_PER_CPU(unsigned long, nmi_dr7);
478478

479-
DEFINE_IDTENTRY_NMI(exc_nmi)
479+
DEFINE_IDTENTRY_RAW(exc_nmi)
480480
{
481481
if (IS_ENABLED(CONFIG_SMP) && cpu_is_offline(smp_processor_id()))
482482
return;

0 commit comments

Comments
 (0)