intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gt: Clear CACHE_MODE prior to clearing residuals
@ 2021-01-16 22:31 Chris Wilson
  2021-01-16 23:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Chris Wilson @ 2021-01-16 22:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

Since we do a bare context switch with no restore, the clear residual
kernel runs on dirty state, and we must be careful to avoid executing
bad state from context registers inherited from a malicious client.

Fixes: 008ead6ef8f5 ("drm/i915/gt: Restore clear-residual mitigations for Ivybridge, Baytrail")
Fixes: 09aa9e45863e ("drm/i915/gt: Restore clear-residual mitigations for Ivybridge, Baytrail")
Testcase: igt/gem_ctx_isolation # ivb,vlv
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
---
 drivers/gpu/drm/i915/gt/gen7_renderclear.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/gen7_renderclear.c b/drivers/gpu/drm/i915/gt/gen7_renderclear.c
index 56bdcdaa9a88..7d015416e4c4 100644
--- a/drivers/gpu/drm/i915/gt/gen7_renderclear.c
+++ b/drivers/gpu/drm/i915/gt/gen7_renderclear.c
@@ -390,6 +390,13 @@ static void emit_batch(struct i915_vma * const vma,
 						     &cb_kernel_ivb,
 						     desc_count);
 
+	batch_add(&cmds, MI_LOAD_REGISTER_IMM(1));
+	batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_0));
+	batch_add(&cmds, 0xffff0000);
+	batch_add(&cmds, MI_LOAD_REGISTER_IMM(1));
+	batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_1));
+	batch_add(&cmds, 0xffff0000 | PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
+
 	gen7_emit_pipeline_invalidate(&cmds);
 	batch_add(&cmds, PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
 	batch_add(&cmds, MI_NOOP);
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-01-18  5:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16 22:31 [Intel-gfx] [PATCH] drm/i915/gt: Clear CACHE_MODE prior to clearing residuals Chris Wilson
2021-01-16 23:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2021-01-17  0:40 ` [Intel-gfx] [PATCH] " Chris Wilson
2021-01-17  1:32 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/gt: Clear CACHE_MODE prior to clearing residuals (rev2) Patchwork
2021-01-17  9:30 ` [Intel-gfx] [PATCH] drm/i915/gt: Clear CACHE_MODE prior to clearing residuals Chris Wilson
2021-01-18  5:12   ` Abodunrin, Akeem G
2021-01-17 10:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Clear CACHE_MODE prior to clearing residuals (rev3) Patchwork
2021-01-17 15:15 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).