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

powerpc/mm/radix: Limit paca allocation in radix

On return from RTAS we access the paca variables and we have 64 bit
disabled. This requires us to limit paca in 32 bit range.

Fix this by setting ppc64_rma_size to first_memblock_size/1G range.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Aneesh Kumar K.V and committed by
Michael Ellerman
177ba7c6 764041e0

+19 -1
+19 -1
arch/powerpc/mm/pgtable-radix.c
··· 351 351 void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base, 352 352 phys_addr_t first_memblock_size) 353 353 { 354 - /* Finally limit subsequent allocations */ 354 + /* We don't currently support the first MEMBLOCK not mapping 0 355 + * physical on those processors 356 + */ 357 + BUG_ON(first_memblock_base != 0); 358 + /* 359 + * We limit the allocation that depend on ppc64_rma_size 360 + * to first_memblock_size. We also clamp it to 1GB to 361 + * avoid some funky things such as RTAS bugs. 362 + * 363 + * On radix config we really don't have a limitation 364 + * on real mode access. But keeping it as above works 365 + * well enough. 366 + */ 367 + ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000); 368 + /* 369 + * Finally limit subsequent allocations. We really don't want 370 + * to limit the memblock allocations to rma_size. FIXME!! should 371 + * we even limit at all ? 372 + */ 355 373 memblock_set_current_limit(first_memblock_base + first_memblock_size); 356 374 } 357 375