aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-02 16:55:31 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2009-02-04 19:59:02 -0500
commit383414322b3b3ced0cbc146801e0cc6c60a6c5f4 (patch)
treef6abd0c09f3f15c1fd78d81a443ae4bf985bdc84 /arch/x86/xen/enlighten.c
parent327641da8e3e227f42690479182b896fd19486be (diff)
xen: setup percpu data pointers
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. Also, set the kernel stack when bringing up secondary CPUs. If we don't they all end up sharing the same stack... Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index cd022c43dfbc..aed7ceeb4b65 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -66,6 +66,8 @@ EXPORT_SYMBOL_GPL(xen_start_info);
66 66
67struct shared_info xen_dummy_shared_info; 67struct shared_info xen_dummy_shared_info;
68 68
69void *xen_initial_gdt;
70
69/* 71/*
70 * Point at some empty memory to start with. We map the real shared_info 72 * Point at some empty memory to start with. We map the real shared_info
71 * page as soon as fixmap is up and running. 73 * page as soon as fixmap is up and running.
@@ -917,8 +919,19 @@ asmlinkage void __init xen_start_kernel(void)
917 have_vcpu_info_placement = 0; 919 have_vcpu_info_placement = 0;
918#endif 920#endif
919 921
920 /* setup percpu state */ 922#ifdef CONFIG_X86_64
923 /*
924 * Setup percpu state. We only need to do this for 64-bit
925 * because 32-bit already has %fs set properly.
926 */
921 load_percpu_segment(0); 927 load_percpu_segment(0);
928#endif
929 /*
930 * The only reliable way to retain the initial address of the
931 * percpu gdt_page is to remember it here, so we can go and
932 * mark it RW later, when the initial percpu area is freed.
933 */
934 xen_initial_gdt = &per_cpu(gdt_page, 0);
922 935
923 xen_smp_init(); 936 xen_smp_init();
924 937