drm/i915/selftest: Clear the output buffers before GPU writes
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 13 Sep 2022 15:21:51 +0000 (17:21 +0200)
committerAndi Shyti <andi.shyti@linux.intel.com>
Wed, 14 Sep 2022 11:21:46 +0000 (13:21 +0200)
commit42b2bdc8c478a705a9642c85d8b3802f5516447d
tree49f21cf3837dd358c877e3f6c7fd8899d03e5607
parent25e4b26672a0908078e10733eb20efa20800e534
drm/i915/selftest: Clear the output buffers before GPU writes

When testing whether we can get the GPU to leak information about
non-privileged state, we first need to ensure that the output buffer is
set to a known value as the HW may opt to skip the write into memory for
a non-privileged read of a sensitive register. We chose POISON_INUSE (0x5a)
so that is both non-zero and distinct from the poison values used during
the test.

v2:
  Use i915_gem_object_pin_map_unlocked

Reported-by: CQ Tang <cq.tang@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: CQ Tang <cq.tang@intel.com>
cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Signed-off-by: Karolina Drobnik <karolina.drobnik@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5cebab02d182c171cf40cb5b73d6c3eeb7619360.1663081418.git.karolina.drobnik@intel.com
drivers/gpu/drm/i915/gt/selftest_lrc.c