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

powerpc: Only use initrd_end as the limit for alloc_bottom if it's inside the RMO.

As the kernels and initrd's get bigger boot-loaders and possibly
kexec-tools will need to place the initrd outside the RMO. When this
happens we end up with no lowmem and the boot doesn't get very far.

Only use initrd_end as the limit for alloc_bottom if it's inside the
RMO.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Paul Mackerras and committed by
Benjamin Herrenschmidt
64968f60 b206590c

+9 -8
+9 -8
arch/powerpc/kernel/prom_init.c
··· 1224 1224 1225 1225 RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000); 1226 1226 1227 - /* Check if we have an initrd after the kernel, if we do move our bottom 1228 - * point to after it 1229 - */ 1230 - if (RELOC(prom_initrd_start)) { 1231 - if (RELOC(prom_initrd_end) > RELOC(alloc_bottom)) 1232 - RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end)); 1233 - } 1234 - 1235 1227 /* 1236 1228 * If prom_memory_limit is set we reduce the upper limits *except* for 1237 1229 * alloc_top_high. This must be the real top of RAM so we can put ··· 1260 1268 RELOC(rmo_top) = min(0x30000000ul, RELOC(rmo_top)); 1261 1269 RELOC(alloc_top) = RELOC(rmo_top); 1262 1270 RELOC(alloc_top_high) = RELOC(ram_top); 1271 + 1272 + /* 1273 + * Check if we have an initrd after the kernel but still inside 1274 + * the RMO. If we do move our bottom point to after it. 1275 + */ 1276 + if (RELOC(prom_initrd_start) && 1277 + RELOC(prom_initrd_start) < RELOC(rmo_top) && 1278 + RELOC(prom_initrd_end) > RELOC(alloc_bottom)) 1279 + RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end)); 1263 1280 1264 1281 prom_printf("memory layout at init:\n"); 1265 1282 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));