aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-09-04 23:09:08 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-05 03:40:52 -0400
commit1cd78776c7d5487e3000426d0ce1ff203c5d60cd (patch)
tree991822eb7e3e2bdd8a38de268815b2159585689b /arch/x86/kernel/cpu
parent140fc72709278989f08eb756d16a70008bdcc409 (diff)
x86: cpu/common*.c, merge detect_ht()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/common.c13
-rw-r--r--arch/x86/kernel/cpu/common_64.c9
2 files changed, 21 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index f9191207718b..b2018f76c94d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -330,6 +330,9 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
330 if (cpu_has(c, X86_FEATURE_CMP_LEGACY)) 330 if (cpu_has(c, X86_FEATURE_CMP_LEGACY))
331 goto out; 331 goto out;
332 332
333 if (cpu_has(c, X86_FEATURE_XTOPOLOGY))
334 return;
335
333 cpuid(1, &eax, &ebx, &ecx, &edx); 336 cpuid(1, &eax, &ebx, &ecx, &edx);
334 337
335 smp_num_siblings = (ebx & 0xff0000) >> 16; 338 smp_num_siblings = (ebx & 0xff0000) >> 16;
@@ -346,8 +349,11 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
346 } 349 }
347 350
348 index_msb = get_count_order(smp_num_siblings); 351 index_msb = get_count_order(smp_num_siblings);
352#ifdef CONFIG_X86_64
353 c->phys_proc_id = phys_pkg_id(index_msb);
354#else
349 c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb); 355 c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
350 356#endif
351 357
352 smp_num_siblings = smp_num_siblings / c->x86_max_cores; 358 smp_num_siblings = smp_num_siblings / c->x86_max_cores;
353 359
@@ -355,8 +361,13 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
355 361
356 core_bits = get_count_order(c->x86_max_cores); 362 core_bits = get_count_order(c->x86_max_cores);
357 363
364#ifdef CONFIG_X86_64
365 c->cpu_core_id = phys_pkg_id(index_msb) &
366 ((1 << core_bits) - 1);
367#else
358 c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) & 368 c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
359 ((1 << core_bits) - 1); 369 ((1 << core_bits) - 1);
370#endif
360 } 371 }
361 372
362out: 373out:
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: