]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
riscv: Use flush_icache_mm for flush_icache_user_range
authorGuo Ren <guoren@linux.alibaba.com>
Thu, 30 Jan 2020 17:04:19 +0000 (17:04 +0000)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 3 Mar 2020 18:28:10 +0000 (10:28 -0800)
The only call path is:

__access_remote_vm -> copy_to_user_page -> flush_icache_user_range

Seems it's ok to use flush_icache_mm instead of flush_icache_all and
it could reduce flush_icache_all called on other harts.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
[Palmer: git-am wouldn't apply the patch, I did so manually]
Fixes: 08f051eda33b ("RISC-V: Flush I$ when making a dirty page executable")
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/cacheflush.h

index 555b20b11dc3513e85a94afaccd97c024380dbb7..c8677c75f82cb40a05cdecea8597ce73190358c2 100644 (file)
@@ -85,7 +85,7 @@ static inline void flush_dcache_page(struct page *page)
  * so instead we just flush the whole thing.
  */
 #define flush_icache_range(start, end) flush_icache_all()
-#define flush_icache_user_range(vma, pg, addr, len) flush_icache_all()
+#define flush_icache_user_range(vma, pg, addr, len) flush_icache_mm(vma->vm_mm, 0)
 
 #ifndef CONFIG_SMP