diff options
-rw-r--r-- | arch/x86/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 1c25eb69ea86..656d02ea509b 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -769,6 +769,7 @@ extern struct desc_ptr early_gdt_descr; | |||
769 | 769 | ||
770 | extern void cpu_set_gdt(int); | 770 | extern void cpu_set_gdt(int); |
771 | extern void switch_to_new_gdt(int); | 771 | extern void switch_to_new_gdt(int); |
772 | extern void load_percpu_segment(int); | ||
772 | extern void cpu_init(void); | 773 | extern void cpu_init(void); |
773 | 774 | ||
774 | static inline unsigned long get_debugctlmsr(void) | 775 | static inline unsigned long get_debugctlmsr(void) |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 6eacd64b602e..0f73ea423089 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -253,6 +253,16 @@ static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c) | |||
253 | 253 | ||
254 | __u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata; | 254 | __u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata; |
255 | 255 | ||
256 | void load_percpu_segment(int cpu) | ||
257 | { | ||
258 | #ifdef CONFIG_X86_32 | ||
259 | loadsegment(fs, __KERNEL_PERCPU); | ||
260 | #else | ||
261 | loadsegment(gs, 0); | ||
262 | wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu)); | ||
263 | #endif | ||
264 | } | ||
265 | |||
256 | /* Current gdt points %fs at the "master" per-cpu area: after this, | 266 | /* Current gdt points %fs at the "master" per-cpu area: after this, |
257 | * it's on the real one. */ | 267 | * it's on the real one. */ |
258 | void switch_to_new_gdt(int cpu) | 268 | void switch_to_new_gdt(int cpu) |
@@ -263,12 +273,8 @@ void switch_to_new_gdt(int cpu) | |||
263 | gdt_descr.size = GDT_SIZE - 1; | 273 | gdt_descr.size = GDT_SIZE - 1; |
264 | load_gdt(&gdt_descr); | 274 | load_gdt(&gdt_descr); |
265 | /* Reload the per-cpu base */ | 275 | /* Reload the per-cpu base */ |
266 | #ifdef CONFIG_X86_32 | 276 | |
267 | loadsegment(fs, __KERNEL_PERCPU); | 277 | load_percpu_segment(cpu); |
268 | #else | ||
269 | loadsegment(gs, 0); | ||
270 | wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu)); | ||
271 | #endif | ||
272 | } | 278 | } |
273 | 279 | ||
274 | static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; | 280 | static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; |