linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Andreas Schwab <schwab@suse.de>,
	linux-riscv@lists.infradead.org,
	Palmer Dabbelt <palmer@sifive.com>, Gary Guo <gary@garyguo.net>
Subject: Re: [PATCH] riscv: export flush_icache_all
Date: Tue, 11 Jun 2019 11:51:13 -0700	[thread overview]
Message-ID: <201906111146.3BDF5928@keescook> (raw)
In-Reply-To: <20190611134945.GA28532@lst.de>

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

  reply	other threads:[~2019-06-11 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-06-11 13:53 ` Paul Walmsley
2019-06-11 14:02   ` Paul Walmsley
2019-06-11 14:12     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201906111146.3BDF5928@keescook \
    --to=keescook@chromium.org \
    --cc=gary@garyguo.net \
    --cc=hch@lst.de \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).