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

powerpc: Fix memory limits when starting at a non-zero address

memblock_enforce_memory_limit() takes the desired maximum quantity of memory
to end up with, not an address above which memory will not be used.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Scott Wood and committed by
Benjamin Herrenschmidt
6dd22700 c7704d35

+2 -2
+1 -1
arch/powerpc/kernel/prom.c
··· 97 97 start = __pa(initial_boot_params); 98 98 size = be32_to_cpu(initial_boot_params->totalsize); 99 99 100 - if ((memory_limit && (start + size) > memory_limit) || 100 + if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) || 101 101 overlaps_crashkernel(start, size)) { 102 102 p = __va(memblock_alloc(size, PAGE_SIZE)); 103 103 memcpy(p, initial_boot_params, size);
+1 -1
arch/powerpc/mm/init_32.c
··· 148 148 lowmem_end_addr = memstart_addr + total_lowmem; 149 149 #ifndef CONFIG_HIGHMEM 150 150 total_memory = total_lowmem; 151 - memblock_enforce_memory_limit(lowmem_end_addr); 151 + memblock_enforce_memory_limit(total_lowmem); 152 152 memblock_analyze(); 153 153 #endif /* CONFIG_HIGHMEM */ 154 154 }