x86/nmi: Remove irq_work from the long duration NMI handler
authorChangbin Du <changbin.du@gmail.com>
Sat, 11 Jan 2020 12:54:27 +0000 (20:54 +0800)
committerBorislav Petkov <bp@suse.de>
Sat, 11 Jan 2020 14:55:39 +0000 (15:55 +0100)
commit248ed51048c40d36728e70914e38bffd7821da57
tree9b5eed653ff1b880fa2b7ae8c9b9767ed1db2346
parent36209766cede1fe9d39f3d3418d93bbf71ad21c4
x86/nmi: Remove irq_work from the long duration NMI handler

First, printk() is NMI-context safe now since the safe printk() has been
implemented and it already has an irq_work to make NMI-context safe.

Second, this NMI irq_work actually does not work if a NMI handler causes
panic by watchdog timeout. It has no chance to run in such case, while
the safe printk() will flush its per-cpu buffers before panicking.

While at it, repurpose the irq_work callback into a function which
concentrates the NMI duration checking and makes the code easier to
follow.

 [ bp: Massage. ]

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200111125427.15662-1-changbin.du@gmail.com
arch/x86/include/asm/nmi.h
arch/x86/kernel/nmi.c