From: Stuart Summers <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org, rodrigo.vivi@intel.com,
matthew.brost@intel.com, umesh.nerlige.ramappa@intel.com,
Michal.Wajdeczko@intel.com, matthew.d.roper@intel.com,
daniele.ceraolospurio@intel.com, shuicheng.lin@intel.com,
Stuart Summers <stuart.summers@intel.com>
Subject: [PATCH 9/9] drm/xe: Taint kernel when debug configfs parameters are set
Date: Wed, 22 Jul 2026 21:47:05 +0000 [thread overview]
Message-ID: <20260722214656.107936-20-stuart.summers@intel.com> (raw)
In-Reply-To: <20260722214656.107936-11-stuart.summers@intel.com>
Writing any debug configfs attribute indicates the system is running
in a non-standard configuration that may mask bugs or produce misleading
behaviour. Taint the kernel with TAINT_TEST on each successful write so
bug reports clearly reflect when debug settings were active.
Signed-off-by: Stuart Summers <stuart.summers@intel.com>
Assisted-by: Copilot:claude-sonnet-4.6,claude-sonnet-5
---
drivers/gpu/drm/xe/xe_configfs_debug.c | 12 ++++++++++++
drivers/gpu/drm/xe/xe_configfs_debug_params.c | 6 ++++++
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_configfs_debug.c b/drivers/gpu/drm/xe/xe_configfs_debug.c
index b068c64e42bf..4542f3311f4b 100644
--- a/drivers/gpu/drm/xe/xe_configfs_debug.c
+++ b/drivers/gpu/drm/xe/xe_configfs_debug.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/cleanup.h>
#include <linux/find.h>
+#include <linux/panic.h>
#include <linux/pci.h>
#include <linux/string.h>
@@ -33,6 +34,10 @@
* and driver debugging and are not stable ABI. Using them is "at your own
* risk".
*
+ * Writing any debug attribute taints the kernel with ``TAINT_TEST``. This
+ * makes it visible in bug reports when a non-standard or unsafe configuration
+ * was active.
+ *
* See the top-level ``Xe Configfs`` documentation in ``xe_configfs.c``
* for how to create, probe and remove configfs devices. Once a device
* directory exists, the driver populates it with a ``debug/`` subdirectory
@@ -524,6 +529,7 @@ static ssize_t wa_bb_store(struct wa_bb wa_bb[static XE_ENGINE_CLASS_MAX],
if (!count) {
memset(wa_bb, 0, sizeof(tmp_wa_bb));
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
return len;
}
@@ -543,6 +549,8 @@ static ssize_t wa_bb_store(struct wa_bb wa_bb[static XE_ENGINE_CLASS_MAX],
memcpy(wa_bb, tmp_wa_bb, sizeof(tmp_wa_bb));
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
+
return len;
}
@@ -694,6 +702,8 @@ static ssize_t engines_allowed_store(struct config_item *item, const char *page,
dev->config.debug.engines_allowed = val;
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
+
return len;
}
@@ -783,6 +793,8 @@ static ssize_t gt_types_allowed_store(struct config_item *item, const char *page
dev->config.debug.gt_types_allowed = typemask;
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
+
return len;
}
diff --git a/drivers/gpu/drm/xe/xe_configfs_debug_params.c b/drivers/gpu/drm/xe/xe_configfs_debug_params.c
index 38af06ca7504..ac9e77838006 100644
--- a/drivers/gpu/drm/xe/xe_configfs_debug_params.c
+++ b/drivers/gpu/drm/xe/xe_configfs_debug_params.c
@@ -29,11 +29,15 @@
* This file also generates the xe_configfs_get_<name>() accessors used
* by the rest of the driver to read a parameter's effective value; see
* the DOC section below.
+ *
+ * Setting these parameters taints the kernel since these are intended
+ * for debug and testing purposes only.
*/
#include <linux/cleanup.h>
#include <linux/configfs.h>
#include <linux/kernel.h>
+#include <linux/panic.h>
#include <linux/pci.h>
#include <linux/string.h>
#include <linux/sysfs.h>
@@ -62,6 +66,7 @@ static ssize_t _name##_store(struct config_item *item, const char *page, size_t
if (xe_configfs_is_bound(dev)) \
return -EBUSY; \
dev->config.debug.params._name = val; \
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK); \
return len; \
}
@@ -95,6 +100,7 @@ static ssize_t _name##_store(struct config_item *item, const char *page, size_t
if (xe_configfs_is_bound(dev)) \
return -EBUSY; \
dev->config.debug.params._name = val; \
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK); \
return len; \
}
--
2.43.0
next prev parent reply other threads:[~2026-07-22 21:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 21:46 [PATCH 0/9] Add new debug infrastructure for configfs Stuart Summers
2026-07-22 21:46 ` [PATCH 1/9] drm/xe: Sort xe_config_device fields Stuart Summers
2026-07-22 21:46 ` [PATCH 2/9] drm/xe: Split out configfs data structures Stuart Summers
2026-07-22 21:46 ` [PATCH 3/9] drm/xe: Add a new debug focused configfs group Stuart Summers
2026-07-22 21:47 ` [PATCH 4/9] drm/xe: Move debug configfs entries to xe_configfs_debug.c Stuart Summers
2026-07-22 21:47 ` [PATCH 5/9] drm/xe/guc: Add configfs support for guc_log_level Stuart Summers
2026-07-22 21:47 ` [PATCH 6/9] drm/xe/guc: Add support for NPK as a GuC log target Stuart Summers
2026-07-22 21:47 ` [PATCH 7/9] drm/xe: Add infrastructure for debug configfs parameters Stuart Summers
2026-07-22 21:47 ` [PATCH 8/9] drm/xe: Migrate existing debug configfs entries to params infrastructure Stuart Summers
2026-07-22 21:47 ` Stuart Summers [this message]
2026-07-22 22:25 ` ✗ CI.checkpatch: warning for Add new debug infrastructure for configfs (rev2) Patchwork
2026-07-22 22:27 ` ✓ CI.KUnit: success " Patchwork
2026-07-22 23:18 ` ✓ Xe.CI.BAT: " Patchwork
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=20260722214656.107936-20-stuart.summers@intel.com \
--to=stuart.summers@intel.com \
--cc=Michal.Wajdeczko@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=shuicheng.lin@intel.com \
--cc=umesh.nerlige.ramappa@intel.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 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.