Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
[pandora-kernel.git] / arch / x86_64 / kernel / setup.c
index 9c4d93c..fc944b5 100644 (file)
@@ -74,11 +74,6 @@ EXPORT_SYMBOL(boot_cpu_data);
 
 unsigned long mmu_cr4_features;
 
-int acpi_disabled;
-EXPORT_SYMBOL(acpi_disabled);
-
-int acpi_numa __initdata;
-
 /* Boot loader ID as an integer, for the benefit of proc_dointvec */
 int bootloader_type;
 
@@ -102,7 +97,6 @@ struct sys_desc_table_struct {
 
 struct edid_info edid_info;
 EXPORT_SYMBOL_GPL(edid_info);
-struct e820map e820;
 
 extern int root_mountflags;
 
@@ -129,9 +123,6 @@ struct resource standard_io_resources[] = {
                .flags = IORESOURCE_BUSY | IORESOURCE_IO }
 };
 
-#define STANDARD_IO_RESOURCES \
-       (sizeof standard_io_resources / sizeof standard_io_resources[0])
-
 #define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
 
 struct resource data_resource = {
@@ -178,9 +169,6 @@ static struct resource adapter_rom_resources[] = {
                .flags = IORESOURCE_ROM }
 };
 
-#define ADAPTER_ROM_RESOURCES \
-       (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
-
 static struct resource video_rom_resource = {
        .name = "Video ROM",
        .start = 0xc0000,
@@ -251,7 +239,8 @@ static void __init probe_roms(void)
        }
 
        /* check for adapter roms on 2k boundaries */
-       for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) {
+       for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper;
+            start += 2048) {
                rom = isa_bus_to_virt(start);
                if (!romsignature(rom))
                        continue;
@@ -298,7 +287,8 @@ contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
        if (bootmap == -1L)
                panic("Cannot find bootmem map of size %ld\n",bootmap_size);
        bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, end_pfn);
-       e820_bootmem_free(NODE_DATA(0), 0, end_pfn << PAGE_SHIFT);
+       e820_register_active_regions(0, start_pfn, end_pfn);
+       free_bootmem_with_active_regions(0, end_pfn);
        reserve_bootmem(bootmap, bootmap_size);
 } 
 #endif
@@ -390,6 +380,7 @@ void __init setup_arch(char **cmdline_p)
 
        finish_e820_parsing();
 
+       e820_register_active_regions(0, 0, -1UL);
        /*
         * partially used pages are not usable - thus
         * we are rounding upwards:
@@ -420,6 +411,9 @@ void __init setup_arch(char **cmdline_p)
        max_pfn = end_pfn;
        high_memory = (void *)__va(end_pfn * PAGE_SIZE - 1) + 1;
 
+       /* Remove active ranges so rediscovery with NUMA-awareness happens */
+       remove_all_active_ranges();
+
 #ifdef CONFIG_ACPI_NUMA
        /*
         * Parse SRAT to discover nodes.
@@ -499,7 +493,9 @@ void __init setup_arch(char **cmdline_p)
 
        paging_init();
 
+#ifdef CONFIG_PCI
        early_quirks();
+#endif
 
        /*
         * set this early, so we dont allocate cpu0
@@ -529,13 +525,14 @@ void __init setup_arch(char **cmdline_p)
         */
        probe_roms();
        e820_reserve_resources(); 
+       e820_mark_nosave_regions();
 
        request_resource(&iomem_resource, &video_ram_resource);
 
        {
        unsigned i;
        /* request I/O space for devices used on all i[345]86 PCs */
-       for (i = 0; i < STANDARD_IO_RESOURCES; i++)
+       for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
                request_resource(&ioport_resource, &standard_io_resources[i]);
        }
 
@@ -678,7 +675,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
 #endif
 }
 
-static void __init init_amd(struct cpuinfo_x86 *c)
+static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 {
        unsigned level;
 
@@ -734,6 +731,12 @@ static void __init init_amd(struct cpuinfo_x86 *c)
 
        /* Fix cpuid4 emulation for more */
        num_cache_leaves = 3;
+
+       /* When there is only one core no need to synchronize RDTSC */
+       if (num_possible_cpus() == 1)
+               set_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
+       else
+               clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
 }
 
 static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
@@ -815,8 +818,7 @@ static void srat_detect_node(void)
                node = first_node(node_online_map);
        numa_set_node(cpu, node);
 
-       if (acpi_numa > 0)
-               printk(KERN_INFO "CPU %d/%x -> Node %d\n", cpu, apicid, node);
+       printk(KERN_INFO "CPU %d/%x -> Node %d\n", cpu, apicid, node);
 #endif
 }
 
@@ -850,6 +852,8 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
        if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
            (c->x86 == 0x6 && c->x86_model >= 0x0e))
                set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability);
+       if (c->x86 == 6)
+               set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
        set_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
        c->x86_max_cores = intel_num_cpu_cores(c);
 
@@ -1068,8 +1072,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
                /* Intel-defined (#2) */
                "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,
+               "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
+               NULL, NULL, "dca", NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* VIA/Cyrix/Centaur-defined */