diff options
| -rw-r--r-- | arch/x86/kernel/setup_percpu.c | 15 | ||||
| -rw-r--r-- | arch/x86/kernel/smpcommon.c | 7 |
2 files changed, 10 insertions, 12 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index f30ff691c34d..36c2e81dfc3c 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
| @@ -25,15 +25,20 @@ | |||
| 25 | DEFINE_PER_CPU(int, cpu_number); | 25 | DEFINE_PER_CPU(int, cpu_number); |
| 26 | EXPORT_PER_CPU_SYMBOL(cpu_number); | 26 | EXPORT_PER_CPU_SYMBOL(cpu_number); |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_X86_64 | ||
| 29 | #define BOOT_PERCPU_OFFSET ((unsigned long)__per_cpu_load) | ||
| 30 | #else | ||
| 31 | #define BOOT_PERCPU_OFFSET 0 | ||
| 32 | #endif | ||
| 33 | |||
| 34 | DEFINE_PER_CPU(unsigned long, this_cpu_off) = BOOT_PERCPU_OFFSET; | ||
| 35 | EXPORT_PER_CPU_SYMBOL(this_cpu_off); | ||
| 36 | |||
| 28 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA | 37 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 29 | 38 | ||
| 30 | #ifdef CONFIG_X86_64 | ||
| 31 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = { | 39 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = { |
| 32 | [0] = (unsigned long)__per_cpu_load, | 40 | [0] = BOOT_PERCPU_OFFSET, |
| 33 | }; | 41 | }; |
| 34 | #else | ||
| 35 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; | ||
| 36 | #endif | ||
| 37 | EXPORT_SYMBOL(__per_cpu_offset); | 42 | EXPORT_SYMBOL(__per_cpu_offset); |
| 38 | 43 | ||
| 39 | /* | 44 | /* |
diff --git a/arch/x86/kernel/smpcommon.c b/arch/x86/kernel/smpcommon.c index add36b4e37c9..5ec29a1a8465 100644 --- a/arch/x86/kernel/smpcommon.c +++ b/arch/x86/kernel/smpcommon.c | |||
| @@ -5,13 +5,6 @@ | |||
| 5 | #include <asm/smp.h> | 5 | #include <asm/smp.h> |
| 6 | #include <asm/sections.h> | 6 | #include <asm/sections.h> |
| 7 | 7 | ||
| 8 | #ifdef CONFIG_X86_64 | ||
| 9 | DEFINE_PER_CPU(unsigned long, this_cpu_off) = (unsigned long)__per_cpu_load; | ||
| 10 | #else | ||
| 11 | DEFINE_PER_CPU(unsigned long, this_cpu_off); | ||
| 12 | #endif | ||
| 13 | EXPORT_PER_CPU_SYMBOL(this_cpu_off); | ||
| 14 | |||
| 15 | #ifdef CONFIG_X86_32 | 8 | #ifdef CONFIG_X86_32 |
| 16 | /* | 9 | /* |
| 17 | * Initialize the CPU's GDT. This is either the boot CPU doing itself | 10 | * Initialize the CPU's GDT. This is either the boot CPU doing itself |
