Skip to content

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

Matthew Auld intel-xe sashiko-reviews 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 2 repliesIn review
  2. v48 patches 3 repliesSuperseded

Changes in v5 from the cover letter

- Tweak "convert PCI barrier mmap to use xe_mmio_gem" to use scoped_guard()

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8drm/xe/mmio_gem: forbid VMA splitdrivers/gpu/drm/xe/xe_mmio_gem.c+10 -00 replies
2/8drm/xe/mmio_gem: use write-back mapping for dummy pagedrivers/gpu/drm/xe/xe_mmio_gem.c+5 -140 replies
3/8drm/xe/mmio_gem: simplify fault handler loopdrivers/gpu/drm/xe/xe_mmio_gem.c+6 -60 replies
4/8drm/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/8drm/xe/mmio_gem: cache the dummy page per objectdrivers/gpu/drm/xe/xe_mmio_gem.c+16 -110 replies
6/8drm/xe/mmio_gem: fix destroy flowdrivers/gpu/drm/xe/xe_mmio_gem.c+35 -71 reply
7/8drm/xe/mmio_gem: reject VM_EXEC and drop VM_DONTCOPYdrivers/gpu/drm/xe/xe_mmio_gem.c+5 -20 replies
8/8drm/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+61 -1101 reply

Reviews trailers per patch

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

PatchMatthew AuldIlia LeviThomas Hellström
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

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

Picking up the series from Ilia:
https://lore.kernel.org/intel-xe/[email protected]/

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.

v5 (Thomas):
- Tweak "convert PCI barrier mmap to use xe_mmio_gem" to use scoped_guard()
v4:
- One extra patch for VM_EXEC and DONTCOPY.
- Tweak the commit message in "use write-back mapping for dummy page" wrt x86.
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

Signature · 1 line
2.55.0