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

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