Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[deliverable/linux.git] / arch / x86 / kernel / cpu / common.c
index ef9e31b89b35f168e3fb37f83f98e7ffe6326e73..d0463a9462477716bd065b5c822cd34e96812282 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/module.h>
 #include <linux/percpu.h>
 #include <linux/bootmem.h>
-#include <asm/semaphore.h>
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/msr.h>
@@ -13,6 +12,7 @@
 #include <asm/mmu_context.h>
 #include <asm/mtrr.h>
 #include <asm/mce.h>
+#include <asm/pat.h>
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -369,12 +369,14 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
                        if (c->x86 >= 0x6)
                                c->x86_model += ((tfms >> 16) & 0xF) << 4;
                        c->x86_mask = tfms & 15;
+                       c->initial_apicid = (ebx >> 24) & 0xFF;
 #ifdef CONFIG_X86_HT
-                       c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
+                       c->apicid = phys_pkg_id(c->initial_apicid, 0);
+                       c->phys_proc_id = c->initial_apicid;
 #else
-                       c->apicid = (ebx >> 24) & 0xFF;
+                       c->apicid = c->initial_apicid;
 #endif
-                       if (c->x86_capability[0] & (1<<19))
+                       if (test_cpu_cap(c, X86_FEATURE_CLFLSH))
                                c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
                } else {
                        /* Have CPUID level 0 only - unheard of */
@@ -395,9 +397,6 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
                init_scattered_cpuid_features(c);
        }
 
-#ifdef CONFIG_X86_HT
-       c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
-#endif
 }
 
 static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
@@ -409,7 +408,7 @@ static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
                lo |= 0x200000;
                wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi);
                printk(KERN_NOTICE "CPU serial number disabled.\n");
-               clear_bit(X86_FEATURE_PN, c->x86_capability);
+               clear_cpu_cap(c, X86_FEATURE_PN);
 
                /* Disabling the serial number may affect the cpuid level */
                c->cpuid_level = cpuid_eax(0);
@@ -554,7 +553,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
                }
 
                index_msb = get_count_order(smp_num_siblings);
-               c->phys_proc_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
+               c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
 
                printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
                       c->phys_proc_id);
@@ -565,7 +564,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
                core_bits = get_count_order(c->x86_max_cores);
 
-               c->cpu_core_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) &
+               c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
                                               ((1 << core_bits) - 1);
 
                if (c->x86_max_cores > 1)
@@ -628,6 +627,7 @@ void __init early_cpu_init(void)
                cpu_devs[cvdev->vendor] = cvdev->cpu_dev;
 
        early_cpu_detect();
+       validate_pat_support(&boot_cpu_data);
 }
 
 /* Make sure %fs is initialized properly in idle threads */
This page took 0.114097 seconds and 5 git commands to generate.