[SRU OEM-5.14 2/2] drm/i915: fix TLB invalidation for Gen12 video and compute engines
Cengiz Can
cengiz.can at canonical.com
Mon Jan 16 19:23:52 UTC 2023
From: Andrzej Hajda <andrzej.hajda at intel.com>
commit 04aa64375f48a5d430b5550d9271f8428883e550 upstream.
In case of Gen12 video and compute engines, TLB_INV registers are masked -
to modify one bit, corresponding bit in upper half of the register must
be enabled, otherwise nothing happens.
CVE: CVE-2022-4139
Suggested-by: Chris Wilson <chris.p.wilson at intel.com>
Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Cc: stable at vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
CVE-2022-4139
(cherry picked from commit 86f0082fb9470904b15546726417f28077088fee linux-5.10.y)
Signed-off-by: Cengiz Can <cengiz.can at canonical.com>
---
drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 59d36fff08ab..e1e15982a413 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -788,6 +788,10 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
if (!i915_mmio_reg_offset(rb.reg))
continue;
+ if (INTEL_GEN(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
+ engine->class == VIDEO_ENHANCEMENT_CLASS))
+ rb.bit = _MASKED_BIT_ENABLE(rb.bit);
+
intel_uncore_write_fw(uncore, rb.reg, rb.bit);
}
--
2.37.2
More information about the kernel-team
mailing list