]> err.no Git - linux-2.6/blobdiff - arch/i386/kernel/setup.c
[PATCH] Have x86 use add_active_range() and free_area_init_nodes
[linux-2.6] / arch / i386 / kernel / setup.c
index ea17567dbe72805a15f4f977e003147aca609daa..814cdebf73773ed73b2a7228179067f5f7c972dc 100644 (file)
@@ -53,6 +53,7 @@
 #include <asm/apic.h>
 #include <asm/e820.h>
 #include <asm/mpspec.h>
+#include <asm/mmzone.h>
 #include <asm/setup.h>
 #include <asm/arch_hooks.h>
 #include <asm/sections.h>
@@ -814,6 +815,24 @@ static int __init parse_vmalloc(char *arg)
 }
 early_param("vmalloc", parse_vmalloc);
 
+/*
+ * reservetop=size reserves a hole at the top of the kernel address space which
+ * a hypervisor can load into later.  Needed for dynamically loaded hypervisors,
+ * so relocating the fixmap can be done before paging initialization.
+ */
+static int __init parse_reservetop(char *arg)
+{
+       unsigned long address;
+
+       if (!arg)
+               return -EINVAL;
+
+       address = memparse(arg, &arg);
+       reserve_top_address(address);
+       return 0;
+}
+early_param("reservetop", parse_reservetop);
+
 /*
  * Callback for efi_memory_walk.
  */
@@ -1070,22 +1089,20 @@ static unsigned long __init setup_memory(void)
 
 void __init zone_sizes_init(void)
 {
-       unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
-       unsigned int max_dma, low;
-
-       max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
-       low = max_low_pfn;
-
-       if (low < max_dma)
-               zones_size[ZONE_DMA] = low;
-       else {
-               zones_size[ZONE_DMA] = max_dma;
-               zones_size[ZONE_NORMAL] = low - max_dma;
 #ifdef CONFIG_HIGHMEM
-               zones_size[ZONE_HIGHMEM] = highend_pfn - low;
+       unsigned long max_zone_pfns[MAX_NR_ZONES] = {
+                       virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT,
+                       max_low_pfn,
+                       highend_pfn};
+       add_active_range(0, 0, highend_pfn);
+#else
+       unsigned long max_zone_pfns[MAX_NR_ZONES] = {
+                       virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT,
+                       max_low_pfn};
+       add_active_range(0, 0, max_low_pfn);
 #endif
-       }
-       free_area_init(zones_size);
+
+       free_area_init_nodes(max_zone_pfns);
 }
 #else
 extern unsigned long __init setup_memory(void);
@@ -1147,7 +1164,7 @@ void __init setup_bootmem_allocator(void)
         */
        find_smp_config();
 #endif
-
+       numa_kva_reserve();
 #ifdef CONFIG_BLK_DEV_INITRD
        if (LOADER_TYPE && INITRD_START) {
                if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
@@ -1437,9 +1454,11 @@ void __init setup_arch(char **cmdline_p)
        acpi_boot_table_init();
 #endif
 
+#ifdef CONFIG_PCI
 #ifdef CONFIG_X86_IO_APIC
        check_acpi_pci();       /* Checks more than just ACPI actually */
 #endif
+#endif
 
 #ifdef CONFIG_ACPI
        acpi_boot_init();