Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1856188ybn; Thu, 26 Sep 2019 03:16:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsmRn06LpOyVzkFWRuZU/ORRTzD2ZqZHmRFBLzFLK/0W4NGRfQqVOitdJwiNgHe7yYR+nz X-Received: by 2002:a50:f19c:: with SMTP id x28mr2629926edl.42.1569493008176; Thu, 26 Sep 2019 03:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569493008; cv=none; d=google.com; s=arc-20160816; b=PUu2n7idmETo5U6xuHmnvLcV01CMaGwHL5q6s2dU1W8+nezQvlIF3GGb0kKow7/XF1 s+/Uu7L0nfmuS3OO1uUloGMnn/vXxIehwEfpoSETiJDVcZ7ZE9ijL9990ZuiKbsbdb8A 86SXZkz9qNxo0x8DVb8eSyB78HHKbjLdw30D1js21eve7BdAMgDA75vufRu7DD8bnhf+ eBNlBqJUU9qaCdiUzqxUxCPtU5GQp7jhEdG66Zd84H/WgM48PzfX8GfWfD3ht8rXRftF ZSHVRSWmvscpJWgKtBxYPi9FrCmxJ55FgCFju1LclZJU/UVLyD2QQl3R9VodAjZbftye oiZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LZUqMAhom264jKAx2F5P3LwK/PcrUM0mBhKNyA1tgSA=; b=qvCgwGwyG6ODHYPvhs2Z4PvA9FImpmeifcA8KtA1QCP5JjQr58npaB5Ci6mR1jO7MJ v4hgTxV43tnKu66vomhCL2vAoe7dLHc4KlfAngtJm/l4xKXpfyG+EBSkqJfzc1/1Pd5F hrba0uwxCcylCADTaMZifKoexWwk3jx6eLDYy58Aw30qxJ1olQHFLNe5SKUXhqhF6HAE ox4vfmPMoXdoFGlYgZRY4NVwFpt/eOx4ZVWBSyj3RGn2q+VNp/QIrZ3ahof+VorVPaTs /inwtqbsZtZCMYeD5rdkBPQW2/F+42wancPejGTlPbYCUJoWS+QZcyiuv07VEqAnuw9J LAYA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si961771eda.105.2019.09.26.03.16.21; Thu, 26 Sep 2019 03:16:48 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388421AbfIZCXf (ORCPT + 99 others); Wed, 25 Sep 2019 22:23:35 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2726 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725768AbfIZCXf (ORCPT ); Wed, 25 Sep 2019 22:23:35 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9BD366E99926D5B331FD; Thu, 26 Sep 2019 10:23:32 +0800 (CST) Received: from [127.0.0.1] (10.133.217.137) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Thu, 26 Sep 2019 10:23:30 +0800 Subject: Re: [PATCH] riscv: move flush_icache_range/user_range() after flush_icache_all() To: , , "Palmer Dabbelt" CC: Paul Walmsley , Albert Ou References: <20190926022938.58568-1-wangkefeng.wang@huawei.com> From: Kefeng Wang Message-ID: <4f7b4b37-1907-2afe-7600-dfce47f3bbdf@huawei.com> Date: Thu, 26 Sep 2019 10:23:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190926022938.58568-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.133.217.137] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please ignore this version. On 2019/9/26 10:29, Kefeng Wang wrote: > When build lkdtm module, which used flush_icache_range(), error occurred, > > ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined! > > Fix it. > > Cc: Paul Walmsley > Cc: Palmer Dabbelt > Cc: Albert Ou > Signed-off-by: Kefeng Wang > --- > arch/riscv/include/asm/cacheflush.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h > index 555b20b11dc3..f6ec26589620 100644 > --- a/arch/riscv/include/asm/cacheflush.h > +++ b/arch/riscv/include/asm/cacheflush.h > @@ -80,13 +80,6 @@ static inline void flush_dcache_page(struct page *page) > clear_bit(PG_dcache_clean, &page->flags); > } > > -/* > - * RISC-V doesn't have an instruction to flush parts of the instruction cache, > - * 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() > - > #ifndef CONFIG_SMP > > #define flush_icache_all() local_flush_icache_all() > @@ -99,6 +92,13 @@ void flush_icache_mm(struct mm_struct *mm, bool local); > > #endif /* CONFIG_SMP */ > > +/* > + * RISC-V doesn't have an instruction to flush parts of the instruction cache, > + * 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() > + > /* > * Bits in sys_riscv_flush_icache()'s flags argument. > */