sparc32: Limit memblock allocation to low memory
Andreas Larsson
maintainerPATCH 1/1 sparc32: Limit memblock allocation to low memory
Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use memblocks instead of bootmem, but also made high memory available via memblock allocation which does work together with e.g. phys_to_virt and leads to crashes.
This changes back to only low memory being allocatable in the early stages, now using memblock allocation.
Signed-off-by Andreas Larsson <[email protected]>
--- arch/sparc/mm/init_32.c | 3 +++ 1 file changed, 3 insertions(+)
arch/sparc/mm/init_32.c +3 -0
@@ -197,6 +197,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; }
Signature · 1 line
2.17.1
Quoted 9 lines · Andreas Larsson
Commit
cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0changed sparc32 to use memblocks instead of bootmem, but also made high memory available via memblock allocation which does work together with e.g.phys_to_virtand leads to crashes.This changes back to only low memory being allocatable in the early stages, now using memblock allocation.
Signed-off-by Andreas Larsson <[email protected]>
Acked-by Mike Rapoport <[email protected]>
Quoted 21 lines
--- arch/sparc/mm/init_32.c | 3 +++ 1 file changed, 3 insertions(+)arch/sparc/mm/init_32.c +3
-0@@ -197,6 +197,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; }Signature · 1 line
2.17.1
Signature · 2 lines
Sincerely yours, Mike.