Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755905AbeAHHdx (ORCPT + 1 other); Mon, 8 Jan 2018 02:33:53 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:48685 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755820AbeAHHdw (ORCPT ); Mon, 8 Jan 2018 02:33:52 -0500 Date: Mon, 8 Jan 2018 08:33:43 +0100 (CET) From: Thomas Gleixner To: Dominik Brodowski cc: LKML , Linus Torvalds , Greg Kroah-Hartman , Ingo Molnar , Peter Zijlstra , Borislav Petkov , David Woodhouse , Dave Hansen , Will Deacon Subject: Re: [patch V2 1/2] sysfs/cpu: Add vulnerability folder In-Reply-To: <20180108072930.GB26761@light.dominikbrodowski.net> Message-ID: References: <20180107214759.387300853@linutronix.de> <20180107214913.096657732@linutronix.de> <20180108072930.GB26761@light.dominikbrodowski.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 8 Jan 2018, Dominik Brodowski wrote: > On Sun, Jan 07, 2018 at 10:48:00PM +0100, Thomas Gleixner wrote: > > As the meltdown/spectre problem affects several CPU architectures, it makes > > sense to have common way to express whether a system is affected by a > > particular vulnerability or not. If affected the way to express the > > mitigation should be common as well. > > > > Create /sys/devices/system/cpu/vulnerabilities folder and files for > > meltdown, spectre_v1 and spectre_v2. > > > > Allow architectures to override the show function. > > > > Signed-off-by: Thomas Gleixner > > --- > > Documentation/ABI/testing/sysfs-devices-system-cpu | 16 +++++++ > > drivers/base/Kconfig | 3 + > > drivers/base/cpu.c | 48 +++++++++++++++++++++ > > include/linux/cpu.h | 7 +++ > > 4 files changed, 74 insertions(+) > > > > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > > @@ -373,3 +373,19 @@ Contact: Linux kernel mailing list > Description: information about CPUs heterogeneity. > > > > cpu_capacity: capacity of cpu#. > > + > > +What: /sys/devices/system/cpu/vulnerabilities > > + /sys/devices/system/cpu/vulnerabilities/meltdown > > + /sys/devices/system/cpu/vulnerabilities/spectre_v1 > > + /sys/devices/system/cpu/vulnerabilities/spectre_v2 > > +Date: Januar 2018 > > +Contact: Linux kernel mailing list > > +Description: Information about CPU vulnerabilities > > + > > + The files are named after the code names of CPU > > + vulnerabilities. The output of those files reflects the > > + state of the CPUs in the system. > > Currently, your code sets X86_BUG_SPECTRE_V[12] unconditionally on x86 > CPUs. However, to my understanding some CPUs which do not execute code > out-of-order aren't affected. As it is better to err on the safe side for > now, what about adding a disclaimer at the end of this sentence, such as: > > ", but may contain false positives" We do that in the same way as we did with BUG_INSECURE (now MELTDOWN). Err out on the safe side and get the exceptions in place when people are confident about them. It's not going to take long I assume. Thanks, tglx