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 <[email protected]>
Signed-off-by: Andrzej Hajda <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
if (!i915_mmio_reg_offset(rb.reg))
continue;
+ if (GRAPHICS_VER(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
+ engine->class == VIDEO_ENHANCEMENT_CLASS ||
+ engine->class == COMPUTE_CLASS))
+ rb.bit = _MASKED_BIT_ENABLE(rb.bit);
+
intel_uncore_write_fw(uncore, rb.reg, rb.bit);
awake |= engine->mask;
}