aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/amd.c
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/kernel/cpu/amd.c
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/kernel/cpu/amd.c')
-rw-r--r--arch/i386/kernel/cpu/amd.c24
1 files changed, 14 insertions, 10 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