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

powerpc/64s: remove unnecessary translation cache flushes at boot

The various translation structure invalidations performed in early boot
when the MMU is off are not required, because everything is invalidated
immediately before a CPU first enables its MMU (see early_init_mmu
and early_init_mmu_secondary).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190902152931.17840-6-npiggin@gmail.com

authored by

Nicholas Piggin and committed by
Michael Ellerman
7d805acc 7e71c428

+7 -13
+1 -1
arch/powerpc/mm/book3s64/hash_utils.c
··· 825 825 * For now, UPRT is 0 and we have no segment table. 826 826 */ 827 827 htab_size = __ilog2(htab_size) - 18; 828 - mmu_partition_table_set_entry(0, hash_table | htab_size, 0, true); 828 + mmu_partition_table_set_entry(0, hash_table | htab_size, 0, false); 829 829 pr_info("Partition table %p\n", partition_tb); 830 830 } 831 831
+5
arch/powerpc/mm/book3s64/pgtable.c
··· 252 252 pr_info("PATE registered by ultravisor: dw0 = 0x%lx, dw1 = 0x%lx\n", 253 253 dw0, dw1); 254 254 } else if (flush) { 255 + /* 256 + * Boot does not need to flush, because MMU is off and each 257 + * CPU does a tlbiel_all() before switching them on, which 258 + * flushes everything. 259 + */ 255 260 flush_partition(lpid, (old & PATB_HR)); 256 261 } 257 262 }
+1 -7
arch/powerpc/mm/book3s64/radix_pgtable.c
··· 396 396 rts_field = radix__get_tree_size(); 397 397 dw0 = rts_field | __pa(init_mm.pgd) | RADIX_PGD_INDEX_SIZE | PATB_HR; 398 398 dw1 = __pa(process_tb) | (PRTB_SIZE_SHIFT - 12) | PATB_GR; 399 - mmu_partition_table_set_entry(0, dw0, dw1, true); 400 - 401 - asm volatile("ptesync" : : : "memory"); 402 - asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : 403 - "r" (TLBIEL_INVAL_SET_LPID), "r" (0)); 404 - asm volatile("eieio; tlbsync; ptesync" : : : "memory"); 405 - trace_tlbie(0, 0, TLBIEL_INVAL_SET_LPID, 0, 2, 1, 1); 399 + mmu_partition_table_set_entry(0, dw0, dw1, false); 406 400 407 401 pr_info("Initializing Radix MMU\n"); 408 402 pr_info("Partition table %p\n", partition_tb);
-5
arch/powerpc/platforms/pseries/lpar.c
··· 1549 1549 1550 1550 pseries_lpar_register_process_table(__pa(process_tb), 1551 1551 0, PRTB_SIZE_SHIFT - 12); 1552 - asm volatile("ptesync" : : : "memory"); 1553 - asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : 1554 - "r" (TLBIEL_INVAL_SET_LPID), "r" (0)); 1555 - asm volatile("eieio; tlbsync; ptesync" : : : "memory"); 1556 - trace_tlbie(0, 0, TLBIEL_INVAL_SET_LPID, 0, 2, 1, 1); 1557 1552 } 1558 1553 1559 1554 #ifdef CONFIG_PPC_SMLPAR