[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ada12f8-4fdb-4dad-90f7-b044993e829c@intel.com>
Date: Thu, 6 Mar 2025 14:00:52 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: "Ahmed S. Darwish" <darwi@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Ingo Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>
Cc: 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 3/6/25 12:49, Ahmed S. Darwish wrote:
> +/*
> + * Leaf 0x0 EDX output, CPU vendor ID string bytes 4 - 7.
> + */
> +enum {
> + EDX_INTEL = fourcc('i', 'n', 'e', 'I'), /* Genu_ineI_ntel */
> + EDX_AMD = fourcc('e', 'n', 't', 'i'), /* Auth_enti_cAMD */
> + EDX_HYGON = fourcc('n', 'G', 'e', 'n'), /* Hygo_nGen_uine */
> + EDX_TRANSMETA = fourcc('i', 'n', 'e', 'T'), /* Genu_ineT_Mx86 */
> + EDX_CENTAUR = fourcc('a', 'u', 'r', 'H'), /* Cent_aurH_auls */
> + EDX_ZHAOXIN = fourcc('a', 'n', 'g', 'h'), /* Sh_angh_ai */
> +};
So, this is cute and all. But isn't it a _wee_ bit too clever for its
own good?
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.
Powered by blists - more mailing lists