Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64968f60 authored by Paul Mackerras's avatar Paul Mackerras Committed by Benjamin Herrenschmidt
Browse files

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: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarTony Breeds <tony@bakeyournoodle.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent b206590c
Loading
Loading
Loading
Loading
+9 −8
Original line number Original line Diff line number Diff line
@@ -1224,14 +1224,6 @@ static void __init prom_init_mem(void)


	RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);
	RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);


	/* Check if we have an initrd after the kernel, if we do move our bottom
	 * point to after it
	 */
	if (RELOC(prom_initrd_start)) {
		if (RELOC(prom_initrd_end) > RELOC(alloc_bottom))
			RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end));
	}

	/*
	/*
	 * If prom_memory_limit is set we reduce the upper limits *except* for
	 * If prom_memory_limit is set we reduce the upper limits *except* for
	 * alloc_top_high. This must be the real top of RAM so we can put
	 * alloc_top_high. This must be the real top of RAM so we can put
@@ -1269,6 +1261,15 @@ static void __init prom_init_mem(void)
	RELOC(alloc_top) = RELOC(rmo_top);
	RELOC(alloc_top) = RELOC(rmo_top);
	RELOC(alloc_top_high) = RELOC(ram_top);
	RELOC(alloc_top_high) = RELOC(ram_top);


	/*
	 * Check if we have an initrd after the kernel but still inside
	 * the RMO.  If we do move our bottom point to after it.
	 */
	if (RELOC(prom_initrd_start) &&
	    RELOC(prom_initrd_start) < RELOC(rmo_top) &&
	    RELOC(prom_initrd_end) > RELOC(alloc_bottom))
		RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end));

	prom_printf("memory layout at init:\n");
	prom_printf("memory layout at init:\n");
	prom_printf("  memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
	prom_printf("  memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
	prom_printf("  alloc_bottom : %x\n", RELOC(alloc_bottom));
	prom_printf("  alloc_bottom : %x\n", RELOC(alloc_bottom));