Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/3] drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels
@ 2026-07-31  4:00 Gajendra Uttamchand
  2026-07-31  4:00 ` [PATCH v9 1/3] [PATCH] drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe Gajendra Uttamchand
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Gajendra Uttamchand @ 2026-07-31  4:00 UTC (permalink / raw)
  To: umesh.nerlige.ramappa, matthew.brost, kamil.konieczny,
	rodrigo.vivi, intel-xe
  Cc: Gajendra Uttamchand

Fix timestamp handling for Xe LRC contexts to avoid races and false
timeout detection. This patch documents and centralises the
CONTEXT_ACTIVE sentinel and makes MMIO reads of CTX_TIMESTAMP TOCTOU-
safe by verifying the LRC-stored timestamp before and after the MMIO
read.

Fixes: d243ef6a39c6 ("drm/xe/lrc: Refactor xe_lrc_timestamp to simplify logic")

v2:
Dropped the redundant second patch (Matt Brost)

v3:
Added the Fixes tag for the original commit (Umesh Nerlige)

v4:
Added Reviewed-by for the original commit (Umesh Nerlige)
Added Acked-by for the original commit (Matt Brost)

v5:
Fix incorrect 'From:' username in commit header (Kamil)"

v6:
Fix AI review comments from sashiko.dev
 - Fix torn read of CTX_TIMESTAMP from LRC
 - Fix ABA race on engine migration in context timestamp read

v7:
Fix review comments (Vivi Rodrigo)
 - Added Assisted-by coding assistant used
 - Removed extra comments
Added ldw check additionally to avoid torn read (sashiko.dev)

v8:
Fix git am merge issue with v7 patch series

v9:
Fix AI review comments from sashiko.dev

Gajendra Uttamchand (3):
  drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe
  drm/xe/lrc: Fix torn read of CTX_TIMESTAMP from LRC
  drm/xe/lrc: Fix ABA race on engine migration in context timestamp read

 drivers/gpu/drm/xe/xe_lrc.c | 69 ++++++++++++++++++++++++++++---------
 drivers/gpu/drm/xe/xe_lrc.h |  7 ++++
 2 files changed, 60 insertions(+), 16 deletions(-)

--
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-08-03 22:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  4:00 [PATCH v9 0/3] drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels Gajendra Uttamchand
2026-07-31  4:00 ` [PATCH v9 1/3] [PATCH] drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe Gajendra Uttamchand
2026-08-03 19:26   ` Umesh Nerlige Ramappa
2026-07-31  4:00 ` [PATCH v9 2/3] drm/xe/lrc: Fix torn read of CTX_TIMESTAMP from LRC Gajendra Uttamchand
2026-08-03 21:25   ` Umesh Nerlige Ramappa
2026-08-03 21:41     ` Umesh Nerlige Ramappa
2026-07-31  4:00 ` [PATCH v9 3/3] drm/xe/lrc: Fix ABA race on engine migration in context timestamp read Gajendra Uttamchand
2026-08-03 22:40   ` Umesh Nerlige Ramappa
2026-07-31  4:06 ` ✗ CI.checkpatch: warning for drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels (rev9) Patchwork
2026-07-31  4:07 ` ✓ CI.KUnit: success " Patchwork
2026-07-31  4:43 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-31  5:46 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox