diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2014-02-14 14:08:48 +0400 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2014-04-06 21:29:17 +0400 |
commit | 04c6b3e2b5e5c1dbd99ad7620033eafd05ff4c26 (patch) | |
tree | a6f93ad79be6262819a5bc6b73f2646c4f4985dd /arch/xtensa/mm/tlb.c | |
parent | 8585b316bbed9339412d267c1fd8839dd059d69f (diff) | |
download | op-kernel-dev-04c6b3e2b5e5c1dbd99ad7620033eafd05ff4c26.zip op-kernel-dev-04c6b3e2b5e5c1dbd99ad7620033eafd05ff4c26.tar.gz |
xtensa: optimize local_flush_tlb_kernel_range
Don't flush whole TLB if only a small kernel range is requested.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/mm/tlb.c')
-rw-r--r-- | arch/xtensa/mm/tlb.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index ade62382..5ece856 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -149,6 +149,21 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) local_irq_restore(flags); } +void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) +{ + if (end > start && start >= TASK_SIZE && end <= PAGE_OFFSET && + end - start < _TLB_ENTRIES << PAGE_SHIFT) { + start &= PAGE_MASK; + while (start < end) { + invalidate_itlb_mapping(start); + invalidate_dtlb_mapping(start); + start += PAGE_SIZE; + } + } else { + local_flush_tlb_all(); + } +} + #ifdef CONFIG_DEBUG_TLB_SANITY static unsigned get_pte_for_vaddr(unsigned vaddr) |