[Intel-xe] [PATCH] drm/xe: Invalidate media GT TLB for objects mapped by media GT

Matt Roper matthew.d.roper at intel.com
Tue Apr 11 00:27:59 UTC 2023


Xe is still lacking some general infrastructure to handle GGTT TLB
invalidation properly for platforms like MTL where multiple GTs share a
single GGTT.  As a temporary bandaid while that infrastructure is
missing, make xe_ggtt_map_bo invalidate on bo->gt rather than ggtt->gt.
This allows MTL's driver initialization to make some forward progress
since using ggtt->gt (which is always the primary GT) results in driver
timeouts while setting up the HWSP for hardware engines on the media GT.

A proper solution here will likely involve invalidating the TLBs of both
GTs rather than just one (gitlab issue #220); this is just a temporary
hack for now to help unblock other MTL-related driver work.

Reference: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/220
Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/xe/xe_ggtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index 0ae373b604f6..11461c02a831 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -271,7 +271,13 @@ void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
 		xe_ggtt_set_pte(ggtt, start + offset, pte);
 	}
 
-	xe_ggtt_invalidate(ggtt->gt);
+	/*
+	 * FIXME:  Multiple GTs can share a single GGTT on platforms like
+	 * MTL, so simply invalidating a single GT's TLB isn't really correct.
+	 * We really need more extensive changes to invalidate all appropriate
+	 * GTs rather than just one.
+	 */
+	xe_ggtt_invalidate(bo->gt);
 }
 
 static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo,
-- 
2.39.2



More information about the Intel-xe mailing list