Commit b5e0a941 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Set fake_vma.size as well as fake_vma.node.size for capture

When capturing the bo, we allocate an error object with an array of
min(vma->size, vma->node.size) pages, plus a bit for compression overhead.
However, when creating the fake vma to describe the bo, only one of the
sizes was filled in, resulting in a too small array. Through my and CI
testing, this was sufficient for the mostly empty NULL context as
it compressed well (or the out-of-bounds access simply didn't cause an
issue). However, in real workloads on Cannonlake, we were overflowing
that array and causing havoc with the random memory corruption.
Reported-by: default avatarRafael Antognolli <rafael.antognolli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103964
Fixes: 4e90a6e2 ("drm/i915: Record default HW state in the GPU error state")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Tested-by: default avatarRodrigo Vivi <rodrigo.vivi@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171201001536.13941-1-chris@chris-wilson.co.ukReviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
parent 8bd099a7
...@@ -1424,6 +1424,7 @@ capture_object(struct drm_i915_private *dev_priv, ...@@ -1424,6 +1424,7 @@ capture_object(struct drm_i915_private *dev_priv,
if (obj && i915_gem_object_has_pages(obj)) { if (obj && i915_gem_object_has_pages(obj)) {
struct i915_vma fake = { struct i915_vma fake = {
.node = { .start = U64_MAX, .size = obj->base.size }, .node = { .start = U64_MAX, .size = obj->base.size },
.size = obj->base.size,
.pages = obj->mm.pages, .pages = obj->mm.pages,
.obj = obj, .obj = obj,
}; };
......
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