From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754715AbeAGVj4 (ORCPT + 1 other); Sun, 7 Jan 2018 16:39:56 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:47863 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754599AbeAGVjz (ORCPT ); Sun, 7 Jan 2018 16:39:55 -0500 Date: Sun, 7 Jan 2018 22:39:45 +0100 (CET) From: Thomas Gleixner To: Greg Kroah-Hartman cc: LKML , Linus Torvalds , Ingo Molnar , Peter Zijlstra , Borislav Petkov , David Woodhouse , "Hansen, Dave" Subject: Re: [patch 1/2] sysfs/cpu: Add vulnerability folder In-Reply-To: <20180107211951.GA26115@kroah.com> Message-ID: References: <20180107205749.938016669@linutronix.de> <20180107210716.820339827@linutronix.de> <20180107211951.GA26115@kroah.com> 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 Sun, 7 Jan 2018, Greg Kroah-Hartman wrote: > > drivers/base/Kconfig | 3 +++ > > drivers/base/cpu.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > > include/linux/cpu.h | 7 +++++++ > > 3 files changed, 58 insertions(+) > > A Documentation/ABI/ update is needed for the new sysfs files. Sure. > > +#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES > > + > > +ssize_t __weak cpu_show_meltdown(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + return snprintf(buf, PAGE_SIZE - 2, "Not affected\n"); > > sysfs is one-value-per-file, so you never need to care about the page > size, a simple sprintf() is fine. No need to change if you don't want > to, your call. Done. > > +static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL); > > DEVICE_ATTR_RO() please. > > Yeah, that does make the global symbols a bit different, meltdown_show() > and the like. Hm, I guess this is ok, given that it's ment to be > overridden. That and I expect that in the not so distant future we'll see write functions as well. > Oh, nevermind. So, just a documentation update please, that can always > be an add-on patch if you promise to do it :) You should never make such offers. These promises land on that growth only thingy, aka. todo list :) Thanks, tglx