]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/xen/enlighten.c
xen: setup percpu data pointers
[linux-2.6-omap-h63xx.git] / arch / x86 / xen / enlighten.c
index cd022c43dfbc7d637d00d580c3431bd24dd1f0a2..aed7ceeb4b65d10091dbc59a51598a80c7141ead 100644 (file)
@@ -66,6 +66,8 @@ EXPORT_SYMBOL_GPL(xen_start_info);
 
 struct shared_info xen_dummy_shared_info;
 
+void *xen_initial_gdt;
+
 /*
  * Point at some empty memory to start with. We map the real shared_info
  * page as soon as fixmap is up and running.
@@ -917,8 +919,19 @@ asmlinkage void __init xen_start_kernel(void)
        have_vcpu_info_placement = 0;
 #endif
 
-       /* setup percpu state */
+#ifdef CONFIG_X86_64
+       /*
+        * Setup percpu state.  We only need to do this for 64-bit
+        * because 32-bit already has %fs set properly.
+        */
        load_percpu_segment(0);
+#endif
+       /*
+        * The only reliable way to retain the initial address of the
+        * percpu gdt_page is to remember it here, so we can go and
+        * mark it RW later, when the initial percpu area is freed.
+        */
+       xen_initial_gdt = &per_cpu(gdt_page, 0);
 
        xen_smp_init();