Re: [PATCH 3/3] arm64 cpuinfo: implement sysfs nodes for arm64
From: Thomas Renninger
Date: Tue Dec 10 2019 - 08:33:12 EST
On Monday, December 9, 2019 6:38:05 PM CET Will Deacon wrote:
> On Mon, Dec 09, 2019 at 12:28:44PM +0100, Thomas Renninger wrote:
> > 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@xxxxxxx>
> > > >
> > > > 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
Again: proc is moving to sys.
You probably export feature flags in /proc/cpuinfo for a good reason.
So where in sysfs should this show up?
> Even if we exposed them via sysfs, existing
> software will continue to grep them out of /proc/cpuinfo because it's more
> reliable and new software would still be encouraged to use either the HWCAPs
> directly or, even better, our CPUID (MRS) emulation.
Ok, so /proc/cpuinfo
Features:
is deprecated on arm64. Is that correct?
Then it would indeed not make sense to port it/anything to sys.
It is this comment you are referring to:
arch/arm64/kernel/cpuinfo.c
* Dump out the common processor features in a single line.
* Userspace should read the hwcaps with getauxval(AT_HWCAP)
* rather than attempting to parse this, but there's a body of
* software which does already (at least for 32-bit).
Then let's shorten this.
Sorry for keep digging/asking.
Felix made this up rather neat, so that other archs can implement to expose
sysfs CPU info easy and consistent.
While x86 also ported parts of cpuinfo, e.g. microcode version, most general
info is still missing in sysfs.
If I find the time, I may check for other archs like ppc64le or s390x to find
data which still should show up in sysfs and could then be put in the same
directory/file structure.
ARM people may still want to make use of this at some point of time, if
appropriate. I'll drop patch 3/3.
Thanks for explaining me the ARM details,
Thomas