Sophie

Sophie

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

kernel-2.6.18-194.11.1.el5.src.rpm

From: Bhavna Sarathy <bnagendr@redhat.com>
Date: Mon, 9 Nov 2009 20:36:51 -0500
Subject: [x86_64] set proc id and core id before calling fixup_dcm
Message-id: <4AF87D63.6040303@redhat.com>
Patchwork-id: 21332
O-Subject: Re: [RHEL5.5 PATCH 1/3] Set proc ID and Core ID
	before	calling	fixup_dcm()
Bugzilla: 526315
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Christopher Lalancette <clalance@redhat.com>

Resolves BZ 526315

The fixup_dcm code must be run _after_ core_id and phys_proc_id are
set.

This error was detected through RHEL5.4 experimental kernel
testing, and this fix is being submitted for RHEL5.5 support.

diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index c0bc8cd..9a20e7f 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -880,6 +880,11 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
 			bits++;
 	}
 
+	/* Low order bits define the core id (index of core in socket) */
+	c->cpu_core_id = c->phys_proc_id & ((1 << bits)-1);
+	/* Convert the APIC ID into the socket ID */
+	c->phys_proc_id = phys_pkg_id(bits);
+
 	/* use socket ID also for last level cache */
 	cpu_llc_id[cpu] = c->phys_proc_id;
 
@@ -887,11 +892,6 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
 	if ((c->x86 == 0x10) && (c->x86_model == 9))
 		amd_fixup_dcm(c);
 
-	/* Low order bits define the core id (index of core in socket) */
-	c->cpu_core_id = c->phys_proc_id & ((1 << bits)-1);
-	/* Convert the APIC ID into the socket ID */
-	c->phys_proc_id = phys_pkg_id(bits);
-
 #ifdef CONFIG_NUMA
 	node = cpu_llc_id[cpu];
  	if (apicid_to_node[apicid] != NUMA_NO_NODE)