Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[pandora-kernel.git] / arch / x86_64 / kernel / setup64.c
index 34082c1..06dc354 100644 (file)
@@ -36,7 +36,7 @@ struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table };
 
 char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
 
-unsigned long __supported_pte_mask = ~0UL;
+unsigned long __supported_pte_mask __read_mostly = ~0UL;
 static int do_not_nx __initdata = 0;
 
 /* noexec=on|off
@@ -87,6 +87,10 @@ void __init setup_per_cpu_areas(void)
        int i;
        unsigned long size;
 
+#ifdef CONFIG_HOTPLUG_CPU
+       prefill_possible_map();
+#endif
+
        /* Copy section for each CPU (we discard the original) */
        size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
 #ifdef CONFIG_MODULES
@@ -94,7 +98,7 @@ void __init setup_per_cpu_areas(void)
                size = PERCPU_ENOUGH_ROOM;
 #endif
 
-       for (i = 0; i < NR_CPUS; i++) { 
+       for_each_cpu_mask (i, cpu_possible_map) {
                char *ptr;
 
                if (!NODE_DATA(cpu_to_node(i))) {
@@ -119,7 +123,6 @@ void pda_init(int cpu)
        asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); 
        wrmsrl(MSR_GS_BASE, cpu_pda + cpu);
 
-       pda->me = pda;
        pda->cpunumber = cpu; 
        pda->irqcount = -1;
        pda->kernelstack = 
@@ -138,7 +141,6 @@ void pda_init(int cpu)
                        panic("cannot allocate irqstack for cpu %d", cpu); 
        }
 
-       asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt)));
 
        pda->irqstackptr += IRQSTACKSIZE-64;
 } 
@@ -194,6 +196,7 @@ void __cpuinit cpu_init (void)
        /* CPU 0 is initialised in head64.c */
        if (cpu != 0) {
                pda_init(cpu);
+               zap_low_mappings(cpu);
        } else 
                estacks = boot_exception_stacks;