Commit ffbe5d21 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

powerpc/64: pcpu setup avoid reading mmu_linear_psize on 64e or radix



Radix never sets mmu_linear_psize so it's always 4K, which causes pcpu
atom_size to always be PAGE_SIZE. 64e sets it to 1GB always.

Make paths for these platforms to be explicit about what value they set
atom_size to.

Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211201144153.2456614-12-npiggin@gmail.com
parent f43d2ffb
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -879,6 +879,14 @@ void __init setup_per_cpu_areas(void)
	unsigned int cpu;
	int rc = -EINVAL;

	/*
	 * BookE and BookS radix are historical values and should be revisited.
	 */
	if (IS_ENABLED(CONFIG_PPC_BOOK3E)) {
		atom_size = SZ_1M;
	} else if (radix_enabled()) {
		atom_size = PAGE_SIZE;
	} else {
		/*
		 * Linear mapping is one of 4K, 1M and 16M.  For 4K, no need
		 * to group units.  For larger mappings, use 1M atom which
@@ -887,7 +895,8 @@ void __init setup_per_cpu_areas(void)
		if (mmu_linear_psize == MMU_PAGE_4K)
			atom_size = PAGE_SIZE;
		else
		atom_size = 1 << 20;
			atom_size = SZ_1M;
	}

	if (pcpu_chosen_fc != PCPU_FC_PAGE) {
		rc = pcpu_embed_first_chunk(0, dyn_size, atom_size, pcpu_cpu_distance,