[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9iXMTIcz5xmqax1@gmail.com>
Date: Mon, 17 Mar 2025 22:42:09 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "Ahmed S. Darwish" <darwi@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Cooper <andrew.cooper3@...rix.com>,
"H. Peter Anvin" <hpa@...or.com>,
John Ogness <john.ogness@...utronix.de>, x86@...nel.org,
x86-cpuid@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 01/29] x86: treewide: Introduce
x86_vendor_amd_or_hygon()
* Ahmed S. Darwish <darwi@...utronix.de> 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)));
And then replace all the above with the much simpler construct of:
if (!boot_cpu_has(X86_FEATURE_ZEN1))
return -ENODEV;
But I'd suggest keeping this patch at the tail of the series, because
if it regresses it would be easier to drop/revert.
Thanks,
Ingo
Powered by blists - more mailing lists