Merge branch 'master' into upstream
[pandora-kernel.git] / arch / x86_64 / kernel / setup64.c
index e85cfbb..6a70b55 100644 (file)
@@ -37,7 +37,6 @@ struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
 char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
 
 unsigned long __supported_pte_mask __read_mostly = ~0UL;
-EXPORT_SYMBOL(__supported_pte_mask);
 static int do_not_nx __cpuinitdata = 0;
 
 /* noexec=on|off
@@ -121,7 +120,10 @@ void pda_init(int cpu)
 
        /* Setup up data that may be needed in __get_free_pages early */
        asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); 
+       /* Memory clobbers used to order PDA accessed */
+       mb();
        wrmsrl(MSR_GS_BASE, pda);
+       mb();
 
        pda->cpunumber = cpu; 
        pda->irqcount = -1;
@@ -177,6 +179,8 @@ void __cpuinit check_efer(void)
         }       
 }
 
+unsigned long kernel_eflags;
+
 /*
  * cpu_init() initializes state that is per-CPU. Some data is already
  * initialized (naturally) in the bootstrap process, such as the GDT
@@ -234,28 +238,17 @@ void __cpuinit cpu_init (void)
         * set up and load the per-CPU TSS
         */
        for (v = 0; v < N_EXCEPTION_STACKS; v++) {
+               static const unsigned int order[N_EXCEPTION_STACKS] = {
+                       [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER,
+                       [DEBUG_STACK - 1] = DEBUG_STACK_ORDER
+               };
                if (cpu) {
-                       static const unsigned int order[N_EXCEPTION_STACKS] = {
-                               [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER,
-                               [DEBUG_STACK - 1] = DEBUG_STACK_ORDER
-                       };
-
                        estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]);
                        if (!estacks)
                                panic("Cannot allocate exception stack %ld %d\n",
                                      v, cpu); 
                }
-               switch (v + 1) {
-#if DEBUG_STKSZ > EXCEPTION_STKSZ
-               case DEBUG_STACK:
-                       cpu_pda(cpu)->debugstack = (unsigned long)estacks;
-                       estacks += DEBUG_STKSZ;
-                       break;
-#endif
-               default:
-                       estacks += EXCEPTION_STKSZ;
-                       break;
-               }
+               estacks += PAGE_SIZE << order[v];
                orig_ist->ist[v] = t->ist[v] = (unsigned long)estacks;
        }
 
@@ -289,4 +282,6 @@ void __cpuinit cpu_init (void)
        set_debugreg(0UL, 7);
 
        fpu_init(); 
+
+       raw_local_save_flags(kernel_eflags);
 }