Merge branch 'linus' into x86/memory-corruption-check
[linux-2.6-block.git] / arch / x86 / mm / init_32.c
index 9b5f7d7049d044c78f017f1f33377ac5db4caed7..7e05462ffb1177e9a53b9e229170e90cdfa35db5 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/paravirt.h>
 #include <asm/setup.h>
 #include <asm/cacheflush.h>
+#include <asm/smp.h>
 
 unsigned int __VMALLOC_RESERVE = 128 << 20;
 
@@ -513,11 +514,7 @@ static void __init pagetable_init(void)
 {
        pgd_t *pgd_base = swapper_pg_dir;
 
-       paravirt_pagetable_setup_start(pgd_base);
-
        permanent_kmaps_init(pgd_base);
-
-       paravirt_pagetable_setup_done(pgd_base);
 }
 
 #ifdef CONFIG_ACPI_SLEEP
@@ -777,7 +774,7 @@ void __init setup_bootmem_allocator(void)
        after_init_bootmem = 1;
 }
 
-static void __init find_early_table_space(unsigned long end)
+static void __init find_early_table_space(unsigned long end, int use_pse)
 {
        unsigned long puds, pmds, ptes, tables, start;
 
@@ -787,7 +784,7 @@ static void __init find_early_table_space(unsigned long end)
        pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
        tables += PAGE_ALIGN(pmds * sizeof(pmd_t));
 
-       if (cpu_has_pse) {
+       if (use_pse) {
                unsigned long extra;
 
                extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
@@ -827,12 +824,22 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
        pgd_t *pgd_base = swapper_pg_dir;
        unsigned long start_pfn, end_pfn;
        unsigned long big_page_start;
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       /*
+        * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
+        * This will simplify cpa(), which otherwise needs to support splitting
+        * large pages into small in interrupt context, etc.
+        */
+       int use_pse = 0;
+#else
+       int use_pse = cpu_has_pse;
+#endif
 
        /*
         * Find space for the kernel direct mapping tables.
         */
        if (!after_init_bootmem)
-               find_early_table_space(end);
+               find_early_table_space(end, use_pse);
 
 #ifdef CONFIG_X86_PAE
        set_nx();
@@ -878,7 +885,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
        end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
        if (start_pfn < end_pfn)
                kernel_physical_mapping_init(pgd_base, start_pfn, end_pfn,
-                                               cpu_has_pse);
+                                            use_pse);
 
        /* tail is not big page alignment ? */
        start_pfn = end_pfn;
@@ -962,6 +969,8 @@ void __init mem_init(void)
        int codesize, reservedpages, datasize, initsize;
        int tmp;
 
+       start_periodic_check_for_corruption();
+
 #ifdef CONFIG_FLATMEM
        BUG_ON(!mem_map);
 #endif
@@ -1041,7 +1050,6 @@ void __init mem_init(void)
        if (boot_cpu_data.wp_works_ok < 0)
                test_wp_bit();
 
-       cpa_init();
        save_pg_dir();
        zap_low_mappings();
 }