Merge tag 'x86-irq-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 irq fix from Ingo Molnar: "Fix out-of-order NMI nesting checks resulting in false positive warnings" * tag 'x86-irq-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/nmi: Fix out-of-order NMI nesting checks & false positive warning
This commit is contained in:
@@ -507,12 +507,13 @@ DEFINE_IDTENTRY_RAW(exc_nmi)
|
||||
}
|
||||
this_cpu_write(nmi_state, NMI_EXECUTING);
|
||||
this_cpu_write(nmi_cr2, read_cr2());
|
||||
|
||||
nmi_restart:
|
||||
if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) {
|
||||
WRITE_ONCE(nsp->idt_seq, nsp->idt_seq + 1);
|
||||
WARN_ON_ONCE(!(nsp->idt_seq & 0x1));
|
||||
WRITE_ONCE(nsp->recv_jiffies, jiffies);
|
||||
}
|
||||
nmi_restart:
|
||||
|
||||
/*
|
||||
* Needs to happen before DR7 is accessed, because the hypervisor can
|
||||
@@ -548,16 +549,16 @@ nmi_restart:
|
||||
|
||||
if (unlikely(this_cpu_read(nmi_cr2) != read_cr2()))
|
||||
write_cr2(this_cpu_read(nmi_cr2));
|
||||
if (this_cpu_dec_return(nmi_state))
|
||||
goto nmi_restart;
|
||||
|
||||
if (user_mode(regs))
|
||||
mds_user_clear_cpu_buffers();
|
||||
if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) {
|
||||
WRITE_ONCE(nsp->idt_seq, nsp->idt_seq + 1);
|
||||
WARN_ON_ONCE(nsp->idt_seq & 0x1);
|
||||
WRITE_ONCE(nsp->recv_jiffies, jiffies);
|
||||
}
|
||||
if (this_cpu_dec_return(nmi_state))
|
||||
goto nmi_restart;
|
||||
|
||||
if (user_mode(regs))
|
||||
mds_user_clear_cpu_buffers();
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_KVM_INTEL)
|
||||
|
||||
Reference in New Issue
Block a user