aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2016-08-23 06:57:48 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-09-22 17:54:18 -0400
commitbe34d300597a7a4fb38c6e3f9929af2f1faa23b8 (patch)
tree30bc236bd0c06141386047c2bf1a1a3df8c35b5f
parentfe036a0605d60d6c81ffdcd6241e9ae0013fe235 (diff)
powerpc/mm: Add radix flush all with IS=3
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/book3s/64/tlbflush-radix.h1
-rw-r--r--arch/powerpc/mm/tlb-radix.c24
2 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
index 65037762b120..a9e19cb2f7c5 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
@@ -41,4 +41,5 @@ extern void radix__flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmad
41extern void radix__flush_tlb_lpid_va(unsigned long lpid, unsigned long gpa, 41extern void radix__flush_tlb_lpid_va(unsigned long lpid, unsigned long gpa,
42 unsigned long page_size); 42 unsigned long page_size);
43extern void radix__flush_tlb_lpid(unsigned long lpid); 43extern void radix__flush_tlb_lpid(unsigned long lpid);
44extern void radix__flush_tlb_all(void);
44#endif 45#endif
diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c
index 48df05ef5231..0e49ec541ab5 100644
--- a/arch/powerpc/mm/tlb-radix.c
+++ b/arch/powerpc/mm/tlb-radix.c
@@ -400,3 +400,27 @@ void radix__flush_pmd_tlb_range(struct vm_area_struct *vma,
400 radix__flush_tlb_range_psize(vma->vm_mm, start, end, MMU_PAGE_2M); 400 radix__flush_tlb_range_psize(vma->vm_mm, start, end, MMU_PAGE_2M);
401} 401}
402EXPORT_SYMBOL(radix__flush_pmd_tlb_range); 402EXPORT_SYMBOL(radix__flush_pmd_tlb_range);
403
404void radix__flush_tlb_all(void)
405{
406 unsigned long rb,prs,r,rs;
407 unsigned long ric = RIC_FLUSH_ALL;
408
409 rb = 0x3 << PPC_BITLSHIFT(53); /* IS = 3 */
410 prs = 0; /* partition scoped */
411 r = 1; /* raidx format */
412 rs = 1 & ((1UL << 32) - 1); /* any LPID value to flush guest mappings */
413
414 asm volatile("ptesync": : :"memory");
415 /*
416 * now flush guest entries by passing PRS = 1 and LPID != 0
417 */
418 asm volatile(PPC_TLBIE_5(%0, %4, %3, %2, %1)
419 : : "r"(rb), "i"(r), "i"(1), "i"(ric), "r"(rs) : "memory");
420 /*
421 * now flush host entires by passing PRS = 0 and LPID == 0
422 */
423 asm volatile(PPC_TLBIE_5(%0, %4, %3, %2, %1)
424 : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(0) : "memory");
425 asm volatile("eieio; tlbsync; ptesync": : :"memory");
426}