Re: [PATCH v2 06/10] x86/mce: Convert multiple if () statements into a switch() statement

From: Sohil Mehta
Date: Mon Oct 21 2024 - 18:57:33 EST


On 10/21/2024 11:40 AM, Luck, Tony wrote:
>>> Intel model number allocation policies aren't necessarily sequential.
>>
>> Model numbers are assumed to be sequential at least within family 6.
>
> Assumption can only be applied retroactively to simpler times. Looking
> at the timelines and model numbers for pure-Atom, pure-Core, Hybrid,
> and Xeon, they are somewhat jumbled.
>

Agreed. Using range checks within a family with extreme care and
avoiding cross-family ones seems like the saner thing to do.

Maybe everything in the future is enumerated and VFM checks would not be
needed :)

Trying to understand more, I have more questions than answers. With the
introduction of Family 0x19, do we need to reevaluate some of the
existing model checks?

early_init_intel():
if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
(c->x86 == 0x6 && c->x86_model >= 0x0e))
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);

It seems "constant_tsc" wouldn't show on Diamond rapids. Do we need it to?

> Qiuxu starts the function with:
>
> + /* Older CPUs don't need quirks. */
> + if (c->x86 < 6)
> + return;
>
> So Quark leaves the function early.
>

Ah! My bad, I missed that.

> -Tony
>
>