]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kernel/cpu/common.c
Merge branch 'x86-mrst-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[net-next-2.6.git] / arch / x86 / kernel / cpu / common.c
index 284bf89ddae2f0915321ff742e8fb69a904ec496..f10273138382cb38b2fbced1a76659e1e01adc9d 100644 (file)
@@ -551,6 +551,16 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
                c->x86_capability[4] = excap;
        }
 
+       /* Additional Intel-defined flags: level 0x00000007 */
+       if (c->cpuid_level >= 0x00000007) {
+               u32 eax, ebx, ecx, edx;
+
+               cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
+
+               if (eax > 0)
+                       c->x86_capability[9] = ebx;
+       }
+
        /* AMD-defined flags: level 0x80000001 */
        xlvl = cpuid_eax(0x80000000);
        c->extended_cpuid_level = xlvl;
@@ -1084,6 +1094,20 @@ static void clear_all_debug_regs(void)
        }
 }
 
+#ifdef CONFIG_KGDB
+/*
+ * Restore debug regs if using kgdbwait and you have a kernel debugger
+ * connection established.
+ */
+static void dbg_restore_debug_regs(void)
+{
+       if (unlikely(kgdb_connected && arch_kgdb_ops.correct_hw_break))
+               arch_kgdb_ops.correct_hw_break();
+}
+#else /* ! CONFIG_KGDB */
+#define dbg_restore_debug_regs()
+#endif /* ! CONFIG_KGDB */
+
 /*
  * cpu_init() initializes state that is per-CPU. Some data is already
  * initialized (naturally) in the bootstrap process, such as the GDT
@@ -1107,9 +1131,9 @@ void __cpuinit cpu_init(void)
        oist = &per_cpu(orig_ist, cpu);
 
 #ifdef CONFIG_NUMA
-       if (cpu != 0 && percpu_read(node_number) == 0 &&
-           cpu_to_node(cpu) != NUMA_NO_NODE)
-               percpu_write(node_number, cpu_to_node(cpu));
+       if (cpu != 0 && percpu_read(numa_node) == 0 &&
+           early_cpu_to_node(cpu) != NUMA_NO_NODE)
+               set_numa_node(early_cpu_to_node(cpu));
 #endif
 
        me = current;
@@ -1174,18 +1198,8 @@ void __cpuinit cpu_init(void)
        load_TR_desc();
        load_LDT(&init_mm.context);
 
-#ifdef CONFIG_KGDB
-       /*
-        * If the kgdb is connected no debug regs should be altered.  This
-        * is only applicable when KGDB and a KGDB I/O module are built
-        * into the kernel and you are using early debugging with
-        * kgdbwait. KGDB will control the kernel HW breakpoint registers.
-        */
-       if (kgdb_connected && arch_kgdb_ops.correct_hw_break)
-               arch_kgdb_ops.correct_hw_break();
-       else
-#endif
-               clear_all_debug_regs();
+       clear_all_debug_regs();
+       dbg_restore_debug_regs();
 
        fpu_init();
 
@@ -1239,6 +1253,7 @@ void __cpuinit cpu_init(void)
 #endif
 
        clear_all_debug_regs();
+       dbg_restore_debug_regs();
 
        /*
         * Force FPU initialization: