Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix invalidated inline DMA mappings in GPUSVM
@ 2026-12-04  6:53 Arvind Yadav
  2026-12-04  6:53 ` [PATCH v2 1/2] drm/xe: Snapshot inline DMA addresses before staging page tables Arvind Yadav
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Arvind Yadav @ 2026-12-04  6:53 UTC (permalink / raw)
  To: dri-devel, intel-xe, linux-kernel
  Cc: matthew.brost, thomas.hellstrom, maarten.lankhorst, mripard,
	tzimmermann, airlied, simona, himal.prasad.ghimiray

Invalidation during HMM can leave stale inline DMA state. This skips
DMA array allocation and makes the mapper use a DMA address as an
array pointer, causing a KASAN report in the Xe prefetch worker.

  ===================================================================
  BUG: KASAN: user-memory-access in drm_gpusvm_get_pages+0xe12/0x1380 [drm_gpusvm_helper]
  Write of size 16 at addr 000000027abfd000 by task kworker/u64:71/693678
  Workqueue: xe_prefetch_work_queue prefetch_work_func [xe]


Following Matt's suggestion, clear inline DMA state during unmap
instead of adding another retry after HMM.

Prepare Xe first by copying inline entries under notifier_lock for
page-table staging. When an invalidated userptr stages cleared PTEs,
preserve that state in tile_invalidated at commit.

Changes in v2:
- Clear inline DMA state during unmap instead of retrying after HMM
  (Matthew Brost).
- Add the Xe snapshot patch and track cleared PTEs through commit.
- Update the inline DMA helper's lifetime documentation.

Arvind Yadav (2):
  drm/xe: Snapshot inline DMA addresses before staging page tables
  drm/gpusvm: Clear inline DMA mapping state on unmap

 drivers/gpu/drm/drm_gpusvm.c     |  5 ++
 drivers/gpu/drm/xe/xe_pt.c       | 82 ++++++++++++++++++++++++++++----
 drivers/gpu/drm/xe/xe_pt_types.h |  2 +
 include/drm/drm_gpusvm.h         | 14 +++---
 4 files changed, 89 insertions(+), 14 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-12-04  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  6:53 [PATCH v2 0/2] Fix invalidated inline DMA mappings in GPUSVM Arvind Yadav
2026-12-04  6:53 ` [PATCH v2 1/2] drm/xe: Snapshot inline DMA addresses before staging page tables Arvind Yadav
2026-12-04  7:21   ` sashiko-bot
2026-12-04  6:53 ` [PATCH v2 2/2] drm/gpusvm: Clear inline DMA mapping state on unmap Arvind Yadav
2026-12-04  7:39   ` sashiko-bot
2026-12-04  7:30 ` ✓ CI.KUnit: success for Fix invalidated inline DMA mappings in GPUSVM Patchwork
2026-12-04  8:04 ` ✓ Xe.CI.BAT: " Patchwork

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