diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-21 08:50:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-21 08:57:11 +0100 |
commit | dfa3b1fdc9813a48314a43faaacb7dacc06112d6 (patch) | |
tree | ca1f744a1bdf4bf9c11e2afa16669dd0e5c245de | |
parent | c5e5b0ce26fc321591a6d0235c639a1e8ec3cdfa (diff) |
i915/gem_exec_schedule: Read carefully after a missing write-hazard
Since we are not declaring a write hazard from the batch, we have to be
careful in our gem_read() to force a read from memory and not a
speculative read from the CPU cache.
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/859
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r-- | tests/i915/gem_exec_schedule.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c index 0a7deb5a1..0dfeb39f6 100644 --- a/tests/i915/gem_exec_schedule.c +++ b/tests/i915/gem_exec_schedule.c @@ -2307,7 +2307,6 @@ static void test_pi_iova(int i915, unsigned int engine, unsigned int flags) igt_spin_t *spin; pthread_t hi, lo; char poison[4096]; - uint32_t result; int ufd; /* @@ -2410,9 +2409,7 @@ static void test_pi_iova(int i915, unsigned int engine, unsigned int flags) pthread_join(lo, NULL); gem_close(i915, t.batch); - gem_sync(i915, t.scratch); /* write hazard lies */ - gem_read(i915, t.scratch, 0, &result, sizeof(result)); - igt_assert_eq(result, MIN_PRIO); + igt_assert_eq(__sync_read_u32(i915, t.scratch, 0), MIN_PRIO); gem_close(i915, t.scratch); munmap(t.page, 4096); |