Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2 1/2] drm/i915/gtt: flush the scratch page
@ 2021-10-28  9:26 Matthew Auld
  2021-10-28  9:26 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/gtt: stop caching " Matthew Auld
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Matthew Auld @ 2021-10-28  9:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Thomas Hellström, Chris Wilson, Ramalingam C

The scratch page is directly visible in the users address space, and
while this is forced as CACHE_LLC, by the kernel, we still have to
contend with things like "Bypass-LLC" MOCS. So just flush no matter
what.

v2(Thomas):
  - Make sure we use drm_clflush_virt_range here, in case clflush support
    is missing.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gtt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c
index 67d14afa6623..efb51e881c5a 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
@@ -273,6 +273,7 @@ static void poison_scratch_page(struct drm_i915_gem_object *scratch)
 		val = POISON_FREE;
 
 	memset(vaddr, val, scratch->base.size);
+	drm_clflush_virt_range(vaddr, scratch->base.size);
 }
 
 int setup_scratch_page(struct i915_address_space *vm)
-- 
2.26.3


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

end of thread, other threads:[~2021-11-22  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-28  9:26 [Intel-gfx] [PATCH v2 1/2] drm/i915/gtt: flush the scratch page Matthew Auld
2021-10-28  9:26 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/gtt: stop caching " Matthew Auld
2021-11-22  9:43   ` Tvrtko Ursulin
2021-10-28 14:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915/gtt: flush " Patchwork
2021-10-28 18:56 ` [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