Re: [PATCH v1 07/12] tools/x86/kcpuid: Add rudimentary CPU vendor detection

From: Dave Hansen
Date: Fri Mar 07 2025 - 10:03:41 EST


On 3/6/25 12:49, Ahmed S. Darwish wrote:
> The kcpuid CSV file will soon be updated with CPUID indices that are only
> valid for certain CPU vendors, such as Centaur or Transmeta. Thus,
> introduce rudimentary x86 vendor detection to kcpuid.

Do we really need the vendor detection? For example, look at the end of
cpuid(1)'s output:

# cpuid -1 --raw
...
0x20000000 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000
edx=0x00000000
...
0x80860000 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000
edx=0x00000000
0xc0000000 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000
edx=0x00000000

It seems to just blindly poke at all of the CPUID regions. There are
only a handful of these and there's no hard in poking at them other
than an extra couple of executions of CPUID.