All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] drm/i915: Failsafe migration blits
@ 2021-11-02 16:34 ` Thomas Hellström
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Hellström @ 2021-11-02 16:34 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Thomas Hellström, matthew.auld

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)

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  | 520 ++++++++++++++++++
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h  |  43 ++
 .../drm/i915/gem/selftests/i915_gem_migrate.c |  24 +-
 6 files changed, 670 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

-- 
2.31.1


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

end of thread, other threads:[~2021-11-02 22:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 16:34 [PATCH v3 0/2] drm/i915: Failsafe migration blits Thomas Hellström
2021-11-02 16:34 ` [Intel-gfx] " Thomas Hellström
2021-11-02 16:34 ` [PATCH v3 1/2] drm/i915/ttm: Reorganize the ttm move code Thomas Hellström
2021-11-02 16:34   ` [Intel-gfx] " Thomas Hellström
2021-11-02 16:34 ` [PATCH v3 2/2] drm/i915/ttm: Failsafe migration blits Thomas Hellström
2021-11-02 16:34   ` [Intel-gfx] " Thomas Hellström
2021-11-02 17:40   ` Matthew Auld
2021-11-02 17:40     ` [Intel-gfx] " Matthew Auld
2021-11-02 17:55     ` Thomas Hellström
2021-11-02 17:55       ` [Intel-gfx] " Thomas Hellström
2021-11-02 18:58       ` Matthew Auld
2021-11-02 18:58         ` [Intel-gfx] " Matthew Auld
2021-11-02 18:43 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Failsafe migration blits (rev4) Patchwork
2021-11-02 19:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-11-02 22:07 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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.