linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: export flush_icache_all
@ 2019-06-11 10:24 Andreas Schwab
  2019-06-11 13:49 ` Christoph Hellwig
  2019-06-11 13:53 ` Paul Walmsley
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Schwab @ 2019-06-11 10:24 UTC (permalink / raw)
  To: linux-riscv; +Cc: Palmer Dabbelt, Christoph Hellwig, Gary Guo

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!

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 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 9ebcff8ba263..4a2e5bf8b21a 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -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
-- 
2.22.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: export flush_icache_all
  2019-06-11 10:24 [PATCH] riscv: export flush_icache_all Andreas Schwab
@ 2019-06-11 13:49 ` Christoph Hellwig
  2019-06-11 18:51   ` Kees Cook
  2019-06-11 13:53 ` Paul Walmsley
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2019-06-11 13:49 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: linux-riscv, Palmer Dabbelt, Christoph Hellwig, Gary Guo, Kees Cook

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.

On Tue, Jun 11, 2019 at 12:24:32PM +0200, Andreas Schwab wrote:
> 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!
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  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 9ebcff8ba263..4a2e5bf8b21a 100644
> --- a/arch/riscv/mm/cacheflush.c
> +++ b/arch/riscv/mm/cacheflush.c
> @@ -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
> -- 
> 2.22.0
---end quoted text---

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: export flush_icache_all
  2019-06-11 10:24 [PATCH] riscv: export flush_icache_all Andreas Schwab
  2019-06-11 13:49 ` Christoph Hellwig
@ 2019-06-11 13:53 ` Paul Walmsley
  2019-06-11 14:02   ` Paul Walmsley
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2019-06-11 13:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-riscv, Palmer Dabbelt, Christoph Hellwig, Gary Guo

On Tue, 11 Jun 2019, Andreas Schwab wrote:

> 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!
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>

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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: export flush_icache_all
  2019-06-11 13:53 ` Paul Walmsley
@ 2019-06-11 14:02   ` Paul Walmsley
  2019-06-11 14:12     ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2019-06-11 14:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-riscv, Palmer Dabbelt, Christoph Hellwig, Gary Guo

On Tue, 11 Jun 2019, Paul Walmsley wrote:

> On Tue, 11 Jun 2019, Andreas Schwab wrote:
> 
> > 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!
> > 
> > Signed-off-by: Andreas Schwab <schwab@suse.de>
> 
> 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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: export flush_icache_all
  2019-06-11 14:02   ` Paul Walmsley
@ 2019-06-11 14:12     ` Andreas Schwab
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2019-06-11 14:12 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-riscv, Palmer Dabbelt, Christoph Hellwig, Gary Guo

On Jun 11 2019, Paul Walmsley <paul.walmsley@sifive.com> wrote:

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

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: export flush_icache_all
  2019-06-11 13:49 ` Christoph Hellwig
@ 2019-06-11 18:51   ` Kees Cook
  0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2019-06-11 18:51 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Andreas Schwab, linux-riscv, Palmer Dabbelt, Gary Guo

On Tue, Jun 11, 2019 at 03:49:45PM +0200, Christoph Hellwig wrote:
> 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).

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

> On Tue, Jun 11, 2019 at 12:24:32PM +0200, Andreas Schwab wrote:
> > 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!
> > 
> > Signed-off-by: Andreas Schwab <schwab@suse.de>
> > ---
> >  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 9ebcff8ba263..4a2e5bf8b21a 100644
> > --- a/arch/riscv/mm/cacheflush.c
> > +++ b/arch/riscv/mm/cacheflush.c
> > @@ -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
> > -- 
> > 2.22.0
> ---end quoted text---

-- 
Kees Cook

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2019-06-11 18:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 10:24 [PATCH] riscv: export flush_icache_all Andreas Schwab
2019-06-11 13:49 ` Christoph Hellwig
2019-06-11 18:51   ` Kees Cook
2019-06-11 13:53 ` Paul Walmsley
2019-06-11 14:02   ` Paul Walmsley
2019-06-11 14:12     ` Andreas Schwab

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).