diff mbox series

arm64: Do not issue IPIs for user executable ptes

Message ID 20190124172837.10011-1-catalin.marinas@arm.com
State Accepted
Commit 132fdc379eb143932d209a20fd581e1ce7630960
Headers show
Series arm64: Do not issue IPIs for user executable ptes | expand

Commit Message

Catalin Marinas Jan. 24, 2019, 5:28 p.m. UTC
Commit 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache
for kernel mappings") was aimed at fixing the I-cache invalidation for
kernel mappings. However, it inadvertently caused all cache maintenance
for user mappings via set_pte_at() -> __sync_icache_dcache() ->
sync_icache_aliases() to call kick_all_cpus_sync().

Reported-by: Shijith Thotton <sthotton@marvell.com>
Tested-by: Shijith Thotton <sthotton@marvell.com>

Reported-by: Wandun Chen <chenwandun@huawei.com>
Fixes: 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings")
Cc: <stable@vger.kernel.org> # 4.19.x-
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

---

Hi Will,

You acked the previous inlined patch but I think that's a better option
to revert the kernel behaviour w.r.t. user mapping to that prior to
commit 3b8c9f1cdfc5.

If you plan a pull request for 5.0-rc4, please pick this up as well.

Thanks.

 arch/arm64/mm/flush.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index 30695a868107..5c9073bace83 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -33,7 +33,11 @@  void sync_icache_aliases(void *kaddr, unsigned long len)
 		__clean_dcache_area_pou(kaddr, len);
 		__flush_icache_all();
 	} else {
-		flush_icache_range(addr, addr + len);
+		/*
+		 * Don't issue kick_all_cpus_sync() after I-cache invalidation
+		 * for user mappings.
+		 */
+		__flush_icache_range(addr, addr + len);
 	}
 }