linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: export flush_icache_all to modules
@ 2019-12-17  4:07 Olof Johansson
  2019-12-17 11:43 ` Anup Patel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Olof Johansson @ 2019-12-17  4:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Olof Johansson, linux-riscv, linux-kernel

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!

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 arch/riscv/mm/cacheflush.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index 8f19006866405..8930ab7278e6d 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -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
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: export flush_icache_all to modules
  2019-12-17  4:07 [PATCH] riscv: export flush_icache_all to modules Olof Johansson
@ 2019-12-17 11:43 ` Anup Patel
  2019-12-20 11:05 ` Paul Walmsley
  2019-12-28  6:04 ` Paul Walmsley
  2 siblings, 0 replies; 6+ messages in thread
From: Anup Patel @ 2019-12-17 11:43 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-riscv, Albert Ou, Palmer Dabbelt,
	linux-kernel@vger.kernel.org List, Paul Walmsley

On Tue, Dec 17, 2019 at 9:37 AM Olof Johansson <olof@lixom.net> wrote:
>
> 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!
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
>  arch/riscv/mm/cacheflush.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
> index 8f19006866405..8930ab7278e6d 100644
> --- a/arch/riscv/mm/cacheflush.c
> +++ b/arch/riscv/mm/cacheflush.c
> @@ -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
> --
> 2.11.0
>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: export flush_icache_all to modules
  2019-12-17  4:07 [PATCH] riscv: export flush_icache_all to modules Olof Johansson
  2019-12-17 11:43 ` Anup Patel
@ 2019-12-20 11:05 ` Paul Walmsley
  2019-12-20 22:29   ` Olof Johansson
  2019-12-28  6:04 ` Paul Walmsley
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2019-12-20 11:05 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-riscv, Albert Ou, Palmer Dabbelt, linux-kernel, hch

On Mon, 16 Dec 2019, Olof Johansson wrote:

> 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!

In the past we've resisted doing this; see 

https://lore.kernel.org/linux-riscv/20190611134945.GA28532@lst.de/

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: export flush_icache_all to modules
  2019-12-20 11:05 ` Paul Walmsley
@ 2019-12-20 22:29   ` Olof Johansson
  2019-12-20 23:00     ` Paul Walmsley
  0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2019-12-20 22:29 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-riscv, Albert Ou, Palmer Dabbelt,
	Linux Kernel Mailing List, Christoph Hellwig

On Fri, Dec 20, 2019 at 3:05 AM Paul Walmsley <paul.walmsley@sifive.com> wrote:
>
> On Mon, 16 Dec 2019, Olof Johansson wrote:
>
> > 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!
>
> In the past we've resisted doing this; see
>
> https://lore.kernel.org/linux-riscv/20190611134945.GA28532@lst.de/
>
> 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: export flush_icache_all to modules
  2019-12-20 22:29   ` Olof Johansson
@ 2019-12-20 23:00     ` Paul Walmsley
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2019-12-20 23:00 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-riscv, Albert Ou, Palmer Dabbelt,
	Linux Kernel Mailing List, Christoph Hellwig

On Fri, 20 Dec 2019, Olof Johansson wrote:

> On Fri, Dec 20, 2019 at 3:05 AM Paul Walmsley <paul.walmsley@sifive.com> wrote:
> >
> > On Mon, 16 Dec 2019, Olof Johansson wrote:
> >
> > > 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!
> >
> > In the past we've resisted doing this; see
> >
> > https://lore.kernel.org/linux-riscv/20190611134945.GA28532@lst.de/
> >
> > 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. :(

Yep, we'll pick it up.


- Paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: export flush_icache_all to modules
  2019-12-17  4:07 [PATCH] riscv: export flush_icache_all to modules Olof Johansson
  2019-12-17 11:43 ` Anup Patel
  2019-12-20 11:05 ` Paul Walmsley
@ 2019-12-28  6:04 ` Paul Walmsley
  2 siblings, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2019-12-28  6:04 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-riscv, Albert Ou, Palmer Dabbelt, linux-kernel

On Mon, 16 Dec 2019, Olof Johansson wrote:

> 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!
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>

Thanks Olof, queued for v5.5-rc.


- Paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-28  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  4:07 [PATCH] riscv: export flush_icache_all to modules Olof Johansson
2019-12-17 11:43 ` Anup Patel
2019-12-20 11:05 ` Paul Walmsley
2019-12-20 22:29   ` Olof Johansson
2019-12-20 23:00     ` Paul Walmsley
2019-12-28  6:04 ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).