Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[cascardo/linux.git] / arch / i386 / kernel / cpu / common.c
index aac7475..9ad43be 100644 (file)
@@ -151,7 +151,7 @@ static char __devinit *table_lookup_model(struct cpuinfo_x86 *c)
 }
 
 
-void __devinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
+static void __devinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
 {
        char *v = c->x86_vendor_id;
        int i;
@@ -435,6 +435,11 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c)
        if (c == &boot_cpu_data)
                sysenter_setup();
        enable_sep_cpu();
+
+       if (c == &boot_cpu_data)
+               mtrr_bp_init();
+       else
+               mtrr_ap_init();
 }
 
 #ifdef CONFIG_X86_HT
@@ -608,8 +613,8 @@ void __devinit cpu_init(void)
        memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
                GDT_ENTRY_TLS_ENTRIES * 8);
 
-       __asm__ __volatile__("lgdt %0" : : "m" (cpu_gdt_descr[cpu]));
-       __asm__ __volatile__("lidt %0" : : "m" (idt_descr));
+       load_gdt(&cpu_gdt_descr[cpu]);
+       load_idt(&idt_descr);
 
        /*
         * Delete NT
@@ -637,12 +642,12 @@ void __devinit cpu_init(void)
        asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
 
        /* Clear all 6 debug registers: */
-
-#define CD(register) set_debugreg(0, register)
-
-       CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
-
-#undef CD
+       set_debugreg(0, 0);
+       set_debugreg(0, 1);
+       set_debugreg(0, 2);
+       set_debugreg(0, 3);
+       set_debugreg(0, 6);
+       set_debugreg(0, 7);
 
        /*
         * Force FPU initialization:
@@ -651,3 +656,15 @@ void __devinit cpu_init(void)
        clear_used_math();
        mxcsr_feature_mask_init();
 }
+
+#ifdef CONFIG_HOTPLUG_CPU
+void __devinit cpu_uninit(void)
+{
+       int cpu = raw_smp_processor_id();
+       cpu_clear(cpu, cpu_initialized);
+
+       /* lazy TLB state */
+       per_cpu(cpu_tlbstate, cpu).state = 0;
+       per_cpu(cpu_tlbstate, cpu).active_mm = &init_mm;
+}
+#endif