Skip to content

drm/xe/mmio_gem: fix fault handler and destroy path

Ilia Levi intel-xe 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 8 repliesIn review
  2. v25 patches 11 repliesSuperseded
  3. v14 patches 3 repliesSuperseded

v2 from the cover letter

- New patch 1/5: fix dummy page WB/UC aliasing (Sashiko)
- Patch 2/5: no longer modifies xe_mmio_gem_vm_fault_dummy_page() (handled by 1/5)
- Patch 3/5: unchanged
- Patch 4/5: compute pfn inside scoped_guard
- Patch 5/5: adapt to xe_mmio_gem_vm_fault_dummy_page() signature change, fix "objecthas" typo

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drm/xe/mmio_gem: forbid VMA splitdrivers/gpu/drm/xe/xe_mmio_gem.c+10 -01 reply
2/7drm/xe/mmio_gem: use write-back mapping for dummy pagedrivers/gpu/drm/xe/xe_mmio_gem.c+5 -143 replies
3/7drm/xe/mmio_gem: simplify fault handler loopdrivers/gpu/drm/xe/xe_mmio_gem.c+6 -61 reply
4/7drm/xe/mmio_gem: Revoke drm_vma_node on xe_mmio_gem destroydrivers/gpu/drm/xe/xe_mmio_gem.c drivers/gpu/drm/xe/xe_mmio_gem.h+4 -20 replies
5/7drm/xe/mmio_gem: cache the dummy page per objectdrivers/gpu/drm/xe/xe_mmio_gem.c+16 -111 reply
6/7drm/xe/mmio_gem: fix destroy flowdrivers/gpu/drm/xe/xe_mmio_gem.c+35 -71 reply
7/7drm/xe: convert PCI barrier mmap to use xe_mmio_gemdrivers/gpu/drm/xe/xe_bo.c drivers/gpu/drm/xe/xe_bo.h drivers/gpu/drm/xe/xe_device.c +1 more+39 -1001 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchIlia LeviMatthew Auld
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] drm/xe/mmio_gem: fix fault handler and destroy path

This series fixes several issues in xe_mmio_gem, introduced by 1ffcf8b8ae8a ("drm/xe: Support for mmap-ing mmio regions"):
split VMA handling, WB/UC aliasing of the dummy page, a rb-tree leak on destroy, dummy page accumulation, and use-after-free / MMIO access after destroy. It also converts the existing PCI barrier mmap to build on xe_mmio_gem now that the infrastructure is in place.

v3: (Matt Auld)
- New patch using the xe_mmio_gem infra for PCI barrier mmap
- New patch for rejecting VMA split
- Using dma_resv lock for synchronization
- SIGBUS instead of dummy page on access after destroy
- Some changes in patch splitting (e.g. the vm_pgoff handling now lives in the destroy-flow patch alongside the zap that needs it)

v2:
- New patch 1/5: fix dummy page WB/UC aliasing (Sashiko)
- Patch 2/5: no longer modifies xe_mmio_gem_vm_fault_dummy_page() (handled by 1/5)
- Patch 3/5: unchanged
- Patch 4/5: compute pfn inside scoped_guard
- Patch 5/5: adapt to xe_mmio_gem_vm_fault_dummy_page() signature change, fix "objecthas" typo

Ilia Levi (5):
drm/xe/mmio_gem: forbid VMA split drm/xe/mmio_gem: use write-back mapping for dummy page drm/xe/mmio_gem: simplify fault handler loop drm/xe/mmio_gem: cache the dummy page per object drm/xe/mmio_gem: fix destroy flow

Matthew Auld (1):
drm/xe: convert PCI barrier mmap to use xe_mmio_gem

Shuicheng Lin (1):
drm/xe/mmio_gem: Revoke drm_vma_node on xe_mmio_gem destroy

 drivers/gpu/drm/xe/xe_bo.c           |  24 ++++--
 drivers/gpu/drm/xe/xe_bo.h           |   1 -
 drivers/gpu/drm/xe/xe_device.c       | 102 ++-----------------------
 drivers/gpu/drm/xe/xe_device_types.h |  12 +++
 drivers/gpu/drm/xe/xe_mmio_gem.c     | 108 ++++++++++++++++++---------
 drivers/gpu/drm/xe/xe_mmio_gem.h     |   2 +-
 6 files changed, 112 insertions(+), 137 deletions(-)
Signature · 1 line
2.49.1