[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190926022938.58568-1-wangkefeng.wang@huawei.com>
Date: Thu, 26 Sep 2019 10:29:38 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: <linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
"Palmer Dabbelt" <palmer@...ive.com>
CC: Kefeng Wang <wangkefeng.wang@...wei.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>
Subject: [PATCH] riscv: move flush_icache_range/user_range() after flush_icache_all()
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 <paul.walmsley@...ive.com>
Cc: Palmer Dabbelt <palmer@...ive.com>
Cc: Albert Ou <aou@...s.berkeley.edu>
Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
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.
*/
--
2.20.1
Powered by blists - more mailing lists