[PATCH] x86_64: Fixup read_mostly section on internode cache line size for vSMP
[powerpc.git] / arch / x86_64 / kernel / setup.c
index ad3b7fc..c50b067 100644 (file)
@@ -68,6 +68,7 @@
 #include <asm/swiotlb.h>
 #include <asm/sections.h>
 #include <asm/gart-mapping.h>
+#include <asm/dmi.h>
 
 /*
  * Machine setup..
@@ -92,6 +93,12 @@ int bootloader_type;
 
 unsigned long saved_video_mode;
 
+/* 
+ * Early DMI memory
+ */
+int dmi_alloc_index;
+char dmi_alloc_data[DMI_MAX_DATA];
+
 /*
  * Setup options
  */
@@ -346,8 +353,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
                if (fullarg(from, "enable_timer_pin_1"))
                        disable_timer_pin_1 = -1;
 
-               if (fullarg(from, "nolapic") || fullarg(from, "disableapic"))
+               if (fullarg(from, "nolapic") || fullarg(from, "disableapic")) {
+                       clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
                        disable_apic = 1;
+               }
 
                if (fullarg(from, "noapic"))
                        skip_ioapic_setup = 1;
@@ -533,7 +542,7 @@ void __init alternative_instructions(void)
 static int __init noreplacement_setup(char *s)
 { 
      no_replacement = 1; 
-     return 0; 
+     return 1;
 } 
 
 __setup("noreplacement", noreplacement_setup); 
@@ -620,6 +629,8 @@ void __init setup_arch(char **cmdline_p)
 
        init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));
 
+       dmi_scan_machine();
+
        zap_low_mappings(0);
 
 #ifdef CONFIG_ACPI
@@ -846,7 +857,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
        unsigned bits;
 #ifdef CONFIG_NUMA
        int node = 0;
-       unsigned apicid = phys_proc_id[cpu];
+       unsigned apicid = hard_smp_processor_id();
 #endif
 
        bits = 0;
@@ -856,7 +867,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
        /* Low order bits define the core id (index of core in socket) */
        cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
        /* Convert the APIC ID into the socket ID */
-       phys_proc_id[cpu] >>= bits;
+       phys_proc_id[cpu] = phys_pkg_id(bits);
 
 #ifdef CONFIG_NUMA
        node = phys_proc_id[cpu];
@@ -937,8 +948,6 @@ static int __init init_amd(struct cpuinfo_x86 *c)
 
        if (c->extended_cpuid_level >= 0x80000008) {
                c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
-               if (c->x86_max_cores & (c->x86_max_cores - 1))
-                       c->x86_max_cores = 1;
 
                amd_detect_cmp(c);
        }
@@ -955,7 +964,6 @@ static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
        cpuid(1, &eax, &ebx, &ecx, &edx);
 
-       c->apicid = phys_pkg_id(0);
 
        if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
                return;
@@ -1164,6 +1172,8 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
                        c->x86_capability[2] = cpuid_edx(0x80860001);
        }
 
+       c->apicid = phys_pkg_id(0);
+
        /*
         * Vendor-specific initialization.  In this section we
         * canonicalize the feature flags, meaning if there are
@@ -1271,7 +1281,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* Intel-defined (#2) */
-               "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", NULL, "est",
+               "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
                "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -1412,10 +1422,3 @@ struct seq_operations cpuinfo_op = {
        .show = show_cpuinfo,
 };
 
-static int __init run_dmi_scan(void)
-{
-       dmi_scan_machine();
-       return 0;
-}
-core_initcall(run_dmi_scan);
-