diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-02-18 23:42:51 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-03-06 21:52:13 +0100 |
commit | 04dcbdb8057827b043b3c71aa397c4c63e67d086 (patch) | |
tree | ef837807f05eaf4ce6abe5d62b5ef5703931c3e5 /arch/x86/kernel/cpu/bugs.c | |
parent | 6a9e529272517755904b7afa639f6db59ddb793e (diff) | |
download | talos-op-linux-04dcbdb8057827b043b3c71aa397c4c63e67d086.tar.gz talos-op-linux-04dcbdb8057827b043b3c71aa397c4c63e67d086.zip |
x86/speculation/mds: Clear CPU buffers on exit to user
Add a static key which controls the invocation of the CPU buffer clear
mechanism on exit to user space and add the call into
prepare_exit_to_usermode() and do_nmi() right before actually returning.
Add documentation which kernel to user space transition this covers and
explain why some corner cases are not mitigated.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Jon Masters <jcm@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu/bugs.c')
-rw-r--r-- | arch/x86/kernel/cpu/bugs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 01874d54f4fd..dbb45014de1b 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -63,6 +63,9 @@ DEFINE_STATIC_KEY_FALSE(switch_mm_cond_ibpb); /* Control unconditional IBPB in switch_mm() */ DEFINE_STATIC_KEY_FALSE(switch_mm_always_ibpb); +/* Control MDS CPU buffer clear before returning to user space */ +DEFINE_STATIC_KEY_FALSE(mds_user_clear); + void __init check_bugs(void) { identify_boot_cpu(); |