From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 24 Sep 2019 05:05:11 -0000 Received: from mail.kernel.org ([198.145.29.99]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iCd0f-0005SF-D4 for speck@linutronix.de; Tue, 24 Sep 2019 07:05:10 +0200 Date: Tue, 24 Sep 2019 07:04:59 +0200 From: Greg KH Subject: [MODERATED] Re: [PATCH v4 04/10] TAAv4 4 Message-ID: <20190924050459.GA3705@kroah.com> References: <20190904060028.GD7212@kroah.com> <20190906072835.GD13480@guptapadev.amr> <20190906092727.GA16843@kroah.com> <20190910184223.GA7543@guptapadev.amr> <20190910223334.GA21301@kroah.com> <20190911023223.GA8305@guptapadev.amr> <20190923191312.GB161280@kroah.com> <20190923222553.GA2473@guptapadev.amr> MIME-Version: 1.0 In-Reply-To: <20190923222553.GA2473@guptapadev.amr> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Sep 23, 2019 at 03:25:53PM -0700, speck for Pawan Gupta wrote: > On Mon, Sep 23, 2019 at 09:13:12PM +0200, speck for Greg KH wrote: > > > > > > > > $ ls /sys/devices/cpu/ > > > > allow_tsx_force_abort format power type > > > > caps freeze_on_smi rdpmc uevent > > > > events perf_event_mux_interval_ms subsystem > > > > > > > > Oh look, a tsx-specific cpu sysfs file on my laptop... > > > > > > Yes, but these are PMU attributes. > > > https://elixir.bootlin.com/linux/v5.3-rc8/source/arch/x86/events/core.c#L2211 > > > https://elixir.bootlin.com/linux/v5.3-rc8/source/arch/x86/events/core.c#L1831 > > > > Ick, ok, then no, you are back to putting it in /sys/devices/system/cpu/ > > then. > > > > But that "feels" wrong given there really isn't anything else in that > > directory for cpu features like this, they are all buried in the > > individual cpuX directories, right? > > > > Is there any other cpu feature you can turn on/off like this today in > > the system that is controlled in sysfs? If so, where is it at? > > I don't know if it counts, but there is one for turning SMT on/off. > > $ echo off > /sys/devices/system/cpu/smt/control {sigh} Yeah, it looks like you copied some of the logic for creating that file (and that shouldn't be calling sysfs_create_group either, I'll add it to my todo file...) But again, those files are created from arch-independent code. Is tsx in any other processors and should it go into the same file where these smt sysfs files are at, or is it really an Intel-only thing? Either way, my original comment of "do not use sysfs_create_group() when you have a 'struct device'" still stands, that needs to be fixed up no matter what here. greg k-h