linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@gmail.com>
To: David Gow <davidgow@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>,
	Alexander Potapenko <glider@google.com>,
	 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	 kasan-dev@googlegroups.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	 Daniel Latypov <dlatypov@google.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	 linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com
Subject: Re: [PATCH] kasan: Enable KUnit integration whenever CONFIG_KUNIT is enabled
Date: Wed, 19 Oct 2022 16:17:49 +0200	[thread overview]
Message-ID: <CA+fCnZdPwjThjY7fd7vBkMzS1eFXySR2AKrDK8weJ3p25fzS3g@mail.gmail.com> (raw)
In-Reply-To: <20221019085747.3810920-1-davidgow@google.com>

On Wed, Oct 19, 2022 at 10:58 AM 'David Gow' via kasan-dev
<kasan-dev@googlegroups.com> wrote:
>
> Enable the KASAN/KUnit integration even when the KASAN tests are
> disabled, as it's useful for testing other things under KASAN.
> Essentially, this reverts commit 49d9977ac909 ("kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT").
>
> To mitigate the performance impact slightly, add a likely() to the check
> for a currently running test.
>
> There's more we can do for performance if/when it becomes more of a
> problem, such as only enabling the "expect a KASAN failure" support wif
> the KASAN tests are enabled, or putting the whole thing behind a "kunit
> tests are running" static branch (which I do plan to do eventually).
>
> Fixes: 49d9977ac909 ("kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT")
> Signed-off-by: David Gow <davidgow@google.com>
> ---
>
> Basically, hiding the KASAN/KUnit integration broke being able to just
> pass --kconfig_add CONFIG_KASAN=y to kunit_tool to enable KASAN
> integration. We didn't notice this, because usually
> CONFIG_KUNIT_ALL_TESTS is enabled, which in turn enables
> CONFIG_KASAN_KUNIT_TEST. However, using a separate .kunitconfig might
> result in failures being missed.
>
> Take, for example:
> ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=y \
>         --kunitconfig drivers/gpu/drm/tests
>
> This should run the drm tests with KASAN enabled, but even if there's a
> KASAN failure (such as the one fixed by [1]), kunit_tool will report
> success.

Hi David,

How does KUnit detect a KASAN failure for other tests than the KASAN
ones? I thought this was only implemented for KASAN tests. At least, I
don't see any code querying kunit_kasan_status outside of KASAN tests.

I'm currently switching KASAN tests from using KUnit resources to
console tracepoints [1], and those patches will be in conflict with
yours.

Thanks!

[1] https://lore.kernel.org/linux-mm/ebf96ea600050f00ed567e80505ae8f242633640.1666113393.git.andreyknvl@google.com/


  reply	other threads:[~2022-10-19 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  8:57 David Gow
2022-10-19 14:17 ` Andrey Konovalov [this message]
2022-10-19 15:06   ` David Gow
2022-10-19 19:48     ` Andrey Konovalov
2022-10-20  6:38       ` David Gow

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=CA+fCnZdPwjThjY7fd7vBkMzS1eFXySR2AKrDK8weJ3p25fzS3g@mail.gmail.com \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=vincenzo.frascino@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