aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/cpu/amd.c')
-rw-r--r--arch/i386/kernel/cpu/amd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 16dbc4151be4..fa34a06c0d79 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -24,9 +24,6 @@ __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_X86_SMP
28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data;
29#endif
30 u32 l, h; 27 u32 l, h;
31 int mbytes = num_physpages >> (20-PAGE_SHIFT); 28 int mbytes = num_physpages >> (20-PAGE_SHIFT);
32 int r; 29 int r;
@@ -205,7 +202,9 @@ static void __init init_amd(struct cpuinfo_x86 *c)
205 * of two. 202 * of two.
206 */ 203 */
207 if (c->x86_num_cores > 1) { 204 if (c->x86_num_cores > 1) {
208 cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1); 205 int cpu = smp_processor_id();
206 /* Fix up the APIC ID following AMD specifications. */
207 cpu_core_id[cpu] >>= hweight32(c->x86_num_cores - 1);
209 printk(KERN_INFO "CPU %d(%d) -> Core %d\n", 208 printk(KERN_INFO "CPU %d(%d) -> Core %d\n",
210 cpu, c->x86_num_cores, cpu_core_id[cpu]); 209 cpu, c->x86_num_cores, cpu_core_id[cpu]);
211 } 210 }