lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ACEDD5B5-8C43-46ED-9C32-4E1DC2A0948C@zytor.com>
Date: Fri, 07 Mar 2025 07:46:21 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: "Ahmed S. Darwish" <darwi@...utronix.de>,
        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>, 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 March 7, 2025 5:48:03 AM PST, "Ahmed S. Darwish" <darwi@...utronix.de> wrote:
>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

memcmp()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ