Skip to content

Commit 99ed6ae

Browse files
andreas-gaislergregkh
authored andcommitted
sparc32: Limit memblock allocation to low memory
[ Upstream commit bda1669 ] Commit cca079e 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: Andreas Larsson <andreas@gaisler.com> Acked-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 661cba4 commit 99ed6ae

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎arch/sparc/mm/init_32.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
197197
size = memblock_phys_mem_size() - memblock_reserved_size();
198198
*pages_avail = (size >> PAGE_SHIFT) - high_pages;
199199

200+
/* Only allow low memory to be allocated via memblock allocation */
201+
memblock_set_current_limit(max_low_pfn << PAGE_SHIFT);
202+
200203
return max_pfn;
201204
}
202205

0 commit comments

Comments
 (0)