Commit 9669a507 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Drop rq->ring->vma peeking from error capture

We only hold the active spinlock while dumping the error state, and this
does not prevent another thread from retiring the request -- as it is
quite possible that despite us capturing the current state, the GPU has
completed the request. As such, it is dangerous to dereference state
below the request as it may already be freed, and the simplest way to
avoid the danger is not include it in the error state.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1788Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424191410.27570-1-chris@chris-wilson.co.uk
parent 9c878557
...@@ -467,14 +467,14 @@ static void error_print_request(struct drm_i915_error_state_buf *m, ...@@ -467,14 +467,14 @@ static void error_print_request(struct drm_i915_error_state_buf *m,
if (!erq->seqno) if (!erq->seqno)
return; return;
err_printf(m, "%s pid %d, seqno %8x:%08x%s%s, prio %d, start %08x, head %08x, tail %08x\n", err_printf(m, "%s pid %d, seqno %8x:%08x%s%s, prio %d, head %08x, tail %08x\n",
prefix, erq->pid, erq->context, erq->seqno, prefix, erq->pid, erq->context, erq->seqno,
test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
&erq->flags) ? "!" : "", &erq->flags) ? "!" : "",
test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
&erq->flags) ? "+" : "", &erq->flags) ? "+" : "",
erq->sched_attr.priority, erq->sched_attr.priority,
erq->start, erq->head, erq->tail); erq->head, erq->tail);
} }
static void error_print_context(struct drm_i915_error_state_buf *m, static void error_print_context(struct drm_i915_error_state_buf *m,
...@@ -1213,7 +1213,6 @@ static void record_request(const struct i915_request *request, ...@@ -1213,7 +1213,6 @@ static void record_request(const struct i915_request *request,
erq->context = request->fence.context; erq->context = request->fence.context;
erq->seqno = request->fence.seqno; erq->seqno = request->fence.seqno;
erq->sched_attr = request->sched.attr; erq->sched_attr = request->sched.attr;
erq->start = i915_ggtt_offset(request->ring->vma);
erq->head = request->head; erq->head = request->head;
erq->tail = request->tail; erq->tail = request->tail;
......
...@@ -50,7 +50,6 @@ struct i915_request_coredump { ...@@ -50,7 +50,6 @@ struct i915_request_coredump {
pid_t pid; pid_t pid;
u32 context; u32 context;
u32 seqno; u32 seqno;
u32 start;
u32 head; u32 head;
u32 tail; u32 tail;
struct i915_sched_attr sched_attr; struct i915_sched_attr sched_attr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment