aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_percpu.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-01-26 22:56:48 -0500
committerTejun Heo <tj@kernel.org>2009-01-26 22:56:48 -0500
commit34019be1cd2941128b5de6d7c0fbdb51f967d268 (patch)
treeff7dab4188cb42306bef7640fe9a947765896de1 /arch/x86/kernel/setup_percpu.c
parent1688401a0fddba8991aa5c0943b8ae9583998d60 (diff)
x86: don't assume boot cpu is #0
Impact: minor cleanup Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r--arch/x86/kernel/setup_percpu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 36c2e81dfc3c..be77f1a1231d 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -15,6 +15,7 @@
15#include <asm/highmem.h> 15#include <asm/highmem.h>
16#include <asm/proto.h> 16#include <asm/proto.h>
17#include <asm/cpumask.h> 17#include <asm/cpumask.h>
18#include <asm/cpu.h>
18 19
19#ifdef CONFIG_DEBUG_PER_CPU_MAPS 20#ifdef CONFIG_DEBUG_PER_CPU_MAPS
20# define DBG(x...) printk(KERN_DEBUG x) 21# define DBG(x...) printk(KERN_DEBUG x)
@@ -37,7 +38,7 @@ EXPORT_PER_CPU_SYMBOL(this_cpu_off);
37#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA 38#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
38 39
39unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = { 40unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = {
40 [0] = BOOT_PERCPU_OFFSET, 41 [0 ... NR_CPUS-1] = BOOT_PERCPU_OFFSET,
41}; 42};
42EXPORT_SYMBOL(__per_cpu_offset); 43EXPORT_SYMBOL(__per_cpu_offset);
43 44
@@ -101,10 +102,10 @@ void __init setup_per_cpu_areas(void)
101 early_per_cpu_map(x86_cpu_to_node_map, cpu); 102 early_per_cpu_map(x86_cpu_to_node_map, cpu);
102#endif 103#endif
103 /* 104 /*
104 * Up to this point, CPU0 has been using .data.init 105 * Up to this point, the boot CPU has been using .data.init
105 * area. Reload %gs offset for CPU0. 106 * area. Reload %gs offset for the boot CPU.
106 */ 107 */
107 if (cpu == 0) 108 if (cpu == boot_cpu_id)
108 load_gs_base(cpu); 109 load_gs_base(cpu);
109#endif 110#endif
110 111