From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755814AbeAHH36 (ORCPT + 1 other); Mon, 8 Jan 2018 02:29:58 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:35358 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755336AbeAHH35 (ORCPT ); Mon, 8 Jan 2018 02:29:57 -0500 Date: Mon, 8 Jan 2018 08:29:30 +0100 From: Dominik Brodowski To: Thomas Gleixner 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 Message-ID: <20180108072930.GB26761@light.dominikbrodowski.net> References: <20180107214759.387300853@linutronix.de> <20180107214913.096657732@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180107214913.096657732@linutronix.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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" Thanks, Dominik