seccomp: Move speculation migitation control to arch code
authorThomas Gleixner <tglx@linutronix.de>
Fri, 4 May 2018 13:12:06 +0000 (15:12 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 3 Oct 2018 03:09:43 +0000 (04:09 +0100)
commit34be01c449e2f06bf019979efde3bbf9c5b45c82
treed9bb4c0ae4b9d42040f10b8463a5b332cfd908e7
parent92856049f6e54b124805b3335c84c79937934655
seccomp: Move speculation migitation control to arch code

commit 8bf37d8c067bb7eb8e7c381bdadf9bd89182b6bc upstream.

The migitation control is simpler to implement in architecture code as it
avoids the extra function call to check the mode. Aside of that having an
explicit seccomp enabled mode in the architecture mitigations would require
even more workarounds.

Move it into architecture code and provide a weak function in the seccomp
code. Remove the 'which' argument as this allows the architecture to decide
which mitigations are relevant for seccomp.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/kernel/cpu/bugs.c
include/linux/nospec.h
kernel/seccomp.c