All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Szwichtenberg, Radoslaw" <radoslaw.szwichtenberg@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH igt] lib: Check and report if a subtest triggers a new kernel taint
Date: Wed, 29 Nov 2017 13:14:52 +0000	[thread overview]
Message-ID: <1511961288.10407.1.camel@intel.com> (raw)
In-Reply-To: <151195924555.10143.502549333141745000@mail.alporthouse.com>

On Wed, 2017-11-29 at 12:40 +0000, Chris Wilson wrote:
> Quoting Chris Wilson (2017-11-29 12:30:23)
> > Checking for a tainted kernel is a convenient way to see if the test
> > generated a critical error such as a oops, or machine check.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> > ---
> > diff --git a/lib/igt_kernel_taint.c b/lib/igt_kernel_taint.c
> > new file mode 100644
> > index 00000000..86d9cd20
> > --- /dev/null
> > +++ b/lib/igt_kernel_taint.c
> > @@ -0,0 +1,95 @@
> > +/*
> > + * Copyright 2017 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the
> > "Software"),
> > + * to deal in the Software without restriction, including without
> > limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the
> > next
> > + * paragraph) shall be included in all copies or substantial portions of
> > the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> > OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> > OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> > DEALINGS
> > + * IN THE SOFTWARE.
> > + */
> > +
> > +#include <unistd.h>
> > +#include <fcntl.h>
> > +
> > +#include "igt.h"
> > +#include "igt_kernel_taint.h"
> > +#include "igt_sysfs.h"
> > +
> > +#define BIT(x) (1ul << (x))
> > +
> > +static const struct kernel_taint {
> > +       const char *msg;
> > +       unsigned int flags;
> > +} taints[] = {
> > +       { "Non-GPL module loaded" },
> > +       { "Forced module load" },
> > +       { "Unsafe SMP processor" },
> > +       { "Forced module unload" },
> > +       { "Machine Check Exception", TAINT_WARN },
> > +       { "Bad page detected", TAINT_ERROR },
> > +       { "Tainted by user request", TAINT_WARN },
> 
> Since unsafe modparams generate these and we are still using them
> extensively, we should probably ignore this one.
> 
> > +       { "System is on fire", TAINT_ERROR },
> > +       { "ACPI DSDT has been overridden by user" },
> > +       { "OOPS", TAINT_ERROR },
> > +       { "Staging driver loaded; are you mad?" },
> > +       { "Severe firmware bug workaround active", TAINT_WARN },
> > +       { "Out-of-tree module loaded" },
> > +       { "Unsigned module loaded" },
> > +       { "Soft-lockup detected", TAINT_WARN },
> > +       { "Kernel has been live patched" },
> > +};
> > +
> > +unsigned long igt_read_kernel_taint(void)
> 
> One thing I haven't checked is whether we can clear the kernel taints.
> At the moment, once we see an oops, we never report a second test
> generating another oops.
> -Chris

I guess that clearing kernel taints is not needed when you hit oops - you
probably should stop executing tests and reboot the machine, right?

Radek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-29 13:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 12:30 [PATCH igt] lib: Check and report if a subtest triggers a new kernel taint Chris Wilson
2017-11-29 12:40 ` Chris Wilson
2017-11-29 13:14   ` Szwichtenberg, Radoslaw [this message]
2017-11-29 13:23     ` Chris Wilson
2017-11-29 13:43 ` Chris Wilson
2017-11-29 14:34 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-29 17:46 ` ✓ Fi.CI.IGT: " Patchwork
2017-12-04 13:46 ` [PATCH igt] " Joonas Lahtinen
  -- strict thread matches above, loose matches on Subject: below --
2017-12-05 12:24 Chris Wilson
2017-12-05 12:32 ` Petri Latvala
2017-12-05 12:38   ` Chris Wilson
2017-12-05 13:01     ` Petri Latvala

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=1511961288.10407.1.camel@intel.com \
    --to=radoslaw.szwichtenberg@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.