dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0067-lscpu-Fix-model-and-model-name-on-Power-Systems.patch

b394b9
From 246ab88515fca389c02602521fc765d3e597fd7a Mon Sep 17 00:00:00 2001
b394b9
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
b394b9
Date: Mon, 14 Mar 2016 20:18:07 +0530
b394b9
Subject: [PATCH 67/84] lscpu: Fix model and model name on Power Systems
b394b9
b394b9
On Power System, lspcu presently displays system model number instead of
b394b9
processor model name. 'model' tag in cpuinfo contains system model name,
b394b9
not processor model. Instead it uses 'cpu' tag for processor model name.
b394b9
Also it uses 'revision' tag for processor model.
b394b9
b394b9
Fix lspcu so that it displays processor model number. Also display processor
b394b9
model name.
b394b9
b394b9
cpuinfo output on Power System:
b394b9
  ...
b394b9
  ...
b394b9
b394b9
  processor	: 127
b394b9
  cpu		: POWER8E (raw), altivec supported
b394b9
  clock		: 4322.000000MHz
b394b9
  revision	: 2.1 (pvr 004b 0201)
b394b9
b394b9
  timebase	: 512000000
b394b9
  platform	: PowerNV
b394b9
  model		: 8286-42A
b394b9
  machine	: PowerNV 8286-42A
b394b9
  firmware	: OPAL
b394b9
b394b9
Output without this patch:
b394b9
  Architecture:          ppc64le
b394b9
  Byte Order:            Little Endian
b394b9
  CPU(s):                128
b394b9
  On-line CPU(s) list:   0-127
b394b9
  Thread(s) per core:    8
b394b9
  Core(s) per socket:    4
b394b9
  Socket(s):             4
b394b9
  NUMA node(s):          4
b394b9
  Model:                 8286-42A
b394b9
  ...
b394b9
  ...
b394b9
b394b9
Output with this patch:
b394b9
  Architecture:          ppc64le
b394b9
  Byte Order:            Little Endian
b394b9
  CPU(s):                128
b394b9
  On-line CPU(s) list:   0-127
b394b9
  Thread(s) per core:    8
b394b9
  Core(s) per socket:    4
b394b9
  Socket(s):             4
b394b9
  NUMA node(s):          4
b394b9
  Model:                 2.1 (pvr 004b 0201)
b394b9
  Model name:            POWER8E (raw), altivec supported
b394b9
  ...
b394b9
  ...
b394b9
b394b9
Upstream: http://github.com/karelzak/util-linux/commit/3ac03fe4d20558b55635a048d7f2fb0f5e85ee2a
b394b9
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1326615
b394b9
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
b394b9
---
b394b9
 sys-utils/lscpu.c | 5 +++++
b394b9
 1 file changed, 5 insertions(+)
b394b9
b394b9
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
b394b9
index 4af8176..68b15af 100644
b394b9
--- a/sys-utils/lscpu.c
b394b9
+++ b/sys-utils/lscpu.c
b394b9
@@ -355,8 +355,13 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod)
b394b9
 		else if (lookup(buf, "vendor_id", &desc->vendor)) ;
b394b9
 		else if (lookup(buf, "family", &desc->family)) ;
b394b9
 		else if (lookup(buf, "cpu family", &desc->family)) ;
b394b9
+#if defined(__powerpc__) || defined(__powerpc64__)
b394b9
+		else if (lookup(buf, "revision", &desc->model)) ;
b394b9
+		else if (lookup(buf, "cpu", &desc->modelname)) ;
b394b9
+#else
b394b9
 		else if (lookup(buf, "model", &desc->model)) ;
b394b9
 		else if (lookup(buf, "model name", &desc->modelname)) ;
b394b9
+#endif
b394b9
 		else if (lookup(buf, "stepping", &desc->stepping)) ;
b394b9
 		else if (lookup(buf, "cpu MHz", &desc->mhz)) ;
b394b9
 		else if (lookup(buf, "flags", &desc->flags)) ;		/* x86 */
b394b9
-- 
b394b9
2.7.4
b394b9