Bug 1882740

Summary: lscpu: use SMBIOS Type 4 strings for CPU vendor and model on ARM
Product: Red Hat Enterprise Linux 8 Reporter: Jeff Bastian <jbastian>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: low Docs Contact:
Priority: medium    
Version: 8.3CC: ahs3, efuller, jlinton, mas, mmizuma, pbunyan
Target Milestone: rc   
Target Release: 8.4   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: util-linux-2.32.1-25.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:08:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Bastian 2020-09-25 14:08:41 UTC
Description of problem:
lscpu on ARM has a hard-coded table of CPU vendors and model strings since ARM does not have a CPUID instruction to provide these strings like x86.  Unfortunately this table gets stale as new CPU models are released.  Instead, lscpu should use the SMBIOS Type 4 data to find the strings, at least on systems that provide SMBIOS which includes all SBBR compliant servers.

A proposed patch is posted to the util-linux-ng mailing list:
https://www.spinics.net/lists/util-linux-ng/msg16495.html

Version-Release number of selected component (if applicable):
util-linux-2.32.1-24.el8.aarch64

How reproducible:
always

Steps to Reproduce:
1. run lscpu on a system with an Ampere eMAG CPU such as a Lenovo HR330A or HR350A

Actual results:
lscpu labels the system as an APM X-Gene which is confusing but technically correct given the history: the eMAG was originally the X-Gene 3, but AppliedMicro was acquired by Macom, then the CPU team was split into a new company named Ampere, and X-Gene was renamed to eMAG.

[root@lenovo-hr330a ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           APM
Model:               2
Model name:          X-Gene
Stepping:            0x3


Expected results:
lscpu shows the new eMAG name:

[root@lenovo-hr330a ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       Ampere(TM)
Model:                           2
Model name:                      eMAG
Stepping:                        0x3


Additional info:

Comment 1 Jeff Bastian 2020-09-25 14:24:46 UTC
Another example using an Amazon AWS m6g.large instance:

[ec2-user@ip-172-31-81-6 ~]$ /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           ARM
Model:               1
Stepping:            r3p1

[ec2-user@ip-172-31-81-6 ~]$ ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       ARM
Model:                           1
Model name:                      Neoverse-N1
Stepping:                        r3p1



And one more using an Ampere Altra:

[root@ampere-altra-01 ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           ARM
Model:               1
Stepping:            r3p1

[root@ampere-altra-01 ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       Ampere(TM)
Model:                           1
Model name:                      Ampere(TM) Altra(TM) Processor
Stepping:                        0x3

Comment 5 Jeremy Linton (ARM) 2020-10-26 15:06:00 UTC
Just pulling the RHEL lscpu-arm.c file forward to get the updated tables is going to fix a bunch of these. Its almost the kind of thing that need to be done for every point release, as that is about the frequency of updates.

Comment 6 Masayoshi Mizuma (Fujitsu) 2020-11-09 03:10:28 UTC
Hi Jeff and Jeremy,

I posted two patches related to lscpu module name issue.
I would appreciate it if you could review them.

https://marc.info/?l=util-linux-ng&m=160489105817625&w=2
https://marc.info/?l=util-linux-ng&m=160489105817626&w=2

Thanks!
Masa

Comment 7 Jeremy Linton (ARM) 2020-11-10 04:26:36 UTC
Yes, it looks like my comments in IRC made it to you. I will see if I can pick up the thread in my email client.

As a future ref though, please cc jeremy.linton on these kinds of patches. Thanks,

Comment 8 Karel Zak 2020-12-17 09:09:05 UTC
Masa, Jeff, and Jeremy, I need your help with the backport verification.       
Please, try the build below on your ARMs.                            
                                                                         
Note that I have worked on bug #1882740 and bug #1883056 together.       
                                                                         
I have backported all the ARM related patches -- note that simple git-cherry-pick to the 
old RHEL-8 code was impossible in some cases.                            
                                                                         
RHEL-8 Commits:                                                          
                                                                         
lscpu: (arm) read vendor and model from BIOS                             
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/880958fe818c5bc9fb4a1a1cdcd241d90e7fb179
                                                                         
lscpu: show physical socket on aarch64 without ACPI PPTT                 
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/5b20e51f98798161138f0758af845c43931f59ba
                                                                         
lscpu: add helper to get physical sockets                                
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/32c4fe66ae9107a7fae556be02c1401e5046071b
                                                                         
lscpu-dmi: split to parse dmi table                                      
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/60a1a900b22e6d714fbbde03322569ad4732b4ba
                                                                         
lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT       
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/63d8d3e8d54326842677bc3d3a3e43a133846a71
                                                                         
lscpu: update ARM identifiers tables                                     
https://gitlab.cee.redhat.com/kzak/util-linux/-/commit/6700a458ef1bcd8fe2c066411bc415bc43ccdb8a
                                                                         
                                                                         
Build: util-linux-2.32.1-25.el8                                          
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=33817025     
                                                                         
(I can copy the RPMs to another place if you have no access to brew web.)

Comment 11 Karel Zak 2021-01-19 09:24:56 UTC
Masa, Jeff, and Jeremy, can you test RHEL8.4 lscpu? (see comment #8)

Thanks!

Comment 12 Jeff Bastian 2021-01-19 15:06:53 UTC
Output of lscpu from util-linux-2.32.1-26.el8 on several different aarch64
systems in our Beaker lab.  I checked both as root and a "test" user.

====================
Amazon AWS m6g.metal
====================

[ec2-user ~]$ sudo dmidecode | grep -i -m1 "Product Name:"
        Product Name: m6g.metal

[ec2-user ~]$ sudo lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

[ec2-user ~]$ lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

====================
Amazon AWS m6g.large
====================

[ec2-user ~]$ sudo dmidecode | grep -i -m1 "Product Name:"
        Product Name: m6g.large

[ec2-user ~]$ sudo lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
BIOS Vendor ID:      AWS
Model:               1
Model name:          Neoverse-N1
BIOS Model name:     AWS Graviton2
Stepping:            r3p1

[ec2-user ~]$ lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

====================
Amazon AWS t4g.large
====================

[ec2-user ~]$ sudo dmidecode | grep -i -m1 "Product Name:"
        Product Name: t4g.large

[ec2-user ~]$ sudo lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
BIOS Vendor ID:      AWS
Model:               1
Model name:          Neoverse-N1
BIOS Model name:     AWS Graviton2
Stepping:            r3p1

[ec2-user ~]$ lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

============
Ampere Altra
============

[root@ampere-altra ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
BIOS Vendor ID:      Ampere(TM)
Model:               1
Model name:          Neoverse-N1
BIOS Model name:     Ampere(TM) Altra(TM) Processor
Stepping:            r3p1

[root@ampere-altra ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

=======================
AppliedMicro Mustang B0
=======================

[root@apm-mustang-b0 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
BIOS Vendor ID:      AmpereComputing(R)
Model:               1
Model name:          X-Gene
BIOS Model name:     B0
Stepping:            0x0

[root@apm-mustang-b0 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
Model:               1
Model name:          X-Gene
Stepping:            0x0

=================
Broadcom Stingray
=================

[root@broadcom-stingray ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:            ARM
BIOS Vendor ID:       ARM
Model:                3
Model name:           Cortex-A72
BIOS Model name:      v8
Stepping:             r0p3

[root@broadcom-stingray ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:            ARM
Model:                3
Model name:           Cortex-A72
Stepping:             r0p3

============
Cavium Sabre
============

[root@cavium-sabre ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      Cavium Inc.
Model:               1
Model name:          ThunderX2 99xx
BIOS Model name:     Cavium ThunderX2(R) CPU CN9975 v2.1 @ 2.20GHz
Stepping:            0x1

[root@cavium-sabre ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX2 99xx
Stepping:            0x1

=============
Fujitsu FX700
=============

[root@fujitsu-fx700 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
BIOS Vendor ID:      FUJITSU
Model:               0
Model name:          A64FX
BIOS Model name:     461F0010
Stepping:            0x1

[root@fujitsu-fx700 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
Model:               0
Model name:          A64FX
Stepping:            0x1

=============
Gigabyte R120
=============

[root@gigabyte-r120 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      CN8880-1800BG2601-CP-Y-G
Model:               1
Model name:          ThunderX 88XX
BIOS Model name:     2.1
Stepping:            0x1

[root@gigabyte-r120 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX 88XX
Stepping:            0x1

=============
Gigabyte R270
=============

[root@gigabyte-r270 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      CN8890-1800BG2601-AAP-Y-G
Model:               1
Model name:          ThunderX 88XX
BIOS Model name:     2.1
Stepping:            0x1

[root@gigabyte-r270 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX 88XX
Stepping:            0x1

=============
Gigabyte R181
=============

[root@gigabyte-r181 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      Cavium Inc.
Model:               2
Model name:          ThunderX2 99xx
BIOS Model name:     Cavium ThunderX2(R) CPU CN9975 v2.2 @ 2.0GHz
Stepping:            0x1

[root@gigabyte-r181 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               2
Model name:          ThunderX2 99xx
Stepping:            0x1

=================
HPE Moonshot m400
=================

[root@hpe-moonshot-m400 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
BIOS Vendor ID:      AppliedMicro
Model:               1
Model name:          X-Gene
BIOS Model name:     X-Gene
Stepping:            0x0

[root@hpe-moonshot-m400 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
Model:               1
Model name:          X-Gene
Stepping:            0x0

=============
HPE Apollo 70
=============

[root@hpe-apollo-70 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      Cavium Inc.
Model:               1
Model name:          ThunderX2 99xx
BIOS Model name:     Cavium ThunderX2(R) CPU CN9980 v2.1 @ 2.20GHz
Stepping:            0x1

[root@hpe-apollo-70 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX2 99xx
Stepping:            0x1

=============================
HPE Apollo 70 Virtual Machine
=============================

[root@hpe-apollo-70-vm ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      QEMU
Model:               1
Model name:          ThunderX2 99xx
BIOS Model name:     virt-rhel7.6.0
Stepping:            0x1

[root@hpe-apollo-70-vm ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX2 99xx
Stepping:            0x1

=============
HPE Apollo 80
=============

[root@hpe-apollo-80 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
BIOS Vendor ID:      FUJITSU
Model:               0
Model name:          A64FX
BIOS Model name:     461F0010
Stepping:            0x1

[root@hpe-apollo-80 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
Model:               0
Model name:          A64FX
Stepping:            0x1

======================
Lenovo HR330a / HR350a
======================

[root@ampere-hr350a-05 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
BIOS Vendor ID:      Ampere(TM)
Model:               2
Model name:          X-Gene
BIOS Model name:     eMAG 
Stepping:            0x3

[root@ampere-hr350a-05 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
Model:               2
Model name:          X-Gene
Stepping:            0x3

====================
Mellanox Bluefield 2
====================

[root@mellanox-bluefield2 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
BIOS Vendor ID:      https://www.mellanox.com
Model:               0
Model name:          Cortex-A72
BIOS Model name:     Mellanox BlueField-2 [A0] A72(D08) r1p0
Stepping:            r1p0

[root@mellanox-bluefield2 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               0
Model name:          Cortex-A72
Stepping:            r1p0

==============
Penguin Valkre
==============

[root@penguin-valkre ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
BIOS Vendor ID:      CN8890-2000BG2601-AAP-PR-Y-G
Model:               0
Model name:          ThunderX 88XX
BIOS Model name:     2.0
Stepping:            0x1

[root@penguin-valkre ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Cavium
Model:               0
Model name:          ThunderX 88XX
Stepping:            0x1

==================
Qualcomm Amberwing
==================

[root@qualcomm-amberwing ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Qualcomm
BIOS Vendor ID:      Qualcomm
Model:               1
Model name:          Falkor
BIOS Model name:     2.0
Stepping:            0x0

[root@qualcomm-amberwing ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           Qualcomm
Model:               1
Model name:          Falkor
Stepping:            0x0

Comment 13 Jeff Bastian 2021-01-19 15:08:47 UTC
All of the output in comment 12 looks good.  I like this new method of showing both the internally decoded name along with the SMBIOS strings.

Comment 14 Karel Zak 2021-01-20 12:38:17 UTC
(In reply to Jeff Bastian from comment #13)
> All of the output in comment 12 looks good.

Jeff thanks for all the tests!

> I like this new method of
> showing both the internally decoded name along with the SMBIOS strings.

Yes, now when I see all the strings it's more obvious.

This one is a winner:

 Vendor ID:           ARM
 BIOS Vendor ID:      https://www.mellanox.com

;-)

Comment 16 Masayoshi Mizuma (Fujitsu) 2021-01-22 23:12:34 UTC
I tested with util-linux-2.32.1-27.el8.aarch64.
It looks good!

  $ lscpu | grep -e Vendor -e Model
  Vendor ID:            FUJITSU
  Model:                0
  Model name:           A64FX
  $

  # lscpu | grep -e Vendor -e Model
  Vendor ID:            FUJITSU
  BIOS Vendor ID:       FUJITSU
  Model:                0
  Model name:           A64FX
  BIOS Model name:      460F0010
  #

Thanks!
Masa

Comment 19 Jeff Bastian 2021-02-04 23:15:23 UTC
Re-verification with util-linux-2.32.1-27.el8 on RHEL-8.4.0-20210202.n.0 on a subset of the systems from comment 12.

=============
HPE Apollo 80
=============

[root@hpe-apollo80 ~]# rpm -q util-linux
util-linux-2.32.1-27.el8.aarch64

[root@hpe-apollo80 ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
BIOS Vendor ID:      FUJITSU
Model:               0
Model name:          A64FX
BIOS Model name:     461F0010
Stepping:            0x1

[root@hpe-apollo80 ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           FUJITSU
Model:               0
Model name:          A64FX
Stepping:            0x1

=============
Lenovo HR330A
=============

[root@lenovo-hr330a ~]# rpm -q util-linux
util-linux-2.32.1-27.el8.aarch64

[root@lenovo-hr330a ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
BIOS Vendor ID:      Ampere(TM)
Model:               2
Model name:          X-Gene
BIOS Model name:     eMAG 
Stepping:            0x3

[root@lenovo-hr330a ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           APM
Model:               2
Model name:          X-Gene
Stepping:            0x3

============
Ampere Altra
============

[root@ampere-altra ~]# rpm -q util-linux
util-linux-2.32.1-27.el8.aarch64

[root@ampere-altra ~]# lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
BIOS Vendor ID:      Ampere(TM)
Model:               1
Model name:          Neoverse-N1
BIOS Model name:     Ampere(TM) Altra(TM) Processor
Stepping:            r3p1

[root@ampere-altra ~]# sudo -u test lscpu | grep -e Vendor -e Model -e Stepping
Vendor ID:           ARM
Model:               1
Model name:          Neoverse-N1
Stepping:            r3p1

Comment 21 errata-xmlrpc 2021-05-18 15:08:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1694