Blame SOURCES/0054-lscpu-show-physical-socket-on-aarch64-without-ACPI-P.patch

b30723
From ac6651b2bc599af707ccc96936bb028d31c1aea8 Mon Sep 17 00:00:00 2001
0e1b67
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
0e1b67
Date: Fri, 11 Sep 2020 09:53:28 -0400
b30723
Subject: [PATCH 54/56] lscpu: show physical socket on aarch64 without ACPI
0e1b67
 PPTT
0e1b67
0e1b67
Show the number of physical socket even if the sysfs doesn't have
0e1b67
the physical socket information.
0e1b67
Note, lscpu cannot show the number of socket info for unprivileged
0e1b67
users because it needs to access the DMI table.
0e1b67
b30723
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1883056
0e1b67
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
b30723
Signed-off-by: Karel Zak <kzak@redhat.com>
0e1b67
---
0e1b67
 sys-utils/lscpu.c | 6 ++++--
0e1b67
 sys-utils/lscpu.h | 1 -
0e1b67
 2 files changed, 4 insertions(+), 3 deletions(-)
0e1b67
0e1b67
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
b30723
index a8b448fa0..dc6dc97c3 100644
0e1b67
--- a/sys-utils/lscpu.c
0e1b67
+++ b/sys-utils/lscpu.c
0e1b67
@@ -1850,8 +1850,10 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
0e1b67
 			}
0e1b67
 		} else {
0e1b67
 			if (desc->is_cluster) {
0e1b67
-				if (desc->nr_socket_on_cluster > 0)
0e1b67
-					add_summary_n(tb, _("Socket(s):"), desc->nr_socket_on_cluster);
0e1b67
+				int sockets = get_number_of_physical_sockets_from_dmi();
0e1b67
+
b30723
+				if (sockets > 0)
0e1b67
+					add_summary_n(tb, _("Socket(s):"), sockets);
0e1b67
 				else
0e1b67
 					add_summary_s(tb, _("Socket(s):"), "-");
0e1b67
 
0e1b67
diff --git a/sys-utils/lscpu.h b/sys-utils/lscpu.h
0e1b67
index b190afd21..1aef8202d 100644
0e1b67
--- a/sys-utils/lscpu.h
0e1b67
+++ b/sys-utils/lscpu.h
0e1b67
@@ -160,7 +160,6 @@ struct lscpu_desc {
0e1b67
 	int		physcoresperchip;	/* Physical cores per chip */
0e1b67
 
0e1b67
 	int		is_cluster;
0e1b67
-	int		nr_socket_on_cluster;
0e1b67
 };
0e1b67
 
0e1b67
 enum {
0e1b67
-- 
0e1b67
2.29.2
0e1b67