x86: Ignore NMIs that come in during early boot
authorH. Peter Anvin <hpa@linux.intel.com>
Fri, 7 Mar 2014 23:05:20 +0000 (15:05 -0800)
committerJiri Slaby <jslaby@suse.cz>
Sat, 22 Mar 2014 21:01:54 +0000 (22:01 +0100)
commit8ee7e9f35c9327cedcefc28ce6ad4f30b20bc579
tree52635d27efefba0405038beb1257a0fe2a3becd6
parentcaf08ff5618812a52ae23b526349e95223856825
x86: Ignore NMIs that come in during early boot

commit 5fa10196bdb5f190f595ebd048490ee52dddea0f upstream.

Don Zickus reports:

A customer generated an external NMI using their iLO to test kdump
worked.  Unfortunately, the machine hung.  Disabling the nmi_watchdog
made things work.

I speculated the external NMI fired, caused the machine to panic (as
expected) and the perf NMI from the watchdog came in and was latched.
My guess was this somehow caused the hang.

   ----

It appears that the latched NMI stays latched until the early page
table generation on 64 bits, which causes exceptions to happen which
end in IRET, which re-enable NMI.  Therefore, ignore NMIs that come in
during early execution, until we have proper exception handling.

Reported-and-tested-by: Don Zickus <dzickus@redhat.com>
Link: http://lkml.kernel.org/r/1394221143-29713-1-git-send-email-dzickus@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/x86/kernel/head_32.S
arch/x86/kernel/head_64.S