x86: Call fixup_exception() before notify_die() in math_error()
authorSiarhei Liakh <[email protected]>
Thu, 14 Jun 2018 19:36:07 +0000 (19:36 +0000)
committerThomas Gleixner <[email protected]>
Wed, 20 Jun 2018 09:44:56 +0000 (11:44 +0200)
commit3ae6295ccb7cf6d344908209701badbbbb503e40
tree8c78733ff8b5fc228c089deb4002e90b70e6f781
parent1d9f3e20a56d33e55748552aeec597f58542f92d
x86: Call fixup_exception() before notify_die() in math_error()

fpu__drop() has an explicit fwait which under some conditions can trigger a
fixable FPU exception while in kernel. Thus, we should attempt to fixup the
exception first, and only call notify_die() if the fixup failed just like
in do_general_protection(). The original call sequence incorrectly triggers
KDB entry on debug kernels under particular FPU-intensive workloads.

Andy noted, that this makes the whole conditional irq enable thing even
more inconsistent, but fixing that it outside the scope of this.

Signed-off-by: Siarhei Liakh <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Andy Lutomirski <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: "Borislav Petkov" <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/DM5PR11MB201156F1CAB2592B07C79A03B17D0@DM5PR11MB2011.namprd11.prod.outlook.com
arch/x86/kernel/traps.c