From: Guo Ren <guoren@linux.alibaba.com>
To: linux-riscv@lists.infradead.org
Cc: linux-arch@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>,
Andrew Waterman <andrew@sifive.com>,
Palmer Dabbelt <palmer@sifive.com>,
linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org
Subject: [PATCH] riscv: Use flush_icache_mm for flush_icache_user_range
Date: Sat, 25 Jan 2020 00:18:10 +0800 [thread overview]
Message-ID: <20200124161810.24322-1-guoren@linux.alibaba.com> (raw)
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.
I think the patch is the fixup for the commit 08f051eda33b.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Andrew Waterman <andrew@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
---
arch/riscv/include/asm/cacheflush.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h
index b69aecbb36d3..26589623fd57 100644
--- a/arch/riscv/include/asm/cacheflush.h
+++ b/arch/riscv/include/asm/cacheflush.h
@@ -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)
void dma_wbinv_range(unsigned long start, unsigned long end);
void dma_wb_range(unsigned long start, unsigned long end);
--
2.17.0
next reply other threads:[~2020-01-24 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 16:18 Guo Ren [this message]
2020-01-30 17:40 ` [PATCH] riscv: Use flush_icache_mm for flush_icache_user_range Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200124161810.24322-1-guoren@linux.alibaba.com \
--to=guoren@linux.alibaba.com \
--cc=andrew@sifive.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).