All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/madvise: use already clamped pat_index
@ 2026-10-15 10:34 Matthew Auld
  2026-10-15 10:44 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Auld @ 2026-10-15 10:34 UTC (permalink / raw)
  To: intel-xe; +Cc: Sashiko, Alan Previn, Tejas Upadhyay

Pass the nospec-clamped pat_index to check_pat_args_are_sane() instead
of the raw args->pat_index.val, and fold into the preceding
DRM_XE_MEM_RANGE_ATTR_PAT block.

Assisted-by: LLM
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/message/sashiko-outbox-172627%40kernel.org
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 drivers/gpu/drm/xe/xe_vm_madvise.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c b/drivers/gpu/drm/xe/xe_vm_madvise.c
index 5c7aefc641ee..a835cc55658f 100644
--- a/drivers/gpu/drm/xe/xe_vm_madvise.c
+++ b/drivers/gpu/drm/xe/xe_vm_madvise.c
@@ -659,11 +659,8 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
 			err = -EINVAL;
 			goto free_vmas;
 		}
-	}
 
-	if (args->type == DRM_XE_MEM_RANGE_ATTR_PAT) {
-		if (!check_pat_args_are_sane(xe, &madvise_range,
-					     args->pat_index.val)) {
+		if (!check_pat_args_are_sane(xe, &madvise_range, pat_index)) {
 			err = -EINVAL;
 			goto free_vmas;
 		}
-- 
2.56.0


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

end of thread, other threads:[~2026-10-15 17:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 10:34 [PATCH] drm/xe/madvise: use already clamped pat_index Matthew Auld
2026-10-15 10:44 ` ✓ CI.KUnit: success for " Patchwork
2026-10-15 13:36 ` [PATCH] " Matthew Brost
2026-10-15 16:48 ` Upadhyay, Tejas
2026-10-15 17:45 ` ✓ Xe.CI.BAT: success for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.