aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpcommon.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-01-13 06:41:35 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-16 08:19:58 -0500
commit9939ddaff52787b2a7c1adf1b2afc95421aa0884 (patch)
tree6e7266d065914e19c3c3f4b4e475f09b9669fa51 /arch/x86/kernel/smpcommon.c
parent1a51e3a0aed18767cf2762e95456ecfeb0bca5e6 (diff)
x86: merge 64 and 32 SMP percpu handling
Now that pda is allocated as part of percpu, percpu doesn't need to be accessed through pda. Unify x86_64 SMP percpu access with x86_32 SMP one. Other than the segment register, operand size and the base of percpu symbols, they behave identical now. This patch replaces now unnecessary pda->data_offset with a dummy field which is necessary to keep stack_canary at its place. This patch also moves per_cpu_offset initialization out of init_gdt() into setup_per_cpu_areas(). Note that this change also necessitates explicit per_cpu_offset initializations in voyager_smp.c. With this change, x86_OP_percpu()'s are as efficient on x86_64 as on x86_32 and also x86_64 can use assembly PER_CPU macros. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/smpcommon.c')
-rw-r--r--arch/x86/kernel/smpcommon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/smpcommon.c b/arch/x86/kernel/smpcommon.c
index 397e309839dd..84395fabc410 100644
--- a/arch/x86/kernel/smpcommon.c
+++ b/arch/x86/kernel/smpcommon.c
@@ -4,10 +4,10 @@
4#include <linux/module.h> 4#include <linux/module.h>
5#include <asm/smp.h> 5#include <asm/smp.h>
6 6
7#ifdef CONFIG_X86_32
8DEFINE_PER_CPU(unsigned long, this_cpu_off); 7DEFINE_PER_CPU(unsigned long, this_cpu_off);
9EXPORT_PER_CPU_SYMBOL(this_cpu_off); 8EXPORT_PER_CPU_SYMBOL(this_cpu_off);
10 9
10#ifdef CONFIG_X86_32
11/* 11/*
12 * Initialize the CPU's GDT. This is either the boot CPU doing itself 12 * Initialize the CPU's GDT. This is either the boot CPU doing itself
13 * (still using the master per-cpu area), or a CPU doing it for a 13 * (still using the master per-cpu area), or a CPU doing it for a
@@ -24,7 +24,6 @@ __cpuinit void init_gdt(int cpu)
24 write_gdt_entry(get_cpu_gdt_table(cpu), 24 write_gdt_entry(get_cpu_gdt_table(cpu),
25 GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S); 25 GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S);
26 26
27 per_cpu(this_cpu_off, cpu) = __per_cpu_offset[cpu];
28 per_cpu(cpu_number, cpu) = cpu; 27 per_cpu(cpu_number, cpu) = cpu;
29} 28}
30#endif 29#endif