Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp968088ybl; Fri, 24 Jan 2020 12:54:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzqYL0A9HQSFp/9t5hAYrXPYgzwzgZYDzz44Sy6mftPQ/t+aYtWyKGNeXXijkQIP7wQUqD2 X-Received: by 2002:a05:6830:1257:: with SMTP id s23mr4174507otp.241.1579899250635; Fri, 24 Jan 2020 12:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899250; cv=none; d=google.com; s=arc-20160816; b=Qr0EiMNrYFX0dVxpvI5BX/IDlZd/cMBE1U0Q1EOfZlD447gXJqVzX3whU6xjFRYLSA Q+WrTUloEnVK8iDjhFK+eztfxDJrUDLryddz+PQDHXeCBIuF2ES7Q2tNvY315x3f9OBM EkqWr0a78EIuHSLAbC2nA9xhgcnazqvcsymRxCz1zsJD0CMocdGFBQxDZLQXPhx52CZe UB0KJqU3xLJC4j1Mb+nwsc2aIkOQRrTdg+vbbtrlf14MFs7wldGDA8Ci3w7pl9x8+3bo IEUZQJbzzN+NFFYJDMDS8Y/F3bCQ21FRuZ5CADSqeoE1Cwx4TJLFTImlpOsb5WBvxDBO a7fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=HhTvoNAHvBAvabxOMsrQkvdpfs0pDdiQIiOzybyR/ls=; b=jH0bmezweAtSVJcGfvB8ZsmNmVFPYDz5O7yIRpjg3gwKyCOpZQS+pdpezmvIENN8S+ tebRZJieojJPDtKtJhy/2ik4Yji8nhkuLtscH2TPrBMUsZNLPnI0IqMjTm++5lh0CU6s Bipc+zhdre4gUvF4Iq601oYk4fzKPzjrkuw+xG982/kdcE3xv7LVOiFmuLmnNyQPKu// gEmh+2WPXQK9TDCrqsu/bNXRPd+W4TxpjEtWwTqaRnLwdE1qVr1nFDjKB1PB2lkjUR57 cg3pN8e8ixpkwrAXbH3AVJu63RMzPC+RiEtn3HiByYRF0Xcwewb6f0vBlRM/xg6EFlzD jK1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si3332191oth.181.2020.01.24.12.53.58; Fri, 24 Jan 2020 12:54:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389436AbgAXQSY (ORCPT + 99 others); Fri, 24 Jan 2020 11:18:24 -0500 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:60343 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387404AbgAXQSX (ORCPT ); Fri, 24 Jan 2020 11:18:23 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R231e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04455;MF=guoren@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0ToSJxNn_1579882700; Received: from localhost(mailfrom:guoren@linux.alibaba.com fp:SMTPD_---0ToSJxNn_1579882700) by smtp.aliyun-inc.com(127.0.0.1); Sat, 25 Jan 2020 00:18:20 +0800 From: Guo Ren To: linux-riscv@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, Guo Ren , Andrew Waterman , Palmer Dabbelt Subject: [PATCH] riscv: Use flush_icache_mm for flush_icache_user_range Date: Sat, 25 Jan 2020 00:18:10 +0800 Message-Id: <20200124161810.24322-1-guoren@linux.alibaba.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Andrew Waterman Cc: Palmer Dabbelt --- 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