aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-01-30 03:47:54 -0500
committerTejun Heo <tj@kernel.org>2009-01-31 00:28:58 -0500
commit795f99b61d20c34cb04d17d8906b32f745a635ec (patch)
treef42d20a1962fb6975025a54050bde9d7cf415b16 /arch/x86/xen
parent11e3a840cd5b731cdd8f6f956dfae78a8046d09c (diff)
xen: setup percpu data pointers
Impact: fix xen booting We need to access percpu data fairly early, so set up the percpu registers as soon as possible. We only need to load the appropriate segment register. We already have a GDT, but its hard to change it early because we need to manipulate the pagetable to do so, and that hasn't been set up yet. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c3
-rw-r--r--arch/x86/xen/smp.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index bef941f61451..fe19c88a5029 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1647,6 +1647,9 @@ asmlinkage void __init xen_start_kernel(void)
1647 have_vcpu_info_placement = 0; 1647 have_vcpu_info_placement = 0;
1648#endif 1648#endif
1649 1649
1650 /* setup percpu state */
1651 load_percpu_segment(0);
1652
1650 xen_smp_init(); 1653 xen_smp_init();
1651 1654
1652 /* Get mfn list */ 1655 /* Get mfn list */
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 7735e3dd359c..88d5d5ec6beb 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -170,7 +170,8 @@ static void __init xen_smp_prepare_boot_cpu(void)
170 170
171 /* We've switched to the "real" per-cpu gdt, so make sure the 171 /* We've switched to the "real" per-cpu gdt, so make sure the
172 old memory can be recycled */ 172 old memory can be recycled */
173 make_lowmem_page_readwrite(&per_cpu_var(gdt_page)); 173 make_lowmem_page_readwrite(__per_cpu_load +
174 (unsigned long)&per_cpu_var(gdt_page));
174 175
175 xen_setup_vcpu_info_placement(); 176 xen_setup_vcpu_info_placement();
176} 177}
@@ -235,6 +236,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
235 ctxt->user_regs.ss = __KERNEL_DS; 236 ctxt->user_regs.ss = __KERNEL_DS;
236#ifdef CONFIG_X86_32 237#ifdef CONFIG_X86_32
237 ctxt->user_regs.fs = __KERNEL_PERCPU; 238 ctxt->user_regs.fs = __KERNEL_PERCPU;
239#else
240 ctxt->gs_base_kernel = per_cpu_offset(cpu);
238#endif 241#endif
239 ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle; 242 ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
240 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ 243 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */