linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	Marco Elver <elver@google.com>,
	Peter Collingbourne <pcc@google.com>,
	Evgenii Stepanov <eugenis@google.com>,
	Branislav Rankov <Branislav.Rankov@arm.com>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Christoph Hellwig <hch@infradead.org>,
	kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm] arm64: kasan: fix MTE symbols exports
Date: Tue, 9 Feb 2021 17:02:56 +0000	[thread overview]
Message-ID: <20210209170255.GG1435@arm.com> (raw)
In-Reply-To: <dd36936c3d99582a623c8f01345f618ed4c036dd.1612884525.git.andreyknvl@google.com>

On Tue, Feb 09, 2021 at 04:32:30PM +0100, Andrey Konovalov wrote:
> diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c
> index a66c2806fc4d..788ef0c3a25e 100644
> --- a/arch/arm64/kernel/mte.c
> +++ b/arch/arm64/kernel/mte.c
> @@ -113,13 +113,17 @@ void mte_enable_kernel(void)
>  	sysreg_clear_set(sctlr_el1, SCTLR_ELx_TCF_MASK, SCTLR_ELx_TCF_SYNC);
>  	isb();
>  }
> +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
>  EXPORT_SYMBOL_GPL(mte_enable_kernel);
> +#endif
>  
>  void mte_set_report_once(bool state)
>  {
>  	WRITE_ONCE(report_fault_once, state);
>  }
> +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
>  EXPORT_SYMBOL_GPL(mte_set_report_once);
> +#endif

Do we actually care about exporting them when KASAN_KUNIT_TEST=n? It
looks weird to have these #ifdefs in the arch code. Either the
arch-kasan API requires these symbols to be exported to modules or not.
I'm not keen on such kasan internals trickling down into the arch code.

If you don't want to export them in the KASAN_KUNIT_TEST=n case, add a
wrapper in the kasan built-in code (e.g. kasan_test_enable_tagging,
kasan_test_set_report_once) and conditionally compile them based on
KASAN_KUNIT_TEST.

-- 
Catalin


  reply	other threads:[~2021-02-09 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 15:32 [PATCH mm] arm64: kasan: fix MTE symbols exports Andrey Konovalov
2021-02-09 17:02 ` Catalin Marinas [this message]
2021-02-09 18:45   ` Andrew Morton
2021-02-11 17:30     ` Andrey Konovalov

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=20210209170255.GG1435@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Branislav.Rankov@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=eugenis@google.com \
    --cc=glider@google.com \
    --cc=hch@infradead.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pcc@google.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=will.deacon@arm.com \
    /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).