From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 12 Nov 2018 03:43:22 -0000 Received: from mga06.intel.com ([134.134.136.31]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gM367-0008Tr-EB for speck@linutronix.de; Mon, 12 Nov 2018 04:41:12 +0100 From: Andi Kleen Subject: [MODERATED] [PATCH 0/4] RFC-MDSv1 1 Date: Sun, 11 Nov 2018 19:41:00 -0800 Message-Id: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: speck@linutronix.de Cc: Andi Kleen List-ID: Here's a preview of patches to add VERW support to the Linux for the recently released Coffelake microcode. This allows the kernel to flush CPU buffers on kernel boundaries and when going into idle. This mainly covers single thread, not SMT (except for the idle case) I lumped all the issues together under the Microarchitectural Data Sampling (MDS) name because they need the same mitigations,a and it doesn't seem worth duplicating the sysfs files and bug entries. Patches passed some stress testing. Some notes: - So far against 4.19 - 64bit only so far. 32bit will be in future versions. - Some other CPUs will need software sequences. These will be in a future version of the patchkit, and also will require moving some of the hooks. - One of the MSR bits uses the older name "Microarchitectural Buffer Sampling" (MBS). So far I kept that until that documentation is updated. Right now this is not to apply, but to discuss and that people can experiment if they want. Comments welcome. Andi Kleen (4): x86/speculation/mds: Add basic bug infrastructre for MDS x86/speculation/mds: Clear CPU buffers on kernel exit for 64bit x86/speculation/mds: Clear CPU buffers on entering idle x86/speculation/mds: Add sysfs reporting .../admin-guide/kernel-parameters.txt | 3 ++ arch/x86/entry/calling.h | 8 ++++ arch/x86/entry/entry_64.S | 6 +++ arch/x86/entry/entry_64_compat.S | 1 + arch/x86/include/asm/cpufeatures.h | 2 + arch/x86/include/asm/irqflags.h | 3 ++ arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/mwait.h | 4 ++ arch/x86/include/asm/nospec-branch.h | 5 +++ arch/x86/kernel/cpu/bugs.c | 44 +++++++++++++++++++ arch/x86/kernel/cpu/common.c | 14 ++++++ arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/process.c | 4 ++ arch/x86/kernel/smpboot.c | 1 + drivers/base/cpu.c | 8 ++++ 15 files changed, 105 insertions(+) -- 2.17.2