linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Mickaël Salaün" <mic@digikod.net>,
	"Brendan Higgins" <brendanhiggins@google.com>,
	"Rae Moar" <rmoar@google.com>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Alan Maguire" <alan.maguire@oracle.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"James Morris" <jamorris@linux.microsoft.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Madhavan T . Venkataraman" <madvenka@linux.microsoft.com>,
	"Marco Pagani" <marpagan@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Sean Christopherson" <seanjc@google.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Thara Gopinath" <tgopinath@microsoft.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Wanpeng Li" <wanpengli@tencent.com>,
	"Zahra Tarkhani" <ztarkhani@microsoft.com>,
	kvm@vger.kernel.org, linux-hardening@vger.kernel.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-um@lists.infradead.org, x86@kernel.org
Subject: Re: [PATCH v3 7/7] kunit: Add tests for fault
Date: Tue, 23 Apr 2024 17:22:24 +0800	[thread overview]
Message-ID: <CABVgOS=MOaWhUwVb2Rp2JDTK9=qX_p2SDZp7ZAj+03isZps9iA@mail.gmail.com> (raw)
In-Reply-To: <a0179848-99a2-4169-b7b2-1a8cddb27615@roeck-us.net>

[-- Attachment #1: Type: text/plain, Size: 2914 bytes --]

On Mon, 22 Apr 2024 at 21:36, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 4/22/24 06:08, Mickaël Salaün wrote:
> > On Fri, Apr 19, 2024 at 04:38:01PM -0700, Guenter Roeck wrote:
> >> On Fri, Apr 19, 2024 at 03:33:49PM -0700, Guenter Roeck wrote:
> >>> Hi,
> >>>
> >>> On Tue, Mar 19, 2024 at 11:48:57AM +0100, Mickaël Salaün wrote:
> >>>> Add a test case to check NULL pointer dereference and make sure it would
> >>>> result as a failed test.
> >>>>
> >>>> The full kunit_fault test suite is marked as skipped when run on UML
> >>>> because it would result to a kernel panic.
> >>>>
> >>>> Tested with:
> >>>> ./tools/testing/kunit/kunit.py run --arch x86_64 kunit_fault
> >>>> ./tools/testing/kunit/kunit.py run --arch arm64 \
> >>>>    --cross_compile=aarch64-linux-gnu- kunit_fault
> >>>>
> >>>
> >>> What is the rationale for adding those tests unconditionally whenever
> >>> CONFIG_KUNIT_TEST is enabled ? This completely messes up my test system
> >>> because it concludes that it is pointless to continue testing
> >>> after the "Unable to handle kernel NULL pointer dereference" backtrace.
> >>> At the same time, it is all or nothing, meaning I can not disable
> >>> it but still run other kunit tests.
> >>>
> >
> > CONFIG_KUNIT_TEST is to test KUnit itself.  Why does this messes up your
> > test system, and what is your test system?  Is it related to the kernel
> > warning and then the message you previously sent?
>
> It is not a warning, it is a BUG which terminates the affected kernel thread.
> NULL pointer dereferences are normally fatal, which is why I abort tests
> if one is encountered. I am not going to start introducing code into my
> scripts to ignore such warnings (or BUG messages) on a case by case basis;
> this would be unmaintainable.
>
> > https://lore.kernel.org/r/fd604ae0-5630-4745-acf2-1e51c69cf0c0@roeck-us.net
> > It seems David has a solution to suppress such warning.
> >
>
> I don't think so. My series tried to suppress warning backtraces, not BUG
> messages. BUG messages can not easily be suppressed since the reaction is
> architecture specific and typically fatal.
>
> As I said below, never mind, I just disabled CONFIG_KUNIT_TEST in my testing.
>
> Guenter
>

I think it probably makes sense to permit disabling the fault tests
independently, at least until we have a way of suppressing the
warnings.

I've sent out a patch to add a CONFIG_KUNIT_FAULT_TEST option to
disable these tests. Would that help?
https://lore.kernel.org/linux-kselftest/20240423090808.242389-1-davidgow@google.com/

(The other option is to split the tests out into a totally separate
file / module. I think that's an option (and would make the config
option more consistent with other test options) but since they're
otherwise part of the KUnit tests, I think I prefer to keep them
together.)

Cheers,
-- David

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4014 bytes --]

      reply	other threads:[~2024-04-23  9:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 10:48 [PATCH v3 0/7] Handle faults in KUnit tests Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 1/7] kunit: Handle thread creation error Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 2/7] kunit: Fix kthread reference Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 3/7] kunit: Fix timeout message Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 4/7] kunit: Handle test faults Mickaël Salaün
2024-03-23  7:37   ` David Gow
2024-03-26  9:02     ` Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 6/7] kunit: Print last test location on fault Mickaël Salaün
2024-03-19 10:48 ` [PATCH v3 7/7] kunit: Add tests for fault Mickaël Salaün
2024-04-19 22:33   ` Guenter Roeck
2024-04-19 23:38     ` Guenter Roeck
2024-04-22 13:08       ` Mickaël Salaün
2024-04-22 13:35         ` Guenter Roeck
2024-04-23  9:22           ` David Gow [this message]

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='CABVgOS=MOaWhUwVb2Rp2JDTK9=qX_p2SDZp7ZAj+03isZps9iA@mail.gmail.com' \
    --to=davidgow@google.com \
    --cc=alan.maguire@oracle.com \
    --cc=bp@alien8.de \
    --cc=brendanhiggins@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jamorris@linux.microsoft.com \
    --cc=keescook@chromium.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux@roeck-us.net \
    --cc=madvenka@linux.microsoft.com \
    --cc=marpagan@redhat.com \
    --cc=mcgrof@kernel.org \
    --cc=mic@digikod.net \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rmoar@google.com \
    --cc=sboyd@kernel.org \
    --cc=seanjc@google.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@linutronix.de \
    --cc=tgopinath@microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    --cc=ztarkhani@microsoft.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).