Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Stuart Summers <stuart.summers@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Riana Tauro <riana.tauro@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v3 0/6] drm/xe: Add user commands to WA BB via configfs
Date: Fri,  5 Sep 2025 22:50:28 -0700	[thread overview]
Message-ID: <20250905-wa-bb-cmds-v3-0-3da2b7bdc73e@intel.com> (raw)

Integrate WA BB (aka post context restore bb) with configfs to allow
validation to experiment with the GPU, executing commands on every
context switch.

Setting some registers to experiment:

	# echo 0 > /sys/bus/pci/drivers_autoprobe
	# modprobe xe
	# mkdir  /sys/kernel/config/xe/0000:04:00.0
	# echo '
	rcs cmd 11000001 4F104 DEADDEAD
	rcs reg 4F100 DEADBEEF
	' > /sys/kernel/config/xe/0000\:03\:00.0/ctx_restore_post_bb
	# echo 0000:04:00.0 > /sys/bus/pci/drivers/xe/bind

Testing it worked with intel_reg:

	# intel_reg read mmio:4F100
	(0x0004f100): 0xdeadbeef
	# intel_reg read mmio:4F104
	(0x0004f104): 0xdeaddead

This also prepares the codebase to use the same functions for mid
context restore.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
Changes in v3:
- Minor updates on first patches
- Fix kunit build (without CONFIG_CONFIGFS_FS)
- Fix use of binary attributes failing the expectation of a failed write
  producing an error code
- Link to v2: https://lore.kernel.org/r/20250827-wa-bb-cmds-v2-0-3cdf4d63c72a@intel.com

Changes in v2:
- Drop other refactors and fixes already merged
- Add documentation and make sure it works with intel_reg
- Refactor command parsing to be able to easily extend it for other BBs
  to be added in future.
- Link to v1: https://lore.kernel.org/r/20250523-wa-bb-cmds-v1-0-40b337f71bcd@intel.com
---
Lucas De Marchi (6):
      drm/xe: Update workaround documentation
      drm/xe/configfs: Fix documentation warning
      drm/xe/configfs: Extract function to parse engine
      drm/xe/configfs: Allow to select by class only
      drm/xe/lrc: Allow to add user commands on context switch
      drm/xe/configfs: Add post context restore bb

 drivers/gpu/drm/xe/xe_configfs.c | 367 ++++++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/xe/xe_configfs.h |   6 +
 drivers/gpu/drm/xe/xe_lrc.c      |  25 +++
 drivers/gpu/drm/xe/xe_wa.c       |  45 +++--
 4 files changed, 405 insertions(+), 38 deletions(-)

base-commit: 6a483fa08dd4b4f355b65acc8aa24a335baccd2b
change-id: 20250523-wa-bb-cmds-2a81a7121fc2

Lucas De Marchi


             reply	other threads:[~2025-09-06  5:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-06  5:50 Lucas De Marchi [this message]
2025-09-06  5:50 ` [PATCH v3 1/6] drm/xe: Update workaround documentation Lucas De Marchi
2025-09-06  5:50 ` [PATCH v3 2/6] drm/xe/configfs: Fix documentation warning Lucas De Marchi
2025-09-06  5:50 ` [PATCH v3 3/6] drm/xe/configfs: Extract function to parse engine Lucas De Marchi
2025-09-06  5:50 ` [PATCH v3 4/6] drm/xe/configfs: Allow to select by class only Lucas De Marchi
2025-09-09 10:27   ` Raag Jadav
2025-09-09 12:42     ` Lucas De Marchi
2025-09-09 17:22       ` Raag Jadav
2025-09-06  5:50 ` [PATCH v3 5/6] drm/xe/lrc: Allow to add user commands on context switch Lucas De Marchi
2025-09-06  5:50 ` [PATCH v3 6/6] drm/xe/configfs: Add post context restore bb Lucas De Marchi
2025-09-08 22:39   ` Matt Roper
2025-09-09 12:56     ` Lucas De Marchi
2025-09-08 19:46 ` ✗ CI.checkpatch: warning for drm/xe: Add user commands to WA BB via configfs Patchwork
2025-09-08 19:47 ` ✓ CI.KUnit: success " Patchwork
2025-09-08 20:27 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-08 23:55 ` ✗ Xe.CI.Full: failure " 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=20250905-wa-bb-cmds-v3-0-3da2b7bdc73e@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=stuart.summers@intel.com \
    --cc=tursulin@ursulin.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox