Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Do not allow scratch page on long running jobs
@ 2024-09-19 10:47 Nirmoy Das
  2024-09-19 11:34 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Nirmoy Das @ 2024-09-19 10:47 UTC (permalink / raw)
  To: intel-xe
  Cc: Nirmoy Das, Gwan-gyeong Mun, Maarten Lankhorst, Matthew Brost,
	Stuart Summers, Thomas Hellström, Joonas Lahtinen

This was agreed upon but not enforced, so enforce the limitation
of not allowing scratch pages on long-running jobs unless absolutely
required, which is currently the case for a DG2 SKU.

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_vm.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index a3d7cb7cfd22..92dc55f3479b 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -1711,6 +1711,11 @@ find_ufence_get(struct xe_sync_entry *syncs, u32 num_syncs)
 	return NULL;
 }
 
+static bool xe_vm_device_requires_scratch_page(struct xe_device *xe)
+{
+	return XE_WA(xe_root_mmio_gt(xe), 14016763929);
+}
+
 #define ALL_DRM_XE_VM_CREATE_FLAGS (DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE | \
 				    DRM_XE_VM_CREATE_FLAG_LR_MODE | \
 				    DRM_XE_VM_CREATE_FLAG_FAULT_MODE)
@@ -1730,7 +1735,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
 	if (XE_IOCTL_DBG(xe, args->extensions))
 		return -EINVAL;
 
-	if (XE_WA(xe_root_mmio_gt(xe), 14016763929))
+	if (xe_vm_device_requires_scratch_page(xe))
 		args->flags |= DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE;
 
 	if (XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE &&
@@ -1747,6 +1752,15 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
 			 args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
 		return -EINVAL;
 
+	/*
+	 * Scratch page is disabled for long running job unless absolutely
+	 * required as this can introduce hidden bugs.
+	 */
+	if (!xe_vm_device_requires_scratch_page(xe) &&
+	    XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE &&
+			 (args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE)))
+		return -EINVAL;
+
 	if (XE_IOCTL_DBG(xe, !(args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE) &&
 			 args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
 		return -EINVAL;
-- 
2.46.0


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

end of thread, other threads:[~2024-11-06 22:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 10:47 [PATCH] drm/xe: Do not allow scratch page on long running jobs Nirmoy Das
2024-09-19 11:34 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-19 11:35 ` ✓ CI.checkpatch: " Patchwork
2024-09-19 11:36 ` ✓ CI.KUnit: " Patchwork
2024-09-19 12:22 ` ✓ CI.Build: " Patchwork
2024-09-19 12:24 ` ✓ CI.Hooks: " Patchwork
2024-09-19 12:26 ` ✓ CI.checksparse: " Patchwork
2024-09-19 12:58 ` ✓ CI.BAT: " Patchwork
2024-09-19 15:52 ` [PATCH] " Matthew Brost
2024-09-20  9:14   ` Nirmoy Das
2024-11-06 22:45   ` Lucas De Marchi
2024-09-19 19:27 ` ✗ CI.FULL: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox