]> git.baikalelectronics.ru Git - kernel.git/commit
x86/entry: Treat BUG/WARN as NMI-like entries
authorAndy Lutomirski <luto@kernel.org>
Fri, 12 Jun 2020 03:26:38 +0000 (20:26 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 12 Jun 2020 10:12:57 +0000 (12:12 +0200)
commit78cfc445c852c1b8816831fd5e7247ad9f02862f
treee4ae9ce3068dbd6df81a2a445be81e015a387aa5
parent2dab5a7e0a9b5737702ba4bd981ea19d22a89218
x86/entry: Treat BUG/WARN as NMI-like entries

BUG/WARN are cleverly optimized using UD2 to handle the BUG/WARN out of
line in an exception fixup.

But if BUG or WARN is issued in a funny RCU context, then the
idtentry_enter...() path might helpfully WARN that the RCU context is
invalid, which results in infinite recursion.

Split the BUG/WARN handling into an nmi_enter()/nmi_exit() path in
exc_invalid_op() to increase the chance to survive the experience.

[ tglx: Make the declaration match the implementation ]

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/f8fe40e0088749734b4435b554f73eee53dcf7a8.1591932307.git.luto@kernel.org
arch/x86/include/asm/idtentry.h
arch/x86/kernel/traps.c
arch/x86/mm/extable.c