All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels
@ 2026-06-12  3:27 Gajendra Uttamchand
  2026-06-12  3:27 ` [PATCH 1/2] [PATCH] drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe Gajendra Uttamchand
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Gajendra Uttamchand @ 2026-06-12  3:27 UTC (permalink / raw)
  To: umesh.nerlige.ramappa, matthew.brost, intel-xe; +Cc: Uttamchand, Gajendra

From: "Uttamchand, Gajendra" <gajendra.uttamchand@intel.com>

Fix timestamp handling for Xe LRC contexts to avoid races and false
timeout detection. The first 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. The second patch treats sentinel values (0 and CONTEXT_ACTIVE)
as "no elapsed time" and adjusts the delta calculation to handle the
32-bit wrap, preventing false TDRs when the sentinel is observed.

Uttamchand, Gajendra (2):
  drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe
  drm/xe/guc: treat sentinel timestamps as no elapsed time to avoid
    false TDR

 drivers/gpu/drm/xe/xe_guc_submit.c | 17 ++++++++++++++++-
 drivers/gpu/drm/xe/xe_lrc.c        | 29 +++++++++++++++++++++--------
 drivers/gpu/drm/xe/xe_lrc.h        |  7 +++++++
 3 files changed, 44 insertions(+), 9 deletions(-)

--
2.43.0


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

end of thread, other threads:[~2026-06-12 19:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12  3:27 [PATCH 0/2] drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels Gajendra Uttamchand
2026-06-12  3:27 ` [PATCH 1/2] [PATCH] drm/xe/lrc: document sentinel and make CTX_TIMESTAMP read TOCTOU-safe Gajendra Uttamchand
2026-06-12 17:28   ` Umesh Nerlige Ramappa
2026-06-12 17:33     ` Matthew Brost
2026-06-12  3:27 ` [PATCH 2/2] [PATCH] drm/xe/guc: treat sentinel timestamps as no elapsed time to avoid false TDR Gajendra Uttamchand
2026-06-12  5:20   ` Matthew Brost
2026-06-12  3:33 ` ✗ CI.checkpatch: warning for drm/xe: make CTX_TIMESTAMP TOCTOU-safe and handle sentinels Patchwork
2026-06-12  3:35 ` ✓ CI.KUnit: success " Patchwork
2026-06-12  4:13 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-12 19:31 ` ✓ Xe.CI.FULL: " Patchwork

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.