Skip to content

Commit 5b54860

Browse files
chleroympe
authored andcommitted
powerpc/book3e: Fix TLBCAM preset at boot
Commit 52bda69 ("powerpc/fsl_booke: Tell map_mem_in_cams() if init is done") was supposed to just add an additional parameter to map_mem_in_cams() and always set it to 'true' at that time. But a few call sites were messed up. Fix them. Fixes: 52bda69 ("powerpc/fsl_booke: Tell map_mem_in_cams() if init is done") Reported-by: Christian Zigotzky <[email protected]> Signed-off-by: Christophe Leroy <[email protected]> Tested-by: Christian Zigotzky <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/d319f2a9367d4d08fd2154e506101bd5f100feeb.1636967119.git.christophe.leroy@csgroup.eu
1 parent ad39760 commit 5b54860

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/powerpc/mm/nohash/kaslr_booke.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static unsigned long __init kaslr_choose_location(void *dt_ptr, phys_addr_t size
314314
pr_warn("KASLR: No safe seed for randomizing the kernel base.\n");
315315

316316
ram = min_t(phys_addr_t, __max_low_memory, size);
317-
ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, false);
317+
ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, true);
318318
linear_sz = min_t(unsigned long, ram, SZ_512M);
319319

320320
/* If the linear size is smaller than 64M, do not randmize */

arch/powerpc/mm/nohash/tlb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void early_init_this_mmu(void)
645645

646646
if (map)
647647
linear_map_top = map_mem_in_cams(linear_map_top,
648-
num_cams, true, true);
648+
num_cams, false, true);
649649
}
650650
#endif
651651

@@ -766,7 +766,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
766766
num_cams = (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) / 4;
767767

768768
linear_sz = map_mem_in_cams(first_memblock_size, num_cams,
769-
false, true);
769+
true, true);
770770

771771
ppc64_rma_size = min_t(u64, linear_sz, 0x40000000);
772772
} else

0 commit comments

Comments
 (0)