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 ; 09 Jan 2019 17:18:14 -0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ghHUb-0005iI-7X for speck@linutronix.de; Wed, 09 Jan 2019 18:18:13 +0100 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x09H90lo061626 for ; Wed, 9 Jan 2019 17:18:06 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2ptj3e2vhs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jan 2019 17:18:06 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x09HI50p023998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Jan 2019 17:18:05 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x09HI5s2024791 for ; Wed, 9 Jan 2019 17:18:05 GMT Date: Wed, 9 Jan 2019 12:18:04 -0500 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [PATCH v3 00/32] MDSv3 12 Message-ID: <20190109171804.GV23427@char.us.oracle.com> References: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu, Dec 20, 2018 at 04:27:10PM -0800, speck for Andi Kleen wrote: > From: Andi Kleen > Subject: MDSv3 > > Here's a new version of flushing CPU buffers for group 4. Could you send also a git bundle of them please? The titles of them is not in sync with the XX/YY. I can probably figure out the right flow but it would help (also helps in review). Thank you! And one more thing - I see 'MB' and 'MDS' and also 'MSB' (Microarchitectual Store Buffer). > VERW is not done unconditionally because it doesn't allow reporting > the correct status in the vulnerabilities file, which I consider important. > Instead we now have a mds=verw option that can be set as needed, msd=force Is how it was handled for SSBD and L1TF I believe? Could that be used? > but is reported explicitely in the mitigation status. > > Some notes: > - Against 4.20-rc5 > - There's a new (bogus) build time warning from objtool about unreachable code. > > Changes against previous versions: > - By default now flushes only when needed > - Define security model > - New administrator document > - Added mds=verw and mds=full > - Renamed mds_disable to mds=off > - KVM virtualization much improved > - Too many others to list. Most things different now. > > Andi Kleen (32): > x86/speculation/mds: Add basic bug infrastructure for MDS > x86/speculation/mds: Support clearing CPU data on kernel exit > x86/speculation/mds: Support mds=full > x86/speculation/mds: Clear CPU buffers on entering idle > x86/speculation/mds: Add sysfs reporting > x86/speculation/mds: Add software sequences for older CPUs. > x86/speculation/mds: Support mds=full for NMIs > x86/speculation/mds: Avoid NMI races with software sequences > x86/speculation/mds: Call software sequences on KVM entry > x86/speculation/mds: Clear buffers on NMI exit on 32bit kernels. > x86/speculation/mds: Add mds=verw > x86/speculation/mds: Export MB_CLEAR CPUID to KVM guests. > x86/speculation/mds: Always clear when entering guest without MB_CLEAR > mds: Add documentation for clear cpu usage > mds: Add preliminary administrator documentation > x86/speculation/mds: Introduce lazy_clear_cpu > x86/speculation/mds: Schedule cpu clear on context switch > x86/speculation/mds: Add tracing for clear_cpu > mds: Force clear cpu on kernel preemption > mds: Schedule cpu clear for memzero_explicit and kzfree > mds: Mark interrupts clear cpu, unless opted-out > mds: Clear cpu on all timers, unless the timer opts-out > mds: Clear CPU on tasklets, unless opted-out > mds: Clear CPU on irq poll, unless opted-out > mds: Clear cpu for string io/memcpy_*io in interrupts > mds: Schedule clear cpu in swiotlb > mds: Instrument skb functions to clear cpu automatically > mds: Opt out tcp tasklet to not touch user data > mds: mark kernel/* timers safe as not touching user data > mds: Mark AHCI interrupt as not needing cpu clear > mds: Mark ACPI interrupt as not needing cpu clear > mds: Mitigate BPF > > .../ABI/testing/sysfs-devices-system-cpu | 1 + > .../admin-guide/kernel-parameters.txt | 29 +++ > Documentation/admin-guide/mds.rst | 128 +++++++++++++ > Documentation/clearcpu.txt | 179 ++++++++++++++++++ > arch/Kconfig | 3 + > arch/x86/Kconfig | 1 + > arch/x86/entry/common.c | 24 ++- > arch/x86/entry/entry_32.S | 7 + > arch/x86/entry/entry_64.S | 24 +++ > arch/x86/include/asm/clearbpf.h | 29 +++ > arch/x86/include/asm/clearcpu.h | 100 ++++++++++ > arch/x86/include/asm/cpufeatures.h | 4 + > arch/x86/include/asm/io.h | 3 + > arch/x86/include/asm/msr-index.h | 1 + > arch/x86/include/asm/thread_info.h | 2 + > arch/x86/include/asm/trace/clearcpu.h | 27 +++ > arch/x86/kernel/acpi/cstate.c | 2 + > arch/x86/kernel/cpu/bugs.c | 108 +++++++++++ > arch/x86/kernel/cpu/common.c | 14 ++ > arch/x86/kernel/kvm.c | 3 + > arch/x86/kernel/process.c | 5 + > arch/x86/kernel/process.h | 27 +++ > arch/x86/kernel/smpboot.c | 3 + > arch/x86/kvm/cpuid.c | 3 +- > arch/x86/kvm/vmx.c | 23 ++- > arch/x86/lib/Makefile | 1 + > arch/x86/lib/clear_cpu.S | 104 ++++++++++ > drivers/acpi/acpi_pad.c | 2 + > drivers/acpi/osl.c | 3 +- > drivers/acpi/processor_idle.c | 3 + > drivers/ata/ahci.c | 2 +- > drivers/ata/ahci.h | 2 + > drivers/ata/libahci.c | 40 ++-- > drivers/base/cpu.c | 8 + > drivers/idle/intel_idle.c | 5 + > include/asm-generic/io.h | 3 + > include/linux/clearcpu.h | 36 ++++ > include/linux/filter.h | 21 +- > include/linux/hrtimer.h | 4 + > include/linux/interrupt.h | 18 +- > include/linux/irq_poll.h | 2 + > include/linux/skbuff.h | 2 + > include/linux/timer.h | 9 +- > kernel/bpf/core.c | 2 + > kernel/dma/swiotlb.c | 2 + > kernel/events/core.c | 6 +- > kernel/fork.c | 3 +- > kernel/futex.c | 6 +- > kernel/irq/handle.c | 8 + > kernel/irq/manage.c | 1 + > kernel/sched/core.c | 14 +- > kernel/sched/deadline.c | 6 +- > kernel/sched/fair.c | 7 +- > kernel/sched/idle.c | 3 +- > kernel/sched/rt.c | 3 +- > kernel/softirq.c | 25 ++- > kernel/time/alarmtimer.c | 2 +- > kernel/time/hrtimer.c | 11 +- > kernel/time/posix-timers.c | 6 +- > kernel/time/sched_clock.c | 3 +- > kernel/time/tick-sched.c | 6 +- > kernel/time/timer.c | 8 + > kernel/watchdog.c | 3 +- > lib/irq_poll.c | 18 +- > lib/string.c | 6 + > mm/slab_common.c | 5 +- > net/core/skbuff.c | 26 +++ > net/ipv4/tcp_output.c | 5 +- > 68 files changed, 1138 insertions(+), 62 deletions(-) > create mode 100644 Documentation/admin-guide/mds.rst > create mode 100644 Documentation/clearcpu.txt > create mode 100644 arch/x86/include/asm/clearbpf.h > create mode 100644 arch/x86/include/asm/clearcpu.h > create mode 100644 arch/x86/include/asm/trace/clearcpu.h > create mode 100644 arch/x86/lib/clear_cpu.S > create mode 100644 include/linux/clearcpu.h > > -- > 2.17.2