arm64: mm: Optimise tlb flush logic where we have >4K granule
authorSteve Capper <steve.capper@linaro.org>
Fri, 2 May 2014 13:49:00 +0000 (14:49 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 9 May 2014 16:00:48 +0000 (17:00 +0100)
commitfa48e6f780a681cdbc7820e33259edfe1a79b9e3
treeda5837202213dc3df8a43106455b757625ed30b0
parente1dfda9ced9bea1413a736f0d578f8218a7788ec
arm64: mm: Optimise tlb flush logic where we have >4K granule

The tlb maintainence functions: __cpu_flush_user_tlb_range and
__cpu_flush_kern_tlb_range do not take into consideration the page
granule when looping through the address range, and repeatedly flush
tlb entries for the same page when operating with 64K pages.

This patch re-works the logic s.t. we instead advance the loop by
 1 << (PAGE_SHIFT - 12), so avoid repeating ourselves.

Also the routines have been converted from assembler to static inline
functions to aid with legibility and potential compiler optimisations.

The isb() has been removed from flush_tlb_kernel_range(.) as it is
only needed when changing the execute permission of a mapping. If one
needs to set an area of the kernel as execute/non-execute an isb()
must be inserted after the call to flush_tlb_kernel_range.

Cc: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/tlbflush.h
arch/arm64/mm/Makefile
arch/arm64/mm/tlb.S [deleted file]