2019-12-20 11:06:38

by Paul Walmsley

[permalink] [raw]
Subject: Re: [PATCH] riscv: export flush_icache_all to modules

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/[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


2019-12-20 22:30:24

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH] riscv: export flush_icache_all to modules

On Fri, Dec 20, 2019 at 3:05 AM Paul Walmsley <[email protected]> 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/[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

2019-12-20 23:01:45

by Paul Walmsley

[permalink] [raw]
Subject: Re: [PATCH] riscv: export flush_icache_all to modules

On Fri, 20 Dec 2019, Olof Johansson wrote:

> On Fri, Dec 20, 2019 at 3:05 AM Paul Walmsley <[email protected]> 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/[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. :(

Yep, we'll pick it up.


- Paul