]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Set fake_vma.size as well as fake_vma.node.size for capture
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 1 Dec 2017 00:15:36 +0000 (00:15 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 1 Dec 2017 09:17:04 +0000 (09:17 +0000)
commit97416af283a3fbf293193b3765c1a4527ce36bc9
tree2c335a79ca7f897ec113ac2f62948f928e75c15d
parent743041adf322f08c82eeaa12f4b1c66917fd23cc
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: Rafael Antognolli <rafael.antognolli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103964
Fixes: 6ce735eb8cf5 ("drm/i915: Record default HW state in the GPU error state")
Signed-off-by: Chris 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: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171201001536.13941-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
drivers/gpu/drm/i915/i915_gpu_error.c