[ITP] cpuid

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Sat Feb 22 16:59:00 GMT 2020

On 2020-02-21 23:24, Marco Atzeri wrote:
> Am 22.02.2020 um 05:49 schrieb Brian Inglis:
>> I would like to offer to package cpuid:
>>     dumps CPUID information about the CPU(s)
>> The program dumps detailed information about the CPU(s) gathered from
>> the CPUID instruction, and also determines the exact model of CPU(s).
>> Whereas /proc/cpuinfo is like an abstract of the features important to
>> Linux in a system, cpuid is a standalone utility which writes a paper
>> expounding on every feature in each CPU's architecture and what it can
>> do, at about the one line per bit level.
> build fine, but while cpuid produces an output
> cpuinfo2cpuid seems stack waiting for some inputs
> any suggestion ?

man cpuinfo2cpuid -- expects < /proc/cpuinfo and dumps a couple of fake raw regs
which you can feed back into cpuid to get a garrulously inaccurate report:

	$ cpuinfo2cpuid < /proc/cpuinfo | tee /dev/stderr | cpuid -f -

> In addition the cpu count 16 is baffling as i5-8250 is a 4+4 CPU
> CPU 7:
>       cpu count                      = 0x10 (16)
>       0xff: cache data is in CPUID leaf 4
>       index of CPU's row in feedback struct   = 0x0 (0)
>    brand = "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz"
>       number of CPU cores                 = 0x1 (1)

That cpu count and its neighbours are just a straight byte dump from CPUID fn 1
xfn 0 ebx - from MSB lapicid lpus clflsh brandid - look at cpuid -r third line
0x00000001 0x00: eax=... ebx= second MSB should be e.g. 0x00100801 - x10 -
compare /proc/cpuinfo for comparable cores and siblings counts:

	$ egrep 'cpu cores|siblings' /proc/cpuinfo

The 16 is (to us) inexplicable (and could be an erratum) but cores shown by
CPUID and the values are totally up to the Intel product line, its designers,
and how they see the topology and choose to indicate it.
Intel has come up with a bunch of random decisions and values over the years.
They and Microsoft make suitable partners, and both keep developers in work
handling pointless quirks!
AMD keeps mainly to their CPUID architecture manual, although compatibility with
Intel sometimes challenges that, but they often just reserve some bits used by
Intel and stick to their own way, which seems a lot more orthogonal and regular:
having an architecture manual, reading it, and using it will do that for you.

Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

More information about the Cygwin-apps mailing list