]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nios2: flush_tlb_mm flush only the pid
authorNicholas Piggin <npiggin@gmail.com>
Mon, 5 Nov 2018 02:51:44 +0000 (10:51 +0800)
committerLey Foon Tan <ley.foon.tan@intel.com>
Wed, 6 Mar 2019 21:29:35 +0000 (05:29 +0800)
Currently flush_tlb_mm flushes the entire TLB. Switch it to doing a
PID aware flush. This also improves the readibility of flush_tlb_pid.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
arch/nios2/mm/tlb.c

index b87387d664d159fed67c868e2ccb0115c4abec00..e87304e1fc3fa91a51817d48fab23df64b502ce8 100644 (file)
@@ -39,18 +39,6 @@ static unsigned long pteaddr_invalid(unsigned long addr)
        return ((addr | 0xC0000000UL) >> PAGE_SHIFT) << 2;
 }
 
-/*
- * All entries common to a mm share an asid.  To effectively flush these
- * entries, we just bump the asid.
- */
-void flush_tlb_mm(struct mm_struct *mm)
-{
-       if (current->mm == mm)
-               flush_tlb_all();
-       else
-               memset(&mm->context, 0, sizeof(mm_context_t));
-}
-
 /*
  * This one is only used for pages with the global bit set so we don't care
  * much about the ASID.
@@ -233,6 +221,20 @@ void flush_tlb_pid(unsigned long pid)
        WRCTL(CTL_TLBMISC, org_misc);
 }
 
+/*
+ * All entries common to a mm share an asid.  To effectively flush these
+ * entries, we just bump the asid.
+ */
+void flush_tlb_mm(struct mm_struct *mm)
+{
+       if (current->mm == mm) {
+               unsigned long mmu_pid = get_pid_from_context(&mm->context);
+               flush_tlb_pid(mmu_pid);
+       } else {
+               memset(&mm->context, 0, sizeof(mm_context_t));
+       }
+}
+
 void flush_tlb_all(void)
 {
        unsigned long addr = 0;