Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 2979

kernel-2.6.18-194.11.1.el5.src.rpm

From: AMEET M. PARANJAPE <aparanja@redhat.com>
Date: Mon, 23 Feb 2009 11:12:04 -0500
Subject: [ppc64] power7: fix /proc/cpuinfo cpus info
Message-id: 20090223161024.3385.86086.sendpatchset@squad5-lp1.lab.bos.redhat.com
O-Subject: [PATCH RHEL5.4 BZ486649] /proc/cpuinfo should show power7 as Power6 architected, but it shows as unknown
Bugzilla: 486649
RH-Acked-by: David Howells <dhowells@redhat.com>

RHBZ#:
======
https://bugzilla.redhat.com/show_bug.cgi?id=486649

Description:
===========
When identify_cpu() is called a second time with a logical PVR, it only
copies a subset of the cpu_spec structure to avoid overwriting the
performance monitor fields that were initialized based on the real PVR.

If the real PVR is not recognized, the structure is initialized with
default data in which the pvr_mask field is zero.  Overriding the default
definition with the one based on the logical PVR does not update the
pvr_mask field.  Since the pvr_mask field remains zero, show_cpuinfo()
reports the cpu as "unknown".

identify_cpu() should update the pvr_mask, so that show_cpuinfo() reports
the logical cpu name, as it would if the kernel recognized the real PVR.

For completeness, this patch also updates pvr_value, although its only
use appears to be in booke_wdt_init() setting ident.firmware_version.

RHEL Version Found:
================
RHEL 5.3

kABI Status:
============
No symbols were harmed.

Brew:
=====
Built on all platforms.
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1701446

Upstream Status:
================
The problem does not show up in mainline due to the cpu being known.

Test Status:
============
This patch has successfully been tested on Power7 hardware on the -131 kernel.

The "testcase" consists of "cat /proc/cpuinfo".   The cpus should be identified
as "POWER6 (architected)", rather than "unknown (003f0100)".

===============================================================
Ameet Paranjape 978-392-3903 ext 23903
IBM on-site partner

Proposed Patch:
===============

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 88481ee..4c54b56 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1196,6 +1196,8 @@ struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
 			 * performance monitor fields.
 			 */
 			if (t->num_pmcs && !s->num_pmcs) {
+				t->pvr_mask = s->pvr_mask;
+				t->pvr_value = s->pvr_value;
 				t->cpu_name = s->cpu_name;
 				t->cpu_features = s->cpu_features;
 				t->cpu_user_features = s->cpu_user_features;