]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/powerpc/mm/tlb-radix.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / arch / powerpc / mm / tlb-radix.c
index 3493cf4e045258df20f5cf47990e991b6af265b7..952713d6cf04d0e826a685f181561d587df41257 100644 (file)
@@ -50,9 +50,7 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)
        for (set = 0; set < POWER9_TLB_SETS_RADIX ; set++) {
                __tlbiel_pid(pid, set, ric);
        }
-       if (cpu_has_feature(CPU_FTR_POWER9_DD1))
-               asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
-       return;
+       asm volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory");
 }
 
 static inline void _tlbie_pid(unsigned long pid, unsigned long ric)
@@ -85,8 +83,6 @@ static inline void _tlbiel_va(unsigned long va, unsigned long pid,
        asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1)
                     : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(rs) : "memory");
        asm volatile("ptesync": : :"memory");
-       if (cpu_has_feature(CPU_FTR_POWER9_DD1))
-               asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
 }
 
 static inline void _tlbie_va(unsigned long va, unsigned long pid,
@@ -428,3 +424,21 @@ void radix__flush_tlb_all(void)
                     : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(0) : "memory");
        asm volatile("eieio; tlbsync; ptesync": : :"memory");
 }
+
+void radix__flush_tlb_pte_p9_dd1(unsigned long old_pte, struct mm_struct *mm,
+                                unsigned long address)
+{
+       /*
+        * We track page size in pte only for DD1, So we can
+        * call this only on DD1.
+        */
+       if (!cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+               VM_WARN_ON(1);
+               return;
+       }
+
+       if (old_pte & _PAGE_LARGE)
+               radix__flush_tlb_page_psize(mm, address, MMU_PAGE_2M);
+       else
+               radix__flush_tlb_page_psize(mm, address, mmu_virtual_psize);
+}