aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@mips.com>2019-02-02 01:43:17 +0000
committerPaul Burton <paul.burton@mips.com>2019-02-04 10:56:14 -0800
commit4739f7dd99d757fb719e1173b4d2bcfc0f93e52d (patch)
treec7a85575e022a360e968858ea3bb6db421630740 /arch/mips/include
parentMIPS: mm: Remove redundant drop_mmu_context() cpu argument (diff)
downloadlinux-dev-4739f7dd99d757fb719e1173b4d2bcfc0f93e52d.tar.xz
linux-dev-4739f7dd99d757fb719e1173b4d2bcfc0f93e52d.zip
MIPS: mm: Remove redundant get_new_mmu_context() cpu argument
get_new_mmu_context() accepts a cpu argument, but implicitly assumes that this is always equal to smp_processor_id() by operating on the local CPU's TLB & icache. Remove the cpu argument and have get_new_mmu_context() call smp_processor_id() instead. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/mmu_context.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
index dc45690cbbf5..0d050d781737 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -100,9 +100,13 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
/* Normal, classic MIPS get_new_mmu_context */
static inline void
-get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
+get_new_mmu_context(struct mm_struct *mm)
{
- u64 asid = asid_cache(cpu);
+ unsigned int cpu;
+ u64 asid;
+
+ cpu = smp_processor_id();
+ asid = asid_cache(cpu);
if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) {
if (cpu_has_vtag_icache)
@@ -142,7 +146,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
htw_stop();
/* Check if our ASID is of an older version and thus invalid */
if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & asid_version_mask(cpu))
- get_new_mmu_context(next, cpu);
+ get_new_mmu_context(next);
write_c0_entryhi(cpu_asid(cpu, next));
TLBMISS_HANDLER_SETUP_PGD(next->pgd);
@@ -184,7 +188,7 @@ drop_mmu_context(struct mm_struct *mm)
cpu = smp_processor_id();
if (cpumask_test_cpu(cpu, mm_cpumask(mm))) {
- get_new_mmu_context(mm, cpu);
+ get_new_mmu_context(mm);
write_c0_entryhi(cpu_asid(cpu, mm));
} else {
/* will get a new context next time */