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

powerpc/64s: make mmu_partition_table_set_entry TLB flush optional

No functional change.

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-4-npiggin@gmail.com

authored by

Nicholas Piggin and committed by
Michael Ellerman
fd13daea 99161de3

+6 -6
+1 -1
arch/powerpc/include/asm/mmu.h
··· 257 257 /* Functions for creating and updating partition table on POWER9 */ 258 258 extern void mmu_partition_table_init(void); 259 259 extern void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, 260 - unsigned long dw1); 260 + unsigned long dw1, bool flush); 261 261 #endif /* CONFIG_PPC64 */ 262 262 263 263 struct mm_struct;
+1 -1
arch/powerpc/kvm/book3s_hv_nested.c
··· 411 411 void kvmhv_set_ptbl_entry(unsigned int lpid, u64 dw0, u64 dw1) 412 412 { 413 413 if (!kvmhv_on_pseries()) { 414 - mmu_partition_table_set_entry(lpid, dw0, dw1); 414 + mmu_partition_table_set_entry(lpid, dw0, dw1, true); 415 415 return; 416 416 } 417 417
+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); 828 + mmu_partition_table_set_entry(0, hash_table | htab_size, 0, true); 829 829 pr_info("Partition table %p\n", partition_tb); 830 830 } 831 831
+2 -2
arch/powerpc/mm/book3s64/pgtable.c
··· 224 224 } 225 225 226 226 void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, 227 - unsigned long dw1) 227 + unsigned long dw1, bool flush) 228 228 { 229 229 unsigned long old = be64_to_cpu(partition_tb[lpid].patb0); 230 230 ··· 251 251 uv_register_pate(lpid, dw0, dw1); 252 252 pr_info("PATE registered by ultravisor: dw0 = 0x%lx, dw1 = 0x%lx\n", 253 253 dw0, dw1); 254 - } else { 254 + } else if (flush) { 255 255 flush_partition(lpid, (old & PATB_HR)); 256 256 } 257 257 }
+1 -1
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); 399 + mmu_partition_table_set_entry(0, dw0, dw1, true); 400 400 401 401 asm volatile("ptesync" : : : "memory"); 402 402 asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : :