]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: cpu/common*.c, merge detect_ht()
authorYinghai Lu <yhlu.kernel@gmail.com>
Fri, 5 Sep 2008 03:09:08 +0000 (20:09 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 5 Sep 2008 07:40:52 +0000 (09:40 +0200)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/common_64.c

index f9191207718b7112e5b24ce588af13d4d9d1dd8d..b2018f76c94d8b8aaf5abaf2ae4427a8088dfff6 100644 (file)
@@ -330,6 +330,9 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
        if (cpu_has(c, X86_FEATURE_CMP_LEGACY))
                goto out;
 
+       if (cpu_has(c, X86_FEATURE_XTOPOLOGY))
+               return;
+
        cpuid(1, &eax, &ebx, &ecx, &edx);
 
        smp_num_siblings = (ebx & 0xff0000) >> 16;
@@ -346,8 +349,11 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
                }
 
                index_msb = get_count_order(smp_num_siblings);
+#ifdef CONFIG_X86_64
+               c->phys_proc_id = phys_pkg_id(index_msb);
+#else
                c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
-
+#endif
 
                smp_num_siblings = smp_num_siblings / c->x86_max_cores;
 
@@ -355,8 +361,13 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
                core_bits = get_count_order(c->x86_max_cores);
 
+#ifdef CONFIG_X86_64
+               c->cpu_core_id = phys_pkg_id(index_msb) &
+                                              ((1 << core_bits) - 1);
+#else
                c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
                                               ((1 << core_bits) - 1);
+#endif
        }
 
 out:
index f7a2d524b1e701b41b23e2ab4308abe04b94b4e4..7ac0a00743c71c5c7a31ac75f059a61ed31c3dca 100644 (file)
@@ -349,7 +349,11 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
                }
 
                index_msb = get_count_order(smp_num_siblings);
+#ifdef CONFIG_X86_64
                c->phys_proc_id = phys_pkg_id(index_msb);
+#else
+               c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
+#endif
 
                smp_num_siblings = smp_num_siblings / c->x86_max_cores;
 
@@ -357,8 +361,13 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
                core_bits = get_count_order(c->x86_max_cores);
 
+#ifdef CONFIG_X86_64
                c->cpu_core_id = phys_pkg_id(index_msb) &
                                               ((1 << core_bits) - 1);
+#else
+               c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
+                                              ((1 << core_bits) - 1);
+#endif
        }
 
 out: