Re: [PATCH 0/9] Add CPU-type to topology
From: Pawan Gupta
Date: Tue Jun 18 2024 - 21:53:33 EST
On Tue, Jun 18, 2024 at 02:49:10PM +0200, Brice Goglin wrote:
> Le 17/06/2024 à 11:11, Pawan Gupta a écrit :
> > Hi,
> >
> > This series adds support for CPU-type (CPUID.1A.EAX[31-24] on Intel) to
> > differentiate between hybrid variants P+E, P-only, E-only that share the
> > same Family/Model/Stepping. One of the use case for CPU-type is the
> > affected CPU table for CPU vulnerabilities, which can now use the CPU-type
> > to filter the unaffected variants.
> >
> > * Patch 1 adds cpu-type to CPU topology structure and introduces
> > topology_cpu_type() to get the CPU-type.
> >
> > * Patch 2-4 replaces usages of get_this_hybrid_cpu_type() with
> > topology_cpu_type().
> >
> > * Patch 5-7 Updates CPU-matching infrastructure to use CPU-type.
> >
> > * Patch 8 cleans up the affected CPU list.
> >
> > * Patch 9 uses the CPU-type to exclude P-only parts from the RFDS affected
> > list.
>
>
> Hello
>
> Is there still a plan to expose this info in sysfs?
Sure, if it helps userspace.
> Userspace currently uses frequencies to guess which cores are E or P.
> Intel sent some patches several years ago [1], but they got abandoned
> nowhere as far as I know. There was also some discussion about using a
> "capacity" field like ARM does, but IIRC Intel didn't like the idea in
> the end.
There can be many ways to expose this information in sysfs. Like this ...
> [1] https://lkml.org/lkml/2020/10/2/1208
... exposes /sys/devices/system/cpu/types which, in hybrid parts, creates a
subdirectory for each type of CPU. Each subdirectory contains a CPU list
and a CPU map that user space can query.
The other way is to expose the CPU-type in a file:
/sys/devices/system/cpu/cpuN/type
that could return the CPU-type of the CPU N. Is there a preference?