ARM: 9386/2: mm: Use symbol alias for cache functions
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 23 Apr 2024 07:31:41 +0000 (08:31 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 29 Apr 2024 13:14:17 +0000 (14:14 +0100)
The cache functions to flush user cache (*_flush_user_cache_all)
are in many cases just a branch to the corresponfing userspace or
kernelspace function. These functions also have the same arguments.

Simplify these by using SYM_FUNC_ALIAS() in all affected sites.

The NOP cache has very many similar calls which are just returns,
but it would be confusing to use aliases here, so leave all the
explicit returns and drop a comment on why we are not using aliases.

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
19 files changed:
arch/arm/mm/cache-fa.S
arch/arm/mm/cache-nop.S
arch/arm/mm/cache-v4.S
arch/arm/mm/cache-v4wb.S
arch/arm/mm/cache-v4wt.S
arch/arm/mm/proc-arm1020.S
arch/arm/mm/proc-arm1020e.S
arch/arm/mm/proc-arm1022.S
arch/arm/mm/proc-arm1026.S
arch/arm/mm/proc-arm920.S
arch/arm/mm/proc-arm922.S
arch/arm/mm/proc-arm925.S
arch/arm/mm/proc-arm926.S
arch/arm/mm/proc-arm940.S
arch/arm/mm/proc-arm946.S
arch/arm/mm/proc-feroceon.S
arch/arm/mm/proc-mohawk.S
arch/arm/mm/proc-xsc3.S
arch/arm/mm/proc-xscale.S

index c3642d5daf3821d3ad82fcb6a94ff0cec00396b8..ecd08bf440cb89c7133e60690634e665fb99b810 100644 (file)
@@ -52,9 +52,7 @@ SYM_FUNC_END(fa_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(fa_flush_user_cache_all)
-       b       fa_flush_kern_cache_all
-SYM_FUNC_END(fa_flush_user_cache_all)
+SYM_FUNC_ALIAS(fa_flush_user_cache_all, fa_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 56e94091a55fa73b18e281740d7c891b0477eb16..cd191aa9031359abe49e97a294a0533cbe174413 100644 (file)
@@ -6,6 +6,10 @@
 
 #include "proc-macros.S"
 
+/*
+ * These are all open-coded instead of aliased, to make clear
+ * what is going on here: all functions are stubbed out.
+ */
 SYM_TYPED_FUNC_START(nop_flush_icache_all)
        ret     lr
 SYM_FUNC_END(nop_flush_icache_all)
index 22d9c9d9e0d7777b4a44701f22c623c14a290606..f7b7e498d3b61f30c3a683ca105a144389da95cd 100644 (file)
@@ -28,9 +28,7 @@ SYM_FUNC_END(v4_flush_icache_all)
  *
  *     - mm    - mm_struct describing address space
  */
-SYM_TYPED_FUNC_START(v4_flush_user_cache_all)
-       b       v4_flush_kern_cache_all
-SYM_FUNC_END(v4_flush_user_cache_all)
+SYM_FUNC_ALIAS(v4_flush_user_cache_all, v4_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 0d97b594e23f0fa915f4b0a25e4138ec2018069b..00488108a87369d23dde835e28039f25d492cc33 100644 (file)
@@ -66,9 +66,7 @@ SYM_FUNC_END(v4wb_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(v4wb_flush_user_cache_all)
-       b       v4wb_flush_kern_cache_all
-SYM_FUNC_END(v4wb_flush_user_cache_all)
+SYM_FUNC_ALIAS(v4wb_flush_user_cache_all, v4wb_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index eee6d8f06b4dd38f4165bba7bcc29d25ace9ab7e..573f65271cbb9bc456c7d60d60540c61b29a163c 100644 (file)
@@ -56,9 +56,7 @@ SYM_FUNC_END(v4wt_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(v4wt_flush_user_cache_all)
-       b       v4wt_flush_kern_cache_all
-SYM_FUNC_END(v4wt_flush_user_cache_all)
+SYM_FUNC_ALIAS(v4wt_flush_user_cache_all, v4wt_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index a3f99e1c11865bd0483a919247b193197960b802..2c873e65a5b93236c6717abf48b44a4ba9c08605 100644 (file)
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1020_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(arm1020_flush_user_cache_all)
-       b       arm1020_flush_kern_cache_all
-SYM_FUNC_END(arm1020_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm1020_flush_user_cache_all, arm1020_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 64c63eb5d830eb7b88949d555d13d1e87cb33258..d8217737a60b3878c25f544be6925f5957bb960e 100644 (file)
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1020e_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(arm1020e_flush_user_cache_all)
-       b       arm1020e_flush_kern_cache_all
-SYM_FUNC_END(arm1020e_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm1020e_flush_user_cache_all, arm1020e_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index e170497353ae94b982cc36893fe010a5ce0d80cc..5348cebe7e7157463af92b19fb9c0fa14bb0c341 100644 (file)
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1022_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(arm1022_flush_user_cache_all)
-       b       arm1022_flush_kern_cache_all
-SYM_FUNC_END(arm1022_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm1022_flush_user_cache_all, arm1022_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 4b5a4849ad8500d82a75d86a4f8d46d6521d22e2..466f861d750c25e5ec2cf88260f1d878f08d91b8 100644 (file)
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1026_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(arm1026_flush_user_cache_all)
-       b       arm1026_flush_kern_cache_all
-SYM_FUNC_END(arm1026_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm1026_flush_user_cache_all, arm1026_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index fbf8937eae858dde8530d2f07b2590130a60b30b..6a6e26850a54e264a553bec07bb284f1e357bae3 100644 (file)
@@ -116,9 +116,7 @@ SYM_FUNC_END(arm920_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(arm920_flush_user_cache_all)
-       b       arm920_flush_kern_cache_all
-SYM_FUNC_END(arm920_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm920_flush_user_cache_all, arm920_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index ccfff2b65f49ced6901c5cae8efe9a4cc17742b1..56230e547762f9bae1ff09f4b89087dc62a165b0 100644 (file)
@@ -118,9 +118,7 @@ SYM_FUNC_END(arm922_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular
  *     address space.
  */
-SYM_TYPED_FUNC_START(arm922_flush_user_cache_all)
-       b       arm922_flush_kern_cache_all
-SYM_FUNC_END(arm922_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm922_flush_user_cache_all, arm922_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index d0f73242f70a78b3ab4f80c54b59a2cc7e154135..aeb4ee16dcc98dc13af2ff5c69d44e3efe7abc38 100644 (file)
@@ -151,9 +151,7 @@ SYM_FUNC_END(arm925_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular
  *     address space.
  */
-SYM_TYPED_FUNC_START(arm925_flush_user_cache_all)
-       b       arm925_flush_kern_cache_all
-SYM_FUNC_END(arm925_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm925_flush_user_cache_all, arm925_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 00f953dee122165b80d1285defd5ce3bb1539563..221aada5d2887418b93958ef4a4ee5af82bd2b63 100644 (file)
@@ -117,9 +117,7 @@ SYM_FUNC_END(arm926_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular
  *     address space.
  */
-SYM_TYPED_FUNC_START(arm926_flush_user_cache_all)
-       b       arm926_flush_kern_cache_all
-SYM_FUNC_END(arm926_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm926_flush_user_cache_all, arm926_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 7e32ec271e8a587a461b1bcd9548263720ae17b1..23646bf801e16aa3d2e1b39b9e856b3a62cdf728 100644 (file)
@@ -81,9 +81,7 @@ SYM_FUNC_END(arm940_flush_icache_all)
 /*
  *     flush_user_cache_all()
  */
-SYM_TYPED_FUNC_START(arm940_flush_user_cache_all)
-       b       arm940_flush_kern_cache_all
-SYM_FUNC_END(arm940_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm940_flush_user_cache_all, arm940_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 4fc883572e191252512fdc5e878a3ecaf56ce576..763a5a9bc73560fa302f88823a41e72c97ef3816 100644 (file)
@@ -88,9 +88,7 @@ SYM_FUNC_END(arm946_flush_icache_all)
 /*
  *     flush_user_cache_all()
  */
-SYM_TYPED_FUNC_START(arm946_flush_user_cache_all)
-       b       arm946_flush_kern_cache_all
-SYM_FUNC_END(arm946_flush_user_cache_all)
+SYM_FUNC_ALIAS(arm946_flush_user_cache_all, arm946_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index ee936c23cac5d9f24f321aa080540819634dff88..d31fe58bf475f82f1e30391b270e980490958742 100644 (file)
@@ -136,9 +136,7 @@ SYM_FUNC_END(feroceon_flush_icache_all)
  *     address space.
  */
        .align  5
-SYM_TYPED_FUNC_START(feroceon_flush_user_cache_all)
-       b       feroceon_flush_kern_cache_all
-SYM_FUNC_END(feroceon_flush_user_cache_all)
+SYM_FUNC_ALIAS(feroceon_flush_user_cache_all, feroceon_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 519b7ff2c589e4b75e8498669087264b6c7be0c6..949e2f254779d1aa23f599f9eb2427b1e450c444 100644 (file)
@@ -100,9 +100,7 @@ SYM_FUNC_END(mohawk_flush_icache_all)
  *     Clean and invalidate all cache entries in a particular
  *     address space.
  */
-SYM_TYPED_FUNC_START(mohawk_flush_user_cache_all)
-       b       mohawk_flush_kern_cache_all
-SYM_FUNC_END(mohawk_flush_user_cache_all)
+SYM_FUNC_ALIAS(mohawk_flush_user_cache_all, mohawk_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index f08b3fce4c95691f747bfb143ea670510daf58fd..ac3d99b49cc0363cf0f4a83d2c3d113aeca8edb5 100644 (file)
@@ -157,9 +157,7 @@ SYM_FUNC_END(xsc3_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(xsc3_flush_user_cache_all)
-       b       xsc3_flush_kern_cache_all
-SYM_FUNC_END(xsc3_flush_user_cache_all)
+SYM_FUNC_ALIAS(xsc3_flush_user_cache_all, xsc3_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()
index 3e427db18d5b63898707735f6442e7e8d6cf030e..05d9ed952983164e6fca6c60b971e7c3eb39d3b7 100644 (file)
@@ -199,9 +199,7 @@ SYM_FUNC_END(xscale_flush_icache_all)
  *     Invalidate all cache entries in a particular address
  *     space.
  */
-SYM_TYPED_FUNC_START(xscale_flush_user_cache_all)
-       b       xscale_flush_kern_cache_all
-SYM_FUNC_END(xscale_flush_user_cache_all)
+SYM_FUNC_ALIAS(xscale_flush_user_cache_all, xscale_flush_kern_cache_all)
 
 /*
  *     flush_kern_cache_all()