Skip to content

use cpuid -r instead of hwloc-gather-cpuid? #219

Open
@bgoglin

Description

@bgoglin

The "cpuid" tool (www.etallen.com/cpuid.html) has a -r option that dumps something very similar to our hwloc-gather-cpuid tool in 2.0. If it's well maintained, we may want to just it and drop our tool.

We'll need to make sure cpuid dump all required combinations of eax/ecx inputs. At least, it seems to miss eax=8000001d ecx>0 for AMD caches (fixed upstream in release 20161201).

Also, it doesn't report invalid sub-leaves that are used as a marker for "no more caches" etc, so we'll have to manually replace those into something that returns 0 in the appropriate registers.

$ cpuid -r
CPU 0:
   0x00000000 0x00: eax=0x0000000d ebx=0x68747541 ecx=0x444d4163 edx=0x69746e65
   0x00000001 0x00: eax=0x00600f12 ebx=0x00100800 ecx=0x1e98220b edx=0x178bfbff
   0x00000002 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000003 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
[...]
   0x0000000d 0x00: eax=0x00000007 ebx=0x00000340 ecx=0x000003c0 edx=0x40000000
   0x0000000d 0x01: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x02: eax=0x00000100 ebx=0x00000240 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x3e: eax=0x00000080 ebx=0x00000340 ecx=0x00000000 edx=0x00000000
   0x80000000 0x00: eax=0x8000001e ebx=0x68747541 ecx=0x444d4163 edx=0x69746e65
[...]
   0x80860000 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0xc0000000 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
CPU 1:
   0x00000000 0x00: eax=0x0000000d ebx=0x68747541 ecx=0x444d4163 edx=0x69746e65
   0x00000001 0x00: eax=0x00600f12 ebx=0x01100800 ecx=0x1e98220b edx=0x178bfbff
   0x00000002 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000003 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000005 0x00: eax=0x00000040 ebx=0x00000040 ecx=0x00000003 edx=0x00000000

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions