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

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:
        v3: Remove cluster/socket column checking. Make lscpu_is_cluster_arm()
            static (0001 patch)
	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

 sys-utils/Makemodule.am |   1 +
 sys-utils/lscpu-arm.c   |  15 ++++++
 sys-utils/lscpu-dmi.c   | 108 ++++++++++++++++++++++++++++++++++++++++
 sys-utils/lscpu-virt.c  |  62 ++++++-----------------
 sys-utils/lscpu.1       |   3 ++
 sys-utils/lscpu.c       |  39 ++++++++++++---
 sys-utils/lscpu.h       |  38 ++++++--------
 7 files changed, 190 insertions(+), 76 deletions(-)
 create mode 100644 sys-utils/lscpu-dmi.c

-- 
2.27.0


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

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

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

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).