Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

microblaze: Use active regions

Register lowmem active regions.

Signed-off-by: Michal Simek <monstr@monstr.eu>

+20 -2
+4
arch/microblaze/Kconfig
··· 1 1 config MICROBLAZE 2 2 def_bool y 3 3 select HAVE_MEMBLOCK 4 + select HAVE_MEMBLOCK_NODE_MAP 4 5 select HAVE_FUNCTION_TRACER 5 6 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 6 7 select HAVE_FUNCTION_GRAPH_TRACER ··· 29 28 def_bool y 30 29 31 30 config ZONE_DMA 31 + def_bool y 32 + 33 + config ARCH_POPULATES_NODE_MAP 32 34 def_bool y 33 35 34 36 config RWSEM_XCHGADD_ALGORITHM
+16 -2
arch/microblaze/mm/init.c
··· 68 68 69 69 zones_size[ZONE_DMA] = max_pfn; 70 70 71 - free_area_init(zones_size); 71 + /* We don't have holes in memory map */ 72 + free_area_init_nodes(zones_size); 72 73 } 73 74 74 75 void __init setup_memory(void) ··· 143 142 PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn); 144 143 memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size); 145 144 145 + /* Add active regions with valid PFNs */ 146 + for_each_memblock(memory, reg) { 147 + unsigned long start_pfn, end_pfn; 148 + 149 + start_pfn = memblock_region_memory_base_pfn(reg); 150 + end_pfn = memblock_region_memory_end_pfn(reg); 151 + memblock_set_node(start_pfn << PAGE_SHIFT, 152 + (end_pfn - start_pfn) << PAGE_SHIFT, 0); 153 + } 154 + 146 155 /* free bootmem is whole main memory */ 147 - free_bootmem(memory_start, lowmem_size); 156 + free_bootmem_with_active_regions(0, max_low_pfn); 148 157 149 158 /* reserve allocate blocks */ 150 159 for_each_memblock(reserved, reg) { ··· 172 161 reserve_bootmem(reg->base, trunc_size, BOOTMEM_DEFAULT); 173 162 } 174 163 } 164 + 165 + /* XXX need to clip this if using highmem? */ 166 + sparse_memory_present_with_active_regions(0); 175 167 176 168 #ifdef CONFIG_MMU 177 169 init_bootmem_done = 1;