aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/common_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/common_64.c')
-rw-r--r--arch/x86/kernel/cpu/common_64.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index f7a2d524b1e7..7ac0a00743c7 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -349,7 +349,11 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
349 } 349 }
350 350
351 index_msb = get_count_order(smp_num_siblings); 351 index_msb = get_count_order(smp_num_siblings);
352#ifdef CONFIG_X86_64
352 c->phys_proc_id = phys_pkg_id(index_msb); 353 c->phys_proc_id = phys_pkg_id(index_msb);
354#else
355 c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
356#endif
353 357
354 smp_num_siblings = smp_num_siblings / c->x86_max_cores; 358 smp_num_siblings = smp_num_siblings / c->x86_max_cores;
355 359
@@ -357,8 +361,13 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
357 361
358 core_bits = get_count_order(c->x86_max_cores); 362 core_bits = get_count_order(c->x86_max_cores);
359 363
364#ifdef CONFIG_X86_64
360 c->cpu_core_id = phys_pkg_id(index_msb) & 365 c->cpu_core_id = phys_pkg_id(index_msb) &
361 ((1 << core_bits) - 1); 366 ((1 << core_bits) - 1);
367#else
368 c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
369 ((1 << core_bits) - 1);
370#endif
362 } 371 }
363 372
364out: 373out: