Merge branch 'linus' into x86/bootmem
[cascardo/linux.git] / arch / x86 / mm / numa_64.c
index 1e72102..62cb634 100644 (file)
@@ -30,7 +30,6 @@ s16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = {
        [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
 };
 
-int numa_off __initdata;
 static unsigned long __initdata nodemap_addr;
 static unsigned long __initdata nodemap_size;
 
@@ -87,7 +86,7 @@ static int __init allocate_cachealigned_memnodemap(void)
 
        addr = 0x8000;
        nodemap_size = roundup(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES);
-       nodemap_addr = memblock_find_in_range(addr, max_pfn<<PAGE_SHIFT,
+       nodemap_addr = memblock_find_in_range(addr, get_max_mapped(),
                                      nodemap_size, L1_CACHE_BYTES);
        if (nodemap_addr == MEMBLOCK_ERROR) {
                printk(KERN_ERR
@@ -263,6 +262,11 @@ static struct bootnode nodes[MAX_NUMNODES] __initdata;
 static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata;
 static char *cmdline __initdata;
 
+void __init numa_emu_cmdline(char *str)
+{
+       cmdline = str;
+}
+
 static int __init setup_physnodes(unsigned long start, unsigned long end,
                                        int acpi, int amd)
 {
@@ -594,11 +598,12 @@ static int __init numa_emulation(unsigned long start_pfn,
         * the e820 memory map.
         */
        remove_all_active_ranges();
-       for_each_node_mask(i, node_possible_map) {
+       for_each_node_mask(i, node_possible_map)
                memblock_x86_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
                                                nodes[i].end >> PAGE_SHIFT);
+       init_memory_mapping_high();
+       for_each_node_mask(i, node_possible_map)
                setup_node_bootmem(i, nodes[i].start, nodes[i].end);
-       }
        setup_physnodes(addr, max_addr, acpi, amd);
        fake_physnodes(acpi, amd, num_nodes);
        numa_init_array();
@@ -654,6 +659,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
        for (i = 0; i < nr_cpu_ids; i++)
                numa_set_node(i, 0);
        memblock_x86_register_active_regions(0, start_pfn, last_pfn);
+       init_memory_mapping_high();
        setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT);
 }
 
@@ -670,24 +676,6 @@ unsigned long __init numa_free_all_bootmem(void)
        return pages;
 }
 
-static __init int numa_setup(char *opt)
-{
-       if (!opt)
-               return -EINVAL;
-       if (!strncmp(opt, "off", 3))
-               numa_off = 1;
-#ifdef CONFIG_NUMA_EMU
-       if (!strncmp(opt, "fake=", 5))
-               cmdline = opt + 5;
-#endif
-#ifdef CONFIG_ACPI_NUMA
-       if (!strncmp(opt, "noacpi", 6))
-               acpi_numa = -1;
-#endif
-       return 0;
-}
-early_param("numa", numa_setup);
-
 #ifdef CONFIG_NUMA
 
 static __init int find_near_online_node(int node)