Re: [PATCH PATCH 1/9] x86/cpu/topology: Add x86_cpu_type to struct cpuinfo_topology

Dave Hansen
2024-06-18T22:03:31Z

On 6/18/24 14:33, Mario Limonciello wrote:
>> +enum x86_topo_cpu_type {
>> +    X86_CPU_TYPE_UNKNOWN        = 0,
>> +    X86_CPU_TYPE_INTEL_ATOM        = 0x20,
>> +    X86_CPU_TYPE_INTEL_CORE        = 0x40,
>> +};
>> +
...
> What do you think about having a common enum rather with words that are
> marketing strings?

They're not really marketing strings. They really are architectural and
have specific functional meaning just like ->x86_model and ->x86_family.

For instance, we are effectively doing this today:

if (c->cpu_x86_vfm == INTEL_ALDER_LAKE &&
c->cpu_type == X86_CPU_TYPE_INTEL_ATOM)
setup_force_cpu_bug(FOO);

That check is truly specific to the core being an "ATOM" and not being
an efficient core. There might be a future non-Atom efficient CPU or a
future non-Core performance CPU.

We very well might have a use in the future to tag a processor as
"efficient" or "performance" in a vendor-neutral manner. That mechanism
could very well be derived from ->cpu_type. But I think that's actually
independent from Pawan's series.