Re: [RFC PATCH] x86/cpu: Change AMD uarch detection

From: Sean Christopherson

Date: Wed Oct 28 2026 - 10:11:04 EST


On Tue, Oct 27, 2026, Borislav Petkov wrote:
> On Tue, Oct 27, 2026 at 08:20:49AM -0700, Sean Christopherson wrote:
> > This is better than X86_FEATURE_ZENx, as I always found the lack of inclusivity,
> > e.g. ZEN4 not lighting up ZEN3, to be confusing/surprising.
>
> Yeah, I didn't think of this simple scheme back then.
>
> > But why invent another scheme? What stops AMD from implementing precise macros
> > as arch/x86/include/asm/intel-family.h does? Providing range-based checks would
> > "just" require more macros, no?
>
> That's exactly the reason - moar macros. I wanna keep it simple and instead of
> having at least 5 OR_LATER macros, I wanna simply do:
>
> if x86_uarch >= AMD_UARCH...
>
> And who knows, if in the future the scheme becomes even simpler, like it was
> before, we won't need those either.
>
> But I might keep the uarch checks even then because this is a lot more telling
> - we want the microarchitecture version, not some family, model or stepping.
>
> And mapping f/m/s to uarch we already do.

I don't particularly care what the interface is, but as a "downstream" user, it
would be helpful if Intel and AMD used the same scheme(s).

And FWIW, providing the human-friendly codenames is very helpful even if they're
almost never used in code. E.g. effectively documenting that Turin is Zen5, Genoa
is Zen4, Milan is Zen3, and so on is helpful, because even with search+AI, it's
hard to find information you don't realize you're missing. Though that's probably
orthogonal to the interface.