stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences"
       [not found] <20220504183410.1283944-1-alan.previn.teres.alexis@intel.com>
@ 2022-05-04 18:34 ` Alan Previn
  2022-05-04 23:32   ` [gfx-internal-devel] " John Harrison
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Previn @ 2022-05-04 18:34 UTC (permalink / raw)
  To: gfx-internal-devel
  Cc: Alan Previn, Jason Ekstrand, Marcin Slusarz, stable,
	Jason Ekstrand, Daniel Vetter, Jon Bloomfield

From: Jason Ekstrand <jason@jlekstrand.net>

This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7.  Ever
since that commit, we've been having issues where a hang in one client
can propagate to another.  In particular, a hang in an app can propagate
to the X server which causes the whole desktop to lock up.

Error propagation along fences sound like a good idea, but as your bug
shows, surprising consequences, since propagating errors across security
boundaries is not a good thing.

What we do have is track the hangs on the ctx, and report information to
userspace using RESET_STATS. That's how arb_robustness works. Also, if my
understanding is still correct, the EIO from execbuf is when your context
is banned (because not recoverable or too many hangs). And in all these
cases it's up to userspace to figure out what is all impacted and should
be reported to the application, that's not on the kernel to guess and
automatically propagate.

What's more, we're also building more features on top of ctx error
reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the
userspace fence wait also relies on that mechanism. So it is the path
going forward for reporting gpu hangs and resets to userspace.

So all together that's why I think we should just bury this idea again as
not quite the direction we want to go to, hence why I think the revert is
the right option here.

For backporters: Please note that you _must_ have a backport of
https://lore.kernel.org/dri-devel/20210602164149.391653-2-jason@jlekstrand.net/
for otherwise backporting just this patch opens up a security bug.

v2: Augment commit message. Also restore Jason's sob that I
accidentally lost.

v3: Add a note for backporters

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reported-by: Marcin Slusarz <marcin.slusarz@intel.com>
Cc: <stable@vger.kernel.org> # v5.6+
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Marcin Slusarz <marcin.slusarz@intel.com>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080
Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-3-jason@jlekstrand.net
(cherry picked from commit 93a2711cddd5760e2f0f901817d71c93183c3b87)
---
 drivers/gpu/drm/i915/i915_request.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 8e310b8dd91c..6a5070399c04 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -1297,10 +1297,8 @@ i915_request_await_execution(struct i915_request *rq,
 
 	do {
 		fence = *child++;
-		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
-			i915_sw_fence_set_error_once(&rq->submit, fence->error);
+		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
 			continue;
-		}
 
 		if (fence->context == rq->fence.context)
 			continue;
@@ -1398,10 +1396,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence)
 
 	do {
 		fence = *child++;
-		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
-			i915_sw_fence_set_error_once(&rq->submit, fence->error);
+		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
 			continue;
-		}
 
 		/*
 		 * Requests on the same timeline are explicitly ordered, along

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

* Re: [gfx-internal-devel] [PATCH 1/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences"
  2022-05-04 18:34 ` [PATCH 1/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Alan Previn
@ 2022-05-04 23:32   ` John Harrison
  2022-05-05  6:18     ` Teres Alexis, Alan Previn
  0 siblings, 1 reply; 3+ messages in thread
From: John Harrison @ 2022-05-04 23:32 UTC (permalink / raw)
  To: gfx-internal-devel, Alan Previn
  Cc: Jason Ekstrand, Marcin Slusarz, stable, Jason Ekstrand,
	Daniel Vetter, Jon Bloomfield

On 5/4/2022 11:34, Alan Previn wrote:
> From: Jason Ekstrand <jason@jlekstrand.net>
>
> This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7.  Ever
> since that commit, we've been having issues where a hang in one client
> can propagate to another.  In particular, a hang in an app can propagate
> to the X server which causes the whole desktop to lock up.
>
> Error propagation along fences sound like a good idea, but as your bug
> shows, surprising consequences, since propagating errors across security
> boundaries is not a good thing.
>
> What we do have is track the hangs on the ctx, and report information to
> userspace using RESET_STATS. That's how arb_robustness works. Also, if my
> understanding is still correct, the EIO from execbuf is when your context
> is banned (because not recoverable or too many hangs). And in all these
> cases it's up to userspace to figure out what is all impacted and should
> be reported to the application, that's not on the kernel to guess and
> automatically propagate.
>
> What's more, we're also building more features on top of ctx error
> reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the
> userspace fence wait also relies on that mechanism. So it is the path
> going forward for reporting gpu hangs and resets to userspace.
>
> So all together that's why I think we should just bury this idea again as
> not quite the direction we want to go to, hence why I think the revert is
> the right option here.
>
> For backporters: Please note that you _must_ have a backport of
> https://lore.kernel.org/dri-devel/20210602164149.391653-2-jason@jlekstrand.net/
> for otherwise backporting just this patch opens up a security bug.
I'm not seeing that required patch in DII.

John.

>
> v2: Augment commit message. Also restore Jason's sob that I
> accidentally lost.
>
> v3: Add a note for backporters
>
> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
> Reported-by: Marcin Slusarz <marcin.slusarz@intel.com>
> Cc: <stable@vger.kernel.org> # v5.6+
> Cc: Jason Ekstrand <jason.ekstrand@intel.com>
> Cc: Marcin Slusarz <marcin.slusarz@intel.com>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080
> Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-3-jason@jlekstrand.net
> (cherry picked from commit 93a2711cddd5760e2f0f901817d71c93183c3b87)
> ---
>   drivers/gpu/drm/i915/i915_request.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 8e310b8dd91c..6a5070399c04 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -1297,10 +1297,8 @@ i915_request_await_execution(struct i915_request *rq,
>   
>   	do {
>   		fence = *child++;
> -		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
> -			i915_sw_fence_set_error_once(&rq->submit, fence->error);
> +		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
>   			continue;
> -		}
>   
>   		if (fence->context == rq->fence.context)
>   			continue;
> @@ -1398,10 +1396,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence)
>   
>   	do {
>   		fence = *child++;
> -		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
> -			i915_sw_fence_set_error_once(&rq->submit, fence->error);
> +		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
>   			continue;
> -		}
>   
>   		/*
>   		 * Requests on the same timeline are explicitly ordered, along


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

* Re: [gfx-internal-devel] [PATCH 1/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences"
  2022-05-04 23:32   ` [gfx-internal-devel] " John Harrison
@ 2022-05-05  6:18     ` Teres Alexis, Alan Previn
  0 siblings, 0 replies; 3+ messages in thread
From: Teres Alexis, Alan Previn @ 2022-05-05  6:18 UTC (permalink / raw)
  To: Harrison, John C, gfx-internal-devel
  Cc: Bloomfield, Jon, jason, stable, daniel.vetter, Slusarz, Marcin,
	jason.ekstrand


On Wed, 2022-05-04 at 16:32 -0700, John Harrison wrote:
> On 5/4/2022 11:34, Alan Previn wrote:
> > From: Jason Ekstrand <jason@jlekstrand.net>
> > 
...
> > For backporters: Please note that you _must_ have a backport of
> > https://lore.kernel.org/dri-devel/20210602164149.391653-2-jason@jlekstrand.net/
> > for otherwise backporting just this patch opens up a security bug.
> I'm not seeing that required patch in DII.
> 
> John.
> 
Okay, I'll get that on the next rev. It would have been nice if the same review was made
on the DII backport that was merged last year which references this very revert as a
related dependency but wasn't pulled in: "Revert drm/i915/gt: Propagate change in error
status to children on unhold".

...alan

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

end of thread, other threads:[~2022-05-05  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220504183410.1283944-1-alan.previn.teres.alexis@intel.com>
2022-05-04 18:34 ` [PATCH 1/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Alan Previn
2022-05-04 23:32   ` [gfx-internal-devel] " John Harrison
2022-05-05  6:18     ` Teres Alexis, Alan Previn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).