Skip to contentSkip to conversation

riscv: export flush_icache_all

PATCH In review Andreas Schwab 4 participants 6 messages Jun 11, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: export flush_icache_all

Before 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c"), flush_icache_all was a macro, but it is used by a module:

ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

---
 arch/riscv/mm/cacheflush.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/mm/cacheflush.c +1 -0
index 9ebcff8ba263..4a2e5bf8b21a 100644
@@ -14,6 +14,7 @@ void flush_icache_all(void)
 {
 	sbi_remote_fence_i(NULL);
 }
+EXPORT_SYMBOL(flush_icache_all);
 
 /*
  * Performs an icache flush for the given MM context.  RISC-V has no direct
Signature · 7 lines
2.22.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw

NAK. There is no point to export a symbol that should not generally exported just for a tester.

I think the right answer is to just don't allow a modular build of lkdtm.

Quoted 24 lines · Andreas Schwab

Before 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c"), flush_icache_all was a macro, but it is used by a module:

ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

---
 arch/riscv/mm/cacheflush.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/mm/cacheflush.c +1 -0
index 9ebcff8ba263..4a2e5bf8b21a 100644
@@ -14,6 +14,7 @@ void flush_icache_all(void)
 {
 	sbi_remote_fence_i(NULL);
 }
+EXPORT_SYMBOL(flush_icache_all);
 
 /*
  * Performs an icache flush for the given MM context.  RISC-V has no direct
Signature · 1 line
2.22.0

---end quoted text---

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#2 lore raw
Quoted 2 lines · Christoph Hellwig

NAK. There is no point to export a symbol that should not generally exported just for a tester.

flush_icache_range() is what LKDTM uses (and has done so for years).

Quoted 3 lines

I think the right answer is to just don't allow a modular build of lkdtm.

No -- several system builders use a modular build of lkdtm to allow for testing of "production" kernels, and then do not include lkdtm.ko in the final image (and that image is either protected by LoadPin or module signing to keep stray modules from appearing).

-Kees

Quoted 26 lines · Andreas Schwab
Quoted 24 lines

Before 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c"), flush_icache_all was a macro, but it is used by a module:

ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

---
 arch/riscv/mm/cacheflush.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/mm/cacheflush.c +1 -0
index 9ebcff8ba263..4a2e5bf8b21a 100644
@@ -14,6 +14,7 @@ void flush_icache_all(void)
 {
 	sbi_remote_fence_i(NULL);
 }
+EXPORT_SYMBOL(flush_icache_all);
 
 /*
  * Performs an icache flush for the given MM context.  RISC-V has no direct
Signature · 1 line
2.22.0

---end quoted text---

Signature · 6 lines
Kees Cook

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#3 lore raw
In reply to Andreas Schwab
Quoted 6 lines · Andreas Schwab

Before 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c"), flush_icache_all was a macro, but it is used by a module:

ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

Thanks, queued for v5.2-rc. Added a "Fixes" line:

Fixes 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c")

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#4 lore raw
Quoted 5 lines · Paul Walmsley
Quoted 3 lines · Andreas Schwab

Before 58de77545e53 ("riscv: move flush_icache_{all,mm} to cacheflush.c"), flush_icache_all was a macro, but it is used by a module:

Quoted 8 lines
Quoted 3 lines

ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

Thanks, queued for v5.2-rc. Added a "Fixes" line:

Fixes 58de77545e53 ("riscv: move flush_icache_{all,mm} to

cacheflush.c")

Just discussing with Christoph now. Agree with him that the lkdtm module is too niche, and in general we don't want modules calling flush_icache_all(), so dropping this patch for now.

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#5 lore raw
Quoted 3 lines · Paul Walmsley

Just discussing with Christoph now. Agree with him that the lkdtm module is too niche, and in general we don't want modules calling flush_icache_all(), so dropping this patch for now.

Fair enough. I'll remove the module from the openSUSE kernel.

Andreas.

Signature · 8 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv