All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Will Deacon <will@kernel.org>, Felix Schnizlein <fschnizlein@suse.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	Felix Schnizlein <fschnizlein@suse.de>,
	linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux@armlinux.org.uk, will.deacon@arm.com, x86@kernel.org
Subject: Re: [PATCH 3/3] arm64 cpuinfo: implement sysfs nodes for arm64
Date: Mon, 09 Dec 2019 12:28:44 +0100	[thread overview]
Message-ID: <25032400.G9DUGnJgnc@skinner.arch.suse.de> (raw)
In-Reply-To: <20191209103110.GB3306@willie-the-truck>

On Monday, December 9, 2019 11:31:11 AM CET Will Deacon wrote:
> On Fri, Dec 06, 2019 at 05:24:21PM +0100, Thomas Renninger wrote:
> > From: Felix Schnizlein <fschnizlein@suse.de>
> > 
> > Export all information from /proc/cpuinfo to sysfs:
> > implementer, architecture, variant, part, revision,
> > bogomips and flags are exported.
> > 
> > Example:
> > /sys/devices/system/cpu/cpu1/info/:[0]# head *

...

> > ==> flags <==
> > fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid asimdrdm
 
...

> I don't understand why we need this on arm64

The first intention of these patches is to port x86 /proc/cpuinfo.

Because of the divergence of /proc/cpuinfo and the totally different
info exported there across architectures,
therefore it is also tried to get a unified interface across architectures 
where possible.

So for flags and bugs this may work out, right?

For the rest, it looks like people again only had their CPU in mind and
exported to userspace what currently was needed...

> and why it's an improvement
> over all the other schemes we already support for identifying CPU features.

Sigh...

> Given the pain we've endured over the years exposing this sort of stuff to
> userspace, I'm relucant to add more just for the fun of it.

If there should ever be something like a string describing the CPU...
In x86 it comes from the CPU itself.
Maybe we get a model description at some point as well...

Or any other entity which may also get exported on other archs..

Please remember this interface and watch out whether you could export
things under the same name as done on other architectures.

I'll revert everything but flags for ARM now.
But this is the best example for the need of a generic interface:

x86 -   /proc/cpuinfo:
flags           : ...
arm64 - /proc/cpuinfo:
Features        : ...

even it is exactly the same kernel interface, even x86 flags are used 
according to arch/arm64/include/asm/cpufeature.h:

  * We use arm64_cpu_capabilities to represent system features, errata work

But it is named differently in /proc/cpuinfo.
This should not happen again in /sys/...

    Thomas



WARNING: multiple messages have this Message-ID (diff)
From: Thomas Renninger <trenn@suse.de>
To: Will Deacon <will@kernel.org>, Felix Schnizlein <fschnizlein@suse.com>
Cc: linux-arch@vger.kernel.org,
	Felix Schnizlein <fschnizlein@suse.de>,
	gregkh@linuxfoundation.org, x86@kernel.org, will.deacon@arm.com,
	linux@armlinux.org.uk, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64 cpuinfo: implement sysfs nodes for arm64
Date: Mon, 09 Dec 2019 12:28:44 +0100	[thread overview]
Message-ID: <25032400.G9DUGnJgnc@skinner.arch.suse.de> (raw)
In-Reply-To: <20191209103110.GB3306@willie-the-truck>

On Monday, December 9, 2019 11:31:11 AM CET Will Deacon wrote:
> On Fri, Dec 06, 2019 at 05:24:21PM +0100, Thomas Renninger wrote:
> > From: Felix Schnizlein <fschnizlein@suse.de>
> > 
> > Export all information from /proc/cpuinfo to sysfs:
> > implementer, architecture, variant, part, revision,
> > bogomips and flags are exported.
> > 
> > Example:
> > /sys/devices/system/cpu/cpu1/info/:[0]# head *

...

> > ==> flags <==
> > fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid asimdrdm
 
...

> I don't understand why we need this on arm64

The first intention of these patches is to port x86 /proc/cpuinfo.

Because of the divergence of /proc/cpuinfo and the totally different
info exported there across architectures,
therefore it is also tried to get a unified interface across architectures 
where possible.

So for flags and bugs this may work out, right?

For the rest, it looks like people again only had their CPU in mind and
exported to userspace what currently was needed...

> and why it's an improvement
> over all the other schemes we already support for identifying CPU features.

Sigh...

> Given the pain we've endured over the years exposing this sort of stuff to
> userspace, I'm relucant to add more just for the fun of it.

If there should ever be something like a string describing the CPU...
In x86 it comes from the CPU itself.
Maybe we get a model description at some point as well...

Or any other entity which may also get exported on other archs..

Please remember this interface and watch out whether you could export
things under the same name as done on other architectures.

I'll revert everything but flags for ARM now.
But this is the best example for the need of a generic interface:

x86 -   /proc/cpuinfo:
flags           : ...
arm64 - /proc/cpuinfo:
Features        : ...

even it is exactly the same kernel interface, even x86 flags are used 
according to arch/arm64/include/asm/cpufeature.h:

  * We use arm64_cpu_capabilities to represent system features, errata work

But it is named differently in /proc/cpuinfo.
This should not happen again in /sys/...

    Thomas



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-12-09 11:28 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 16:24 [PATCH v5 0/3] sysfs: add sysfs based cpuinfo Thomas Renninger
2019-12-06 16:24 ` Thomas Renninger
2019-12-06 16:24 ` [PATCH 1/3] cpuinfo: add sysfs based arch independent cpuinfo framework Thomas Renninger
2019-12-06 16:24   ` Thomas Renninger
2019-12-06 16:33   ` Greg KH
2019-12-06 16:33     ` Greg KH
2019-12-06 16:33     ` Greg KH
2019-12-06 16:56   ` Randy Dunlap
2019-12-06 16:56     ` Randy Dunlap
2019-12-06 16:56     ` Randy Dunlap
2019-12-06 16:24 ` [PATCH 2/3] x86 cpuinfo: implement sysfs nodes for x86 Thomas Renninger
2019-12-06 16:24   ` Thomas Renninger
2019-12-06 16:36   ` Greg KH
2019-12-06 16:36     ` Greg KH
2019-12-10 20:48     ` Thomas Gleixner
2019-12-10 20:48       ` Thomas Gleixner
2019-12-10 20:53       ` Greg KH
2019-12-10 20:53         ` Greg KH
2019-12-11 10:42       ` Thomas Renninger
2019-12-11 10:42         ` Thomas Renninger
2019-12-11 13:56         ` Greg KH
2019-12-11 13:56           ` Greg KH
2019-12-11 14:12           ` Thomas Renninger
2019-12-11 14:12             ` Thomas Renninger
2019-12-11 14:26             ` Greg KH
2019-12-11 14:26               ` Greg KH
2019-12-11 14:52               ` Thomas Renninger
2019-12-11 14:52                 ` Thomas Renninger
2019-12-11 14:57                 ` Greg KH
2019-12-11 14:57                   ` Greg KH
2019-12-06 16:24 ` [PATCH 3/3] arm64 cpuinfo: implement sysfs nodes for arm64 Thomas Renninger
2019-12-06 16:24   ` Thomas Renninger
2019-12-06 16:37   ` Greg KH
2019-12-06 16:37     ` Greg KH
2019-12-09 10:31   ` Will Deacon
2019-12-09 10:31     ` Will Deacon
2019-12-09 11:28     ` Thomas Renninger [this message]
2019-12-09 11:28       ` Thomas Renninger
2019-12-09 17:38       ` Will Deacon
2019-12-09 17:38         ` Will Deacon
2019-12-10 13:33         ` Thomas Renninger
2019-12-10 13:33           ` Thomas Renninger
2019-12-10 14:47           ` Greg KH
2019-12-10 14:47             ` Greg KH
2019-12-10 16:24             ` Thomas Renninger
2019-12-10 16:24               ` Thomas Renninger
2019-12-06 16:58 ` [PATCH v5 0/3] sysfs: add sysfs based cpuinfo Mark Rutland
2019-12-06 16:58   ` Mark Rutland
2019-12-06 17:29   ` Thomas Renninger
2019-12-06 17:29     ` Thomas Renninger
2019-12-06 18:16     ` Mark Rutland
2019-12-06 18:16       ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25032400.G9DUGnJgnc@skinner.arch.suse.de \
    --to=trenn@suse.de \
    --cc=fschnizlein@suse.com \
    --cc=fschnizlein@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=will.deacon@arm.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.