In the arm platform, we do not have the "CPU family" as X86.
In the linux kernel, it is hardcode to set the "CPU architecuture:8"
which should be changed for arm v9 in future.
This patch adds "bios_family" field, which we can get from the DMI table.
In the ampere Altra platform, we can get the new lscpu output:
----------------------------------------------------------------
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Vendor ID: ARM
BIOS Vendor ID: Ampere(R)
Model name: Neoverse-N1
BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz
BIOS CPU family: 257
Model: 1
Thread(s) per core: 1
----------------------------------------------------------------
[kzak@redhat.com: - s/sprintf/snprintf/]
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* next: (26 commits)
build-sys: add script to compare config.h from meson and autotools
meson: add missing header files check
docs: update TODO
tests: update lscpu outputs
lscpu: read MHZ from /sys/.../cpufreq/scaling_cur_freq
lscpu: use locale-independent strtod() when read from kernel
lib/c_strtod; add locale independent strtod()
tests: update lscpu output
lscpu: use MHZ as number to be locale sensitive
lscpu: add SCALMHZ% and "CPU scaling MHz:"
sulogin: fix whitespace error
sulogin: ignore none-existing console devices
lsns: fix old error message
lsns: fix copy & past in man page
lsns: fill UID and USER columns for interpolated namespaces
fixup! lsns: interpolate missing namespaces for converting forests to a tree
lsns: interpolate missing namespaces for converting forests to a tree
lsns: reorganize members specifying other namespaces in lsns_namespace
lsns: make namespace having no process printable
libblkid: support zone reset for wipefs
...
Port commit
commit 6cb8af7be2
Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
Date: Sat Mar 28 12:19:42 2020 +0800
to new lscpu code.
References: 6cb8af7be2
Signed-off-by: Karel Zak <kzak@redhat.com>
Port commit
commit 318542e060
Author: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date: Fri Jun 5 18:15:10 2020 +0200
to new lscpu code.
References: 318542e060
Signed-off-by: Karel Zak <kzak@redhat.com>
ntypes greater than 1 is valid in some hardware configurations, and an assert()
on the value isn't necessary or very future proof
[kzak@redhat.com: - port this patch to new code]
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep global (cputype) bogomips
* add per-CPU bogomips
* use bogomips from the first CPU as global (for cputype) if /proc/cpuinfo does not provide global bogomips
* add BOGOMIPS column for to -e/-p output
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep one sharedmap per cache instance
* initialize topology IDs to -1
* rewrite -e code to use a new data structs
Signed-off-by: Karel Zak <kzak@redhat.com>
The Dynamic and Static MHz are /proc/cpuinfo s390 per-CPU fields, but
we display it as a single value according the first parsed CPU. For
this purpose we store the values from the first CPU in lscpu_cputype.
For -p and -e outputs we will print per CPU values.
Signed-off-by: Karel Zak <kzak@redhat.com>
Don't use global CPU masks (like "online" or "present") to
calculate type specific number of threads due systems with
mixed CPU types.
It's also necessary to check all thread_siblings maps to get the
highest number, because some threads (CPUs) may be disables, for
example old lscpu calculates number of threads from the cpu0 and
if you disable cpu0's sibling (cpu4):
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2 <---
Core(s) per socket: 4
Socket(s): 1
# chcpu --disable 4
CPU 4 disabled
CPU(s): 8
On-line CPU(s) list: 0-3,5-7
Off-line CPU(s) list: 4
Thread(s) per core: 1 <--- !
Core(s) per socket: 4
Socket(s): 1
because 'thread_siblings' contains only one thread for cpu0:
# cat /sys/devices/system/cpu/cpu{0,1,2,3,4,5,6,7}/topology/thread_siblings_list
0
1,5
2,6
3,7
cat: /sys/devices/system/cpu/cpu4/topology/thread_siblings_list: No such file or directory
1,5
2,6
3,7
Signed-off-by: Karel Zak <kzak@redhat.com>