summaryrefslogtreecommitdiff
path: root/arch/nios2/mm
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-11-05 05:51:44 +0300
committerLey Foon Tan <ley.foon.tan@intel.com>2019-03-07 00:29:35 +0300
commite71c99fe8da9b8ab07b837a6f317c327d6a2b3df (patch)
treeb4557ee6f69e1f31e2302d6699da93c23c0632f9 /arch/nios2/mm
parent58fd4766787eacd89a0859b0c4b90bd24258f971 (diff)
downloadlinux-e71c99fe8da9b8ab07b837a6f317c327d6a2b3df.tar.xz
nios2: flush_tlb_mm flush only the pid
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>
Diffstat (limited to 'arch/nios2/mm')
-rw-r--r--arch/nios2/mm/tlb.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/nios2/mm/tlb.c b/arch/nios2/mm/tlb.c
index b87387d664d1..e87304e1fc3f 100644
--- a/arch/nios2/mm/tlb.c
+++ b/arch/nios2/mm/tlb.c
@@ -40,18 +40,6 @@ static unsigned long pteaddr_invalid(unsigned long addr)
}
/*
- * 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;