Re: [PATCH v2 01/29] x86: treewide: Introduce x86_vendor_amd_or_hygon()

From: Borislav Petkov
Date: Mon Mar 17 2025 - 17:46:46 EST


On Mon, Mar 17, 2025 at 10:42:09PM +0100, Ingo Molnar wrote:
>
> * Ahmed S. Darwish <darwi@xxxxxxxxxxxxx> wrote:
>
> > - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
> > - boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
> > + if (!x86_vendor_amd_or_hygon(boot_cpu_data.x86_vendor))
> > return -ENODEV;
>
> Could we just not do this?
>
> The above vendor check may or may not be equivalent X86_FEATURE_ZEN1,
> which we could first assert via a single boot-time check:
>
> WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_ZEN1) !=
> ((boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
> boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)));

No, it's not.

Hygon is family 0x18 AFAIK and ZEN1 is not.

Just drop this patch.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette