Skip to content

Commit

Permalink
powerpc/book3e: Fix TLBCAM preset at boot
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chleroy authored and mpe committed Nov 16, 2021
1 parent ad39760 commit 5b54860
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/nohash/kaslr_booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static unsigned long __init kaslr_choose_location(void *dt_ptr, phys_addr_t size
pr_warn("KASLR: No safe seed for randomizing the kernel base.\n");

ram = min_t(phys_addr_t, __max_low_memory, size);
ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, false);
ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, true);
linear_sz = min_t(unsigned long, ram, SZ_512M);

/* If the linear size is smaller than 64M, do not randmize */
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/mm/nohash/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ static void early_init_this_mmu(void)

if (map)
linear_map_top = map_mem_in_cams(linear_map_top,
num_cams, true, true);
num_cams, false, true);
}
#endif

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

linear_sz = map_mem_in_cams(first_memblock_size, num_cams,
false, true);
true, true);

ppc64_rma_size = min_t(u64, linear_sz, 0x40000000);
} else
Expand Down

0 comments on commit 5b54860

Please sign in to comment.