Browse Source

arm64: Remove I-cache invalidation from flush_cache_range()

The flush_cache_range() function (similarly for flush_cache_page()) is
called when the kernel is changing an existing VA->PA mapping range to
either a new PA or to different attributes. Since ARMv8 has PIPT-like
D-caches, this function does not need to perform any D-cache
maintenance. The I-cache maintenance is already handled via set_pte_at()
and flush_cache_range() cannot anyway guarantee that there are no cache
lines left after invalidation due to the speculative loads.

This patch makes flush_cache_range() a no-op.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Catalin Marinas 8 years ago
parent
commit
ee6a7fce8e
2 changed files with 5 additions and 8 deletions
  1. 5 1
      arch/arm64/include/asm/cacheflush.h
  2. 0 7
      arch/arm64/mm/flush.c

+ 5 - 1
arch/arm64/include/asm/cacheflush.h

@@ -65,7 +65,6 @@
  *		- kaddr  - page address
  *		- kaddr  - page address
  *		- size   - region size
  *		- size   - region size
  */
  */
-extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
 extern void flush_icache_range(unsigned long start, unsigned long end);
 extern void flush_icache_range(unsigned long start, unsigned long end);
 extern void __flush_dcache_area(void *addr, size_t len);
 extern void __flush_dcache_area(void *addr, size_t len);
 extern void __clean_dcache_area_poc(void *addr, size_t len);
 extern void __clean_dcache_area_poc(void *addr, size_t len);
@@ -82,6 +81,11 @@ static inline void flush_cache_page(struct vm_area_struct *vma,
 {
 {
 }
 }
 
 
+static inline void flush_cache_range(struct vm_area_struct *vma,
+				     unsigned long start, unsigned long end)
+{
+}
+
 /*
 /*
  * Cache maintenance functions used by the DMA API. No to be used directly.
  * Cache maintenance functions used by the DMA API. No to be used directly.
  */
  */

+ 0 - 7
arch/arm64/mm/flush.c

@@ -25,13 +25,6 @@
 #include <asm/cachetype.h>
 #include <asm/cachetype.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
 
 
-void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
-		       unsigned long end)
-{
-	if (vma->vm_flags & VM_EXEC)
-		__flush_icache_all();
-}
-
 void sync_icache_aliases(void *kaddr, unsigned long len)
 void sync_icache_aliases(void *kaddr, unsigned long len)
 {
 {
 	unsigned long addr = (unsigned long)kaddr;
 	unsigned long addr = (unsigned long)kaddr;