[PATCH v5 4/6] arm64: remove __asm_flush_icache_range

From: Pavel Tatashin
Date: Thu Jan 02 2020 - 16:14:25 EST


__asm_flush_icache_range is an alias to __asm_flush_cache_user_range,
but now that these functions are called from C wrappers the fall
through can instead be done at a higher level.

Remove the __asm_flush_icache_range alias in assembly, and instead call
__flush_cache_user_range() from __flush_icache_range().

Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
---
arch/arm64/include/asm/cacheflush.h | 5 +----
arch/arm64/mm/cache.S | 14 --------------
arch/arm64/mm/flush.c | 2 +-
3 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h
index cb00c61e0bde..047af338ba15 100644
--- a/arch/arm64/include/asm/cacheflush.h
+++ b/arch/arm64/include/asm/cacheflush.h
@@ -61,7 +61,6 @@
* - kaddr - page address
* - size - region size
*/
-extern void __asm_flush_icache_range(unsigned long start, unsigned long end);
extern long __asm_flush_cache_user_range(unsigned long start,
unsigned long end);
extern int __asm_invalidate_icache_range(unsigned long start,
@@ -87,9 +86,7 @@ static inline long __flush_cache_user_range(unsigned long start,

static inline void __flush_icache_range(unsigned long start, unsigned long end)
{
- uaccess_ttbr0_enable();
- __asm_flush_icache_range(start, end);
- uaccess_ttbr0_disable();
+ __flush_cache_user_range(start, end);
}

static inline int invalidate_icache_range(unsigned long start,
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
index 602b9aa8603a..1981cbaf5d92 100644
--- a/arch/arm64/mm/cache.S
+++ b/arch/arm64/mm/cache.S
@@ -14,19 +14,6 @@
#include <asm/alternative.h>
#include <asm/asm-uaccess.h>

-/*
- * __asm_flush_icache_range(start,end)
- *
- * Ensure that the I and D caches are coherent within specified region.
- * This is typically used when code has been written to a memory region,
- * and will be executed.
- *
- * - start - virtual start address of region
- * - end - virtual end address of region
- */
-ENTRY(__asm_flush_icache_range)
- /* FALLTHROUGH */
-
/*
* __asm_flush_cache_user_range(start,end)
*
@@ -62,7 +49,6 @@ alternative_else_nop_endif
1: ret
9: mov x0, #-EFAULT
b 1b
-ENDPROC(__asm_flush_icache_range)
ENDPROC(__asm_flush_cache_user_range)

/*
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index b23f34d23f31..61521285f27d 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -75,7 +75,7 @@ EXPORT_SYMBOL(flush_dcache_page);
/*
* Additional functions defined in assembly.
*/
-EXPORT_SYMBOL(__asm_flush_icache_range);
+EXPORT_SYMBOL(__asm_flush_cache_user_range);

#ifdef CONFIG_ARCH_HAS_PMEM_API
void arch_wb_cache_pmem(void *addr, size_t size)
--
2.17.1