MIPS: Fix detection of unsupported highmem with cache aliases
[deliverable/linux.git] / arch / mips / kernel / setup.c
index 36cf8d65c47dbef02c408fd9b30428a8a4828998..0d57909d90261d69790156614394bce5325c5bc0 100644 (file)
@@ -87,6 +87,13 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
        int x = boot_mem_map.nr_map;
        int i;
 
+       /*
+        * If the region reaches the top of the physical address space, adjust
+        * the size slightly so that (start + size) doesn't overflow
+        */
+       if (start + size - 1 == (phys_addr_t)ULLONG_MAX)
+               --size;
+
        /* Sanity check */
        if (start + size < start) {
                pr_warn("Trying to add an invalid memory region, skipped\n");
@@ -757,7 +764,6 @@ static void __init arch_mem_init(char **cmdline_p)
        device_tree_init();
        sparse_init();
        plat_swiotlb_setup();
-       paging_init();
 
        dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
        /* Tell bootmem about cma reserved memblock section */
@@ -870,6 +876,7 @@ void __init setup_arch(char **cmdline_p)
        prefill_possible_map();
 
        cpu_cache_init();
+       paging_init();
 }
 
 unsigned long kernelsp[NR_CPUS];
This page took 0.027485 seconds and 5 git commands to generate.