aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/amd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 990cc4861586..589bdd7a4cff 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -261,7 +261,7 @@ static int __cpuinit nearby_node(int apicid)
261#ifdef CONFIG_X86_HT 261#ifdef CONFIG_X86_HT
262static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) 262static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
263{ 263{
264 u32 nodes, cores_per_cu; 264 u32 nodes, cores_per_cu = 1;
265 u8 node_id; 265 u8 node_id;
266 int cpu = smp_processor_id(); 266 int cpu = smp_processor_id();
267 267
@@ -276,7 +276,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
276 /* get compute unit information */ 276 /* get compute unit information */
277 smp_num_siblings = ((ebx >> 8) & 3) + 1; 277 smp_num_siblings = ((ebx >> 8) & 3) + 1;
278 c->compute_unit_id = ebx & 0xff; 278 c->compute_unit_id = ebx & 0xff;
279 cores_per_cu = ((ebx >> 8) & 3) + 1; 279 cores_per_cu += ((ebx >> 8) & 3);
280 } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) { 280 } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
281 u64 value; 281 u64 value;
282 282
@@ -298,7 +298,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
298 /* store NodeID, use llc_shared_map to store sibling info */ 298 /* store NodeID, use llc_shared_map to store sibling info */
299 per_cpu(cpu_llc_id, cpu) = node_id; 299 per_cpu(cpu_llc_id, cpu) = node_id;
300 300
301 /* core id to be in range from 0 to (cores_per_node - 1) */ 301 /* core id has to be in the [0 .. cores_per_node - 1] range */
302 c->cpu_core_id %= cores_per_node; 302 c->cpu_core_id %= cores_per_node;
303 c->compute_unit_id %= cus_per_node; 303 c->compute_unit_id %= cus_per_node;
304 } 304 }