aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-04-16 18:25:16 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:25:16 -0400
commit635186447d0e6f3b35895fda993a266a1315d2a7 (patch)
tree7d92e2b57c66f076908a5739056d823a4bde0121 /arch/i386
parent3dd9d514846cdca1dcef2e4fce666d85e199e844 (diff)
[PATCH] x86_64: Final support for AMD dual core
Clean up the code greatly. Now uses the infrastructure from the Intel dual core patch Should fix a final bug noticed by Tyan of not detecting the nodes correctly in some corner cases. Patch for x86-64 and i386 Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/cpu/amd.c24
-rw-r--r--arch/i386/kernel/cpu/common.c2
2 files changed, 15 insertions, 11 deletions
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index fa10d0a509c7..8d182e875cd7 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -24,6 +24,9 @@ __asm__(".align 4\nvide: ret");
24 24
25static void __init init_amd(struct cpuinfo_x86 *c) 25static void __init init_amd(struct cpuinfo_x86 *c)
26{ 26{
27#ifdef CONFIG_SMP
28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data;
29#endif
27 u32 l, h; 30 u32 l, h;
28 int mbytes = num_physpages >> (20-PAGE_SHIFT); 31 int mbytes = num_physpages >> (20-PAGE_SHIFT);
29 int r; 32 int r;
@@ -195,16 +198,17 @@ static void __init init_amd(struct cpuinfo_x86 *c)
195 c->x86_num_cores = 1; 198 c->x86_num_cores = 1;
196 } 199 }
197 200
198 detect_ht(c); 201#ifdef CONFIG_SMP
199 202 /*
200#ifdef CONFIG_X86_HT 203 * On a AMD dual core setup the lower bits of the APIC id
201 /* AMD dual core looks like HT but isn't really. Hide it from the 204 * distingush the cores. Assumes number of cores is a power
202 scheduler. This works around problems with the domain scheduler. 205 * of two.
203 Also probably gives slightly better scheduling and disables 206 */
204 SMT nice which is harmful on dual core. 207 if (c->x86_num_cores > 1) {
205 TBD tune the domain scheduler for dual core. */ 208 cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1);
206 if (cpu_has(c, X86_FEATURE_CMP_LEGACY)) 209 printk(KERN_INFO "CPU %d(%d) -> Core %d\n",
207 smp_num_siblings = 1; 210 cpu, c->x86_num_cores, cpu_core_id[cpu]);
211 }
208#endif 212#endif
209} 213}
210 214
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index ed4c9c3fe667..6be0310e3cd3 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -437,7 +437,7 @@ void __init detect_ht(struct cpuinfo_x86 *c)
437 int index_msb, tmp; 437 int index_msb, tmp;
438 int cpu = smp_processor_id(); 438 int cpu = smp_processor_id();
439 439
440 if (!cpu_has(c, X86_FEATURE_HT)) 440 if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
441 return; 441 return;
442 442
443 cpuid(1, &eax, &ebx, &ecx, &edx); 443 cpuid(1, &eax, &ebx, &ecx, &edx);