x86/mce: Make machine check speculation protected
authorThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jan 2018 15:28:26 +0000 (16:28 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:51:01 +0000 (15:51 +0000)
commit24578f5e4c465369b7663873ce7c8bcbc77f7965
tree808dd07e92bff5a15575ffa311cf74699e3dc3d1
parentd84be371195fdd1b80f182c8a953542453ae47f1
x86/mce: Make machine check speculation protected

commit 6f41c34d69eb005e7848716bbcafc979b35037d5 upstream.

The machine check idtentry uses an indirect branch directly from the low
level code. This evades the speculation protection.

Replace it by a direct call into C code and issue the indirect call there
so the compiler can apply the proper speculation protection.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by:Borislav Petkov <bp@alien8.de>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Niced-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801181626290.1847@nanos
[bwh: Backported to 3.2:
 - Don't use dotraplinkage
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/include/asm/traps.h
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/entry_64.S