From: Andi Kleen Fix AMD dual core support on i386 Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/cpu/amd.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -puN arch/i386/kernel/cpu/amd.c~x86_64-final-support-for-amd-dual-core-fix-fix arch/i386/kernel/cpu/amd.c --- 25/arch/i386/kernel/cpu/amd.c~x86_64-final-support-for-amd-dual-core-fix-fix 2005-04-10 15:29:36.000000000 -0700 +++ 25-akpm/arch/i386/kernel/cpu/amd.c 2005-04-10 15:29:36.000000000 -0700 @@ -24,6 +24,9 @@ __asm__(".align 4\nvide: ret"); static void __init init_amd(struct cpuinfo_x86 *c) { +#ifdef CONFIG_SMP + int cpu = c == &boot_cpu_data ? 0 : c - cpu_data; +#endif u32 l, h; int mbytes = num_physpages >> (20-PAGE_SHIFT); int r; @@ -195,14 +198,14 @@ static void __init init_amd(struct cpuin c->x86_num_cores = 1; } -#if 0 +#ifdef CONFIG_SMP /* * On a AMD dual core setup the lower bits of the APIC id * distingush the cores. Assumes number of cores is a power * of two. */ if (c->x86_num_cores > 1) { - cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores) - 1; + cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1); printk(KERN_INFO "CPU %d(%d) -> Core %d\n", cpu, c->x86_num_cores, cpu_core_id[cpu]); } _