riscv: export flush_icache_all to modules
PATCH 1/1 riscv: export flush_icache_all to modules
This is needed by LKDTM (crash dump test module), it calls flush_icache_range(), which on RISC-V turns into flush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.
Fixes build of CONFIG_LKDTM that fails with:
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
@@ -22,6 +22,7 @@ void flush_icache_all(void)else on_each_cpu (ipi_remote_fence_i,NULL ,1 ); } +EXPORT_SYMBOL (flush_icache_all);/* * Performs an icache flush for the given MM context. RISC-V has no direct
Signature · 1 line
2.11.0
Quoted 27 lines · Olof Johansson
This is needed by LKDTM (crash dump test module), it calls
flush_icache_range(), which on RISC-V turns intoflush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.Fixes build of
CONFIG_LKDTMthat fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!Signed-off-by Olof Johansson <[email protected]>--- arch/riscv/mm/cacheflush.c | 1 + 1 file changed, 1 insertion(+)arch/riscv/mm/cacheflush.c +1
-1@@ -22,6 +22,7 @@ void flush_icache_all(void)else on_each_cpu (ipi_remote_fence_i,NULL ,1 ); } +EXPORT_SYMBOL (flush_icache_all);/* * Performs an icache flush for the given MM context. RISC-V has no direct --
Quoted 2 lines
2.11.0
LGTM.
Regards,
Anup
Quoted 7 lines · Olof Johansson
This is needed by LKDTM (crash dump test module), it calls
flush_icache_range(), which on RISC-V turns intoflush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.Fixes build of
CONFIG_LKDTMthat fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!
In the past we've resisted doing this; see
https://lore.kernel.org/linux-riscv/[email protected]/
under the principle that we don't want modules to be able to flush the I$ directly via this interface. But maybe, like moving the L2 related code out of arch/riscv, we should just do it.
- Paul
Quoted 11 lines · Paul Walmsley
Quoted 7 lines · Olof Johansson
This is needed by LKDTM (crash dump test module), it calls
flush_icache_range(), which on RISC-V turns intoflush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.Fixes build of
CONFIG_LKDTMthat fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!
Quoted 7 lines
In the past we've resisted doing this; see
https://lore.kernel.org/linux-riscv/[email protected]/
under the principle that we don't want modules to be able to flush the I$ directly via this interface. But maybe, like moving the L2 related code out of
arch/riscv, we should just do it.
So you are aware that all other architectures that don't have coherent icache already exports this, right?
Being more puritan on RISC-V buys nothing w.r.t. keeping modules from doing anything, you'll just end up having to mark a bunch of them broken on your architecture. :(
-Olof
Quoted 20 lines · Olof Johansson
Quoted 11 lines · Paul Walmsley
Quoted 7 lines · Olof Johansson
This is needed by LKDTM (crash dump test module), it calls
flush_icache_range(), which on RISC-V turns intoflush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.Fixes build of
CONFIG_LKDTMthat fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!Quoted 7 lines
In the past we've resisted doing this; see
https://lore.kernel.org/linux-riscv/[email protected]/
under the principle that we don't want modules to be able to flush the I$ directly via this interface. But maybe, like moving the L2 related code out of
arch/riscv, we should just do it.
Quoted 6 lines
So you are aware that all other architectures that don't have coherent icache already exports this, right?
Being more puritan on RISC-V buys nothing w.r.t. keeping modules from doing anything, you'll just end up having to mark a bunch of them broken on your architecture. :(
Yep, we'll pick it up.
- Paul
Quoted 9 lines · Olof Johansson
This is needed by LKDTM (crash dump test module), it calls
flush_icache_range(), which on RISC-V turns intoflush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.Fixes build of
CONFIG_LKDTMthat fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!Signed-off-by Olof Johansson <[email protected]>
Thanks Olof, queued for v5.5-rc.
- Paul