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

Commit cb206ed9 authored by Andreas Larsson's avatar Andreas Larsson Committed by Greg Kroah-Hartman
Browse files

sparc32: Limit memblock allocation to low memory



[ Upstream commit bda166930c37604ffa93f2425426af6921ec575a ]

Commit cca079ef changed sparc32 to use
memblocks instead of bootmem, but also made high memory available via
memblock allocation which does not work together with e.g. phys_to_virt
and can lead to kernel panic.

This changes back to only low memory being allocatable in the early
stages, now using memblock allocation.

Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b6d302a8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -199,6 +199,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
	size = memblock_phys_mem_size() - memblock_reserved_size();
	*pages_avail = (size >> PAGE_SHIFT) - high_pages;

	/* Only allow low memory to be allocated via memblock allocation */
	memblock_set_current_limit(max_low_pfn << PAGE_SHIFT);

	return max_pfn;
}