diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-07-24 16:53:45 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-08-30 12:12:18 -0400 |
commit | 3daa48d1d9bc44baa079d65e72ef2e3f1139ac03 (patch) | |
tree | 2e659049c5ee5584c789cc42643aa653cfdb307d /arch/arc/mm | |
parent | 5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03 (diff) |
ARC: [ASID] get_new_mmu_context() to conditionally allocate new ASID
ASID allocation changes/1
This patch does 2 things:
(1) get_new_mmu_context() NOW moves mm->ASID to a new value ONLY if it
was from a prev allocation cycle/generation OR if mm had no ASID
allocated (vs. before would unconditionally moving to a new ASID)
Callers desiring unconditional update of ASID, e.g.local_flush_tlb_mm()
(for parent's address space invalidation at fork) need to first force
the parent to an unallocated ASID.
(2) get_new_mmu_context() always sets the MMU PID reg with unchanged/new
ASID value.
The gains are:
- consolidation of all asid alloc logic into get_new_mmu_context()
- avoiding code duplication in switch_mm() for PID reg setting
- Enables future change to fold activate_mm() into switch_mm()
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm')
-rw-r--r-- | arch/arc/mm/tlb.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index a4ad68c4b50d..b5c5e0aa0aaa 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
@@ -258,13 +258,14 @@ noinline void local_flush_tlb_mm(struct mm_struct *mm) | |||
258 | return; | 258 | return; |
259 | 259 | ||
260 | /* | 260 | /* |
261 | * Workaround for Android weirdism: | 261 | * - Move to a new ASID, but only if the mm is still wired in |
262 | * A binder VMA could end up in a task such that vma->mm != tsk->mm | 262 | * (Android Binder ended up calling this for vma->mm != tsk->mm, |
263 | * old code would cause h/w - s/w ASID to get out of sync | 263 | * causing h/w - s/w ASID to get out of sync) |
264 | * - Also get_new_mmu_context() new implementation allocates a new | ||
265 | * ASID only if it is not allocated already - so unallocate first | ||
264 | */ | 266 | */ |
265 | if (current->mm != mm) | 267 | destroy_context(mm); |
266 | destroy_context(mm); | 268 | if (current->mm == mm) |
267 | else | ||
268 | get_new_mmu_context(mm); | 269 | get_new_mmu_context(mm); |
269 | } | 270 | } |
270 | 271 | ||