util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] lscpu: Fix socket information on aarch64 machine
@ 2020-11-14  4:12 Masayoshi Mizuma
  2020-11-14  4:12 ` [PATCH v2 1/5] lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT Masayoshi Mizuma
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Masayoshi Mizuma @ 2020-11-14  4:12 UTC (permalink / raw)
  To: util-linux; +Cc: Masayoshi Mizuma, Masayoshi Mizuma

From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

lscpu may show the wrong number of physical sockets on aarch64 machine
as 'Socket(s)'.

That is because lscpu uses a sysfs entry (cpu/cpuX/topology/core_siblings) to
get the number of sockets. For aarch64, the sysfs entry is set from MPIDR_EL1
register if the machine doesn't have ACPI PPTT. According to ARM Architecture
Reference Manual, the register shows the topology as the affinity, but doesn't
show the physical socket information.

There are such aarch64 machines because ARM SBBR v1.0 and v1.1 don't require 
ACPI PPTT. SBBR v1.2 requires ACPI PPTT.

For the aarch64 machine, probably 'Cluster(s)' is good instead of 'Socket(s)'
according to linux/arch/arm64/kernel/topology.c:store_cpu_topology().

To get the number of sockets on the machine, SMBIOS Processor information (Type04)
is useful for lscpu because the SMBIOS information is a mandatory
feature for the aarch64 machine which is based on ARM SBBR v1.0 and newer.

With these patches, lscpu shows as following on the machine:

  For unprivileged user:
    $ lscpu 
    Architecture:            aarch64
    ...
        Socket(s):           -
        Cluster(s):          4

  For root:
    # lscpu 
    Architecture:            aarch64
    ...
        Socket(s):           1
        Cluster(s):          4

Changelog:
	v2: Rebased to the latest lscpu

Masayoshi Mizuma (5):
  lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT
  lscpu-virt: split hypervisor_from_dmi_table()
  lscpu-dmi: Move some functions related to DMI to lscpu-dmi
  lscpu: add helper to get physical sockets
  lscpu: show the number of physical socket on aarch64 machine without
    ACPI PPTT

 include/c.h             |   1 +
 sys-utils/Makemodule.am |   1 +
 sys-utils/lscpu-arm.c   |  25 ++++++++++
 sys-utils/lscpu-dmi.c   | 108 ++++++++++++++++++++++++++++++++++++++++
 sys-utils/lscpu-virt.c  |  62 ++++++-----------------
 sys-utils/lscpu.1       |   3 ++
 sys-utils/lscpu.c       |  47 ++++++++++++++---
 sys-utils/lscpu.h       |  39 +++++++--------
 8 files changed, 209 insertions(+), 77 deletions(-)
 create mode 100644 sys-utils/lscpu-dmi.c

-- 
2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-20  3:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14  4:12 [PATCH v2 0/5] lscpu: Fix socket information on aarch64 machine Masayoshi Mizuma
2020-11-14  4:12 ` [PATCH v2 1/5] lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT Masayoshi Mizuma
2020-11-19  8:38   ` Karel Zak
2020-11-20  3:25     ` Masayoshi Mizuma
2020-11-14  4:12 ` [PATCH v2 2/5] lscpu-virt: split hypervisor_from_dmi_table() Masayoshi Mizuma
2020-11-14  4:12 ` [PATCH v2 3/5] lscpu-dmi: Move some functions related to DMI to lscpu-dmi Masayoshi Mizuma
2020-11-14  4:12 ` [PATCH v2 4/5] lscpu: add helper to get physical sockets Masayoshi Mizuma
2020-11-14  4:12 ` [PATCH v2 5/5] lscpu: show the number of physical socket on aarch64 machine without ACPI PPTT Masayoshi Mizuma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).