Commit 795f99b6 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Tejun Heo

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: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 11e3a840
...@@ -1647,6 +1647,9 @@ asmlinkage void __init xen_start_kernel(void) ...@@ -1647,6 +1647,9 @@ asmlinkage void __init xen_start_kernel(void)
have_vcpu_info_placement = 0; have_vcpu_info_placement = 0;
#endif #endif
/* setup percpu state */
load_percpu_segment(0);
xen_smp_init(); xen_smp_init();
/* Get mfn list */ /* Get mfn list */
......
...@@ -170,7 +170,8 @@ static void __init xen_smp_prepare_boot_cpu(void) ...@@ -170,7 +170,8 @@ static void __init xen_smp_prepare_boot_cpu(void)
/* We've switched to the "real" per-cpu gdt, so make sure the /* We've switched to the "real" per-cpu gdt, so make sure the
old memory can be recycled */ old memory can be recycled */
make_lowmem_page_readwrite(&per_cpu_var(gdt_page)); make_lowmem_page_readwrite(__per_cpu_load +
(unsigned long)&per_cpu_var(gdt_page));
xen_setup_vcpu_info_placement(); xen_setup_vcpu_info_placement();
} }
...@@ -235,6 +236,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) ...@@ -235,6 +236,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
ctxt->user_regs.ss = __KERNEL_DS; ctxt->user_regs.ss = __KERNEL_DS;
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
ctxt->user_regs.fs = __KERNEL_PERCPU; ctxt->user_regs.fs = __KERNEL_PERCPU;
#else
ctxt->gs_base_kernel = per_cpu_offset(cpu);
#endif #endif
ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle; ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment