Home > Linux, Processors > Human Readable Decoding of /proc/cpuinfo for Arm Processors

Human Readable Decoding of /proc/cpuinfo for Arm Processors

February 14th, 2018 Leave a comment Go to comments
Orange Pi Development Boards

One of the most common way to get CPU information is to check the content of /proc/cpuinfo. For example, this is the output I get from running the command on NanoPi NEO (Allwinner H3) board:


Many fields are self-explanatory, but what about CPU implementer and CPU part numbers? Those are values stored in Arm’s CPUID Base Register, and 0x41 looks up to Arm implementer, while 0xc07 refers to Cortex A7. But I had to look it up to find out.

One solution would be to decode those values in the kernel, but the developers won’t do that probably because it may break user-space programs that rely on hexadecimal values. So instead,

In the meantime, I could try it out by compiling the code myself:


Let’s now run our freshly compiled lscpu to see if an Arm Cortex A7 processor is detected:


It works as ARM Cortex-A7 revision 5 is shown. It does not follow Arm’s new lower case logo / name, but who cares 🙂 We can see most of the information provided by /proc/cpuinfo and more, but the BogoMIPS number is different, and the last three lines with Hardware, Revision and Serial are not shown.

It’d be particular interesting to test it on products or boards with processors featuring custom Arm cores such as you should get values like “Qualcomm Krait” or “Marvell PJ4/PJ4b”.

  1. February 14th, 2018 at 17:39 | #1

    Nice, really interesting to check all this Android TV with Amlogic SoC and know info without open the box.

  2. February 14th, 2018 at 17:48 | #2

    @manuti
    You’d need to install Linux, or port lscpu to Android for that. Maybe manual decoding is easier in that case, and the source code – mostly sys-utils/lscpu-arm.h – can help.

    CPU-Z can also do this, but it’s not always reliable.

  3. theguyuk
    February 14th, 2018 at 19:02 | #3

    Perhaps Linux and Android could take example from Windows and have a systems device program built in, to show hardware info.

    I expect such a suggestion to have command line enthusiasts spitting their dummies out. Yet this is 2018, coding by hand in hex, moved on, the command line community, need to move on as well. The word of computing has got big and the one size fits all model is to anal.

  4. Sandbender
    February 14th, 2018 at 19:45 | #4
  5. CampGareth
    February 14th, 2018 at 20:23 | #5

    @theguyuk
    Though we can make a human-readable readout available, it can never be the only thing available. Ultimately everything’s still a bunch of 1s and 0s so some part of my PC can only process the hexadecimal form.

  6. fossxplorer
    February 14th, 2018 at 21:03 | #6

    Ran it on a RK3328 SoC:
    # ./lscpu
    Architecture: aarch64
    Byte Order: Little Endian
    CPU(s): 4
    On-line CPU(s) list: 0-3
    Thread(s) per core: 1
    Core(s) per socket: 4
    Socket(s): 1
    Vendor ID: ARM
    Model: 4
    Model name: Cortex-A53
    Stepping: r0p4
    CPU max MHz: 1296.0000
    CPU min MHz: 408.0000
    BogoMIPS: 48.00
    Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32
    [email protected]:~/tmp/util-linux#

  7. tkaiser
    February 14th, 2018 at 21:59 | #7

    Weird, a tool suited for human beings displays this BogoMIPS BS (especially on ARM): en.wikipedia.org/wiki/BogoMips#Timer-based_delays

    @fossxplorer
    If you compare the Flags above with the following is this the same? Which kernel version are you running?

  8. Joe Bleau
    February 15th, 2018 at 00:38 | #8

    r-pi 3 B:
    Architecture: armv7l
    Byte Order: Little Endian
    CPU(s): 4
    On-line CPU(s) list: 0-3
    Thread(s) per core: 1
    Core(s) per socket: 4
    Socket(s): 1
    Vendor ID: ARM
    Model: 4
    Model name: Cortex-A53
    Stepping: r0p4
    CPU max MHz: 1200.0000
    CPU min MHz: 600.0000
    BogoMIPS: 76.80
    Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

    uname -a:
    Linux pi7 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

    grep ‘^Features’ /proc/cpuinfo:
    Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
    Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
    Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
    Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

  9. Steve G
    February 15th, 2018 at 03:49 | #9

    Sheevaplug Armv5
    # cat /proc/cpuinfo
    processor: 0
    model name: Feroceon 88FR131 rev 1 (v5l)
    BogoMIPS: 400.00
    Features: swp half thumb fastmult edsp
    CPU implementer: 0x56
    CPU architecture: 5TE
    CPU variant: 0x2
    CPU part: 0x131
    CPU revision: 1

    Hardware: Marvell Kirkwood (Flattened Device Tree)
    Revision: 0000
    Serial: 0000000000000000

    [email protected]:/opt/util-linux# uname -a
    Linux buster 4.14.0-3-marvell #1 Debian 4.14.13-1 (2018-01-14) armv5tel GNU/Linux

    [email protected]:/opt/util-linux# ./lscpu
    Architecture: armv5tel
    Byte Order: Little Endian
    CPU(s): 1
    On-line CPU(s) list: 0
    Thread(s) per core: 1
    Core(s) per socket: 1
    Socket(s): 1
    Vendor ID: Marvell
    Model: 1
    Model name: Feroceon 88FR131
    Stepping: 0x2
    CPU max MHz: 1200.0000
    CPU min MHz: 400.0000
    BogoMIPS: 400.00
    Flags: swp half thumb fastmult edsp

  10. Steve G
    February 15th, 2018 at 04:28 | #10

    QEMU-aarch64 [Cortex53]

    [email protected]:/opt/src/util-linux# cat /proc/cpuinfo
    processor: 0
    BogoMIPS: 125.00
    Features: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
    CPU implementer: 0x41
    CPU architecture: 8
    CPU variant: 0x0
    CPU part: 0xd03
    CPU revision: 4

    processor: 1
    BogoMIPS: 125.00
    Features: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
    CPU implementer: 0x41
    CPU architecture: 8
    CPU variant: 0x0
    CPU part: 0xd03
    CPU revision: 4

    [email protected]:/opt/src/util-linux# uname -a
    Linux busteraarch64 4.14.0-3-arm64 #1 SMP Debian 4.14.13-1 (2018-01-14) aarch64 GNU/Linux

    [email protected]:/opt/src/util-linux# ./lscpu
    Architecture: aarch64
    Byte Order: Little Endian
    CPU(s): 2
    On-line CPU(s) list: 0,1
    Thread(s) per core: 1
    Core(s) per socket: 2
    Socket(s): 1
    NUMA node(s): 1
    Vendor ID: ARM
    Model: 4
    Model name: Cortex-A53
    Stepping: r0p4
    BogoMIPS: 125.00
    NUMA node0 CPU(s): 0,1
    Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

  11. Riku Voipio
    February 15th, 2018 at 21:46 | #11

    For the compilation instrucions, you can build just lscpu from the source tree:

    make lscpu

    util-linux 2.32 was just released, so you may want to nag your favourite distros to update util-linux.

  12. tkaiser
    February 16th, 2018 at 01:52 | #12

    @Riku Voipio
    What @Steve G posted above:

    Do you consider this being a bug?

  13. Riku Voipio
    February 16th, 2018 at 17:25 | #13

    @tkaiser
    That doesn’t say “0 CPU(s) online”, but that “cpu number 0 is online”.

  1. No trackbacks yet.