[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8r5E3wfFyv-n8XK@lx-t490>
Date: Fri, 7 Mar 2025 14:48:03 +0100
From: "Ahmed S. Darwish" <darwi@...utronix.de>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Cooper <andrew.cooper3@...rix.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
John Ogness <john.ogness@...utronix.de>, x86-cpuid@...ts.linux.dev,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 07/12] tools/x86/kcpuid: Add rudimentary CPU vendor
detection
On Thu, 06 Mar 2025, Dave Hansen wrote:
>
> So, this is cute and all. But isn't it a _wee_ bit too clever for its
> own good?
>
That was funny, thanks for the laugh :)
> Why not just have a dumb array:
>
> { INTEL, "GenuineIntel" },
> { AMD, "AuthenticAMD" ],
> ...
>
> Are we really looking to save a few dozen CPU cycles in this thing? It
> took me at least a minute or two of staring at this thing to figure out
> what the heck it was doing.
>
Indeed.
For some reason I forgot that this is all little-endian and a simple
strcmp() like what the kernel does at get_cpu_vendor() would suffice.
I'll fix it in v2.
Thanks!
Ahmed
Powered by blists - more mailing lists