diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/cpu/amd.c | 12 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 16dbc4151be4..73aeaf5a9d4e 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 | ||
25 | static void __init init_amd(struct cpuinfo_x86 *c) | 25 | static 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; |
@@ -198,14 +195,19 @@ static void __init init_amd(struct cpuinfo_x86 *c) | |||
198 | c->x86_num_cores = 1; | 195 | c->x86_num_cores = 1; |
199 | } | 196 | } |
200 | 197 | ||
201 | #ifdef CONFIG_X86_SMP | 198 | #ifdef CONFIG_X86_HT |
202 | /* | 199 | /* |
203 | * On a AMD dual core setup the lower bits of the APIC id | 200 | * On a AMD dual core setup the lower bits of the APIC id |
204 | * distingush the cores. Assumes number of cores is a power | 201 | * distingush the cores. Assumes number of cores is a power |
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 | unsigned bits = 0; | ||
207 | while ((1 << bits) < c->x86_num_cores) | ||
208 | bits++; | ||
209 | cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<<bits)-1); | ||
210 | phys_proc_id[cpu] >>= bits; | ||
209 | printk(KERN_INFO "CPU %d(%d) -> Core %d\n", | 211 | printk(KERN_INFO "CPU %d(%d) -> Core %d\n", |
210 | cpu, c->x86_num_cores, cpu_core_id[cpu]); | 212 | cpu, c->x86_num_cores, cpu_core_id[cpu]); |
211 | } | 213 | } |
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 6be0310e3cd3..d199e525680a 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -243,6 +243,10 @@ static void __init early_cpu_detect(void) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | early_intel_workaround(c); | 245 | early_intel_workaround(c); |
246 | |||
247 | #ifdef CONFIG_X86_HT | ||
248 | phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff; | ||
249 | #endif | ||
246 | } | 250 | } |
247 | 251 | ||
248 | void __init generic_identify(struct cpuinfo_x86 * c) | 252 | void __init generic_identify(struct cpuinfo_x86 * c) |
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index cbea7ac582e5..35bfe138cb1a 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -888,6 +888,7 @@ void *xquad_portio; | |||
888 | 888 | ||
889 | cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; | 889 | cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; |
890 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; | 890 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; |
891 | EXPORT_SYMBOL(cpu_core_map); | ||
891 | 892 | ||
892 | static void __init smp_boot_cpus(unsigned int max_cpus) | 893 | static void __init smp_boot_cpus(unsigned int max_cpus) |
893 | { | 894 | { |