All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] BACKPORT: drm/i915: Get rid of fence error propagation
@ 2021-08-02 18:48 Jason Ekstrand
  2021-08-02 18:48 ` [PATCH 1/2] drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser" Jason Ekstrand
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jason Ekstrand @ 2021-08-02 18:48 UTC (permalink / raw)
  To: stable; +Cc: Jason Ekstrand

This is a back-port of the following patches from torvalds/master to 5.10:

 - 686c7c35abc2 ("drm/i915/gem: Asynchronous cmdparser")
 - 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")

Jason Ekstrand (2):
  drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"
  Revert "drm/i915: Propagate errors on awaiting already signaled
    fences"

 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 164 +-----------------
 drivers/gpu/drm/i915/i915_cmd_parser.c        |  28 +--
 drivers/gpu/drm/i915/i915_request.c           |   8 +-
 3 files changed, 27 insertions(+), 173 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/2] BACKPORT: drm/i915: Get rid of fence error propagation
@ 2021-08-02 18:48 Jason Ekstrand
  2021-08-02 18:48 ` [PATCH 2/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Jason Ekstrand
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Ekstrand @ 2021-08-02 18:48 UTC (permalink / raw)
  To: stable; +Cc: Jason Ekstrand

This is a back-port of the following patches from torvalds/master to 5.13:

 - 686c7c35abc2 ("drm/i915/gem: Asynchronous cmdparser")
 - 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")

Jason Ekstrand (2):
  drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"
  Revert "drm/i915: Propagate errors on awaiting already signaled
    fences"

 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 227 +-----------------
 .../i915/gem/selftests/i915_gem_execbuffer.c  |   4 +
 drivers/gpu/drm/i915/i915_cmd_parser.c        | 118 +++++----
 drivers/gpu/drm/i915/i915_drv.h               |   7 +-
 drivers/gpu/drm/i915/i915_request.c           |   8 +-
 5 files changed, 93 insertions(+), 271 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 1/2] drm/i915/cmdparser: No-op failed batches on all platforms
@ 2021-05-19  7:43 Daniel Vetter
  2021-05-19  7:43   ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2021-05-19  7:43 UTC (permalink / raw)
  To: DRI Development, Intel Graphics Development
  Cc: Daniel Vetter, stable, Jason Ekstrand, Marcin Slusarz,
	Jon Bloomfield, Daniel Vetter

On gen9 for blt cmd parser we relied on the magic fence error
propagation which:
- doesn't work on gen7, because there's no scheduler with ringbuffers
  there yet
- fence error propagation can be weaponized to attack other things, so
  not a good design idea

Instead of magic, do the same thing on gen9 as on gen7.

Kudos to Jason for figuring this out.

Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")
Cc: <stable@vger.kernel.org> # v5.6+
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Marcin Slusarz <marcin.slusarz@intel.com>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Relates: https://gitlab.freedesktop.org/drm/intel/-/issues/3080
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 34 +++++++++++++-------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index 5b4b2bd46e7c..2d3336ab7ba3 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -1509,6 +1509,12 @@ int intel_engine_cmd_parser(struct intel_engine_cs *engine,
 		}
 	}
 
+	/* Batch unsafe to execute with privileges, cancel! */
+	if (ret) {
+		cmd = page_mask_bits(shadow->obj->mm.mapping);
+		*cmd = MI_BATCH_BUFFER_END;
+	}
+
 	if (trampoline) {
 		/*
 		 * With the trampoline, the shadow is executed twice.
@@ -1524,26 +1530,20 @@ int intel_engine_cmd_parser(struct intel_engine_cs *engine,
 		 */
 		*batch_end = MI_BATCH_BUFFER_END;
 
-		if (ret) {
-			/* Batch unsafe to execute with privileges, cancel! */
-			cmd = page_mask_bits(shadow->obj->mm.mapping);
-			*cmd = MI_BATCH_BUFFER_END;
+		/* If batch is unsafe but valid, jump to the original */
+		if (ret == -EACCES) {
+			unsigned int flags;
 
-			/* If batch is unsafe but valid, jump to the original */
-			if (ret == -EACCES) {
-				unsigned int flags;
+			flags = MI_BATCH_NON_SECURE_I965;
+			if (IS_HASWELL(engine->i915))
+				flags = MI_BATCH_NON_SECURE_HSW;
 
-				flags = MI_BATCH_NON_SECURE_I965;
-				if (IS_HASWELL(engine->i915))
-					flags = MI_BATCH_NON_SECURE_HSW;
+			GEM_BUG_ON(!IS_GEN_RANGE(engine->i915, 6, 7));
+			__gen6_emit_bb_start(batch_end,
+					     batch_addr,
+					     flags);
 
-				GEM_BUG_ON(!IS_GEN_RANGE(engine->i915, 6, 7));
-				__gen6_emit_bb_start(batch_end,
-						     batch_addr,
-						     flags);
-
-				ret = 0; /* allow execution */
-			}
+			ret = 0; /* allow execution */
 		}
 	}
 
-- 
2.31.0


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

end of thread, other threads:[~2021-08-02 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 18:48 [PATCH 0/2] BACKPORT: drm/i915: Get rid of fence error propagation Jason Ekstrand
2021-08-02 18:48 ` [PATCH 1/2] drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser" Jason Ekstrand
2021-08-02 18:48 ` [PATCH 2/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Jason Ekstrand
2021-08-02 19:21 ` [PATCH 0/2] BACKPORT: drm/i915: Get rid of fence error propagation Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2021-08-02 18:48 Jason Ekstrand
2021-08-02 18:48 ` [PATCH 2/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Jason Ekstrand
2021-05-19  7:43 [PATCH 1/2] drm/i915/cmdparser: No-op failed batches on all platforms Daniel Vetter
2021-05-19  7:43 ` [PATCH 2/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Daniel Vetter
2021-05-19  7:43   ` Daniel Vetter

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.