Skip to content

drm/i915: Failsafe migration blits

Thomas Hellström intel-gfx 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 0 repliesNew
  2. v52 patches 0 repliesSuperseded
  3. v42 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v32 patches3 repliesSuperseded
v22 patches5 repliesSuperseded
v16 patches10 repliesSuperseded

Changes in v6 from the cover letter

- Fix a missing call to i915_ttm_memcpy_release() (Matthew Auld)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/i915/ttm: Reorganize the ttm move codedrivers/gpu/drm/i915/Makefile drivers/gpu/drm/i915/gem/i915_gem_ttm.c drivers/gpu/drm/i915/gem/i915_gem_ttm.h +2 more+430 -2800 replies
2/2drm/i915/ttm: Failsafe migration blitsdrivers/gpu/drm/i915/gem/i915_gem_ttm_move.c drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c+298 -560 replies

Reviews trailers per patch

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

PatchMatthew Auld
1/2R-b
2/2R-b

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

Read the v6 thread

Cover letter [Intel-gfx] [PATCH v6 0/2] drm/i915: Failsafe migration blits

This patch series introduces failsafe migration blits.
The reason for this seemingly strange concept is that if the initial clearing or readback of LMEM fails for some reason[1], and we then set up either GPU- or CPU ptes to the allocated LMEM, we can expose old contents from other clients.

So after each migration blit to LMEM, attach a dma-fence callback that checks the migration fence error value and if it's an error, performs a memcpy blit, instead.

Patch 1 splits out the TTM move code into separate files Patch 2 implements the failsafe blits and related self-tests

[1] There are at least two ways we could trigger exposure of uninitialized LMEM assuming the migration blits themselves never trigger a gpu hang.

a) A gpu operation preceding a pipelined eviction blit resets and sets the error fence to -EIO, and the error is propagated across the TTM manager to the clear / swapin blit of a newly allocated TTM resource. It aborts and leaves the memory uninitialized.

b) Something wedges the GT while a migration blit is submitted. It ends up never executed and TTM can fault user-space cpu-ptes into uninitialized memory.

v3:
- Style fixes in second patch (Matthew Auld)
v4:
- More style fixes in second patch (Matthew Auld)
v5:
- Fix an issue where we might end up waiting for a fence that would never signal.
v6:
- Fix a missing call to i915_ttm_memcpy_release() (Matthew Auld)

Thomas Hellström (2):
drm/i915/ttm: Reorganize the ttm move code
drm/i915/ttm: Failsafe migration blits

 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       | 328 ++---------
 drivers/gpu/drm/i915/gem/i915_gem_ttm.h       |  35 ++
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c  | 523 ++++++++++++++++++
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h  |  43 ++
 .../drm/i915/gem/selftests/i915_gem_migrate.c |  24 +-
 6 files changed, 673 insertions(+), 281 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h
Signature · 1 line
2.31.1