* [PATCH] drm/xe/query: fix gt_id bounds check
@ 2024-03-21 11:06 Matthew Auld
2024-03-21 11:20 ` Ghimiray, Himal Prasad
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Auld @ 2024-03-21 11:06 UTC (permalink / raw)
To: intel-xe; +Cc: Nirmoy Das, stable
The user provided gt_id should always be less than the
XE_MAX_GT_PER_TILE.
Fixes: 7793d00d1bf5 ("drm/xe: Correlate engine and cpu timestamps with better accuracy")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
---
drivers/gpu/drm/xe/xe_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index fcd8680d2ccc..df407d73e5f5 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -133,7 +133,7 @@ query_engine_cycles(struct xe_device *xe,
return -EINVAL;
eci = &resp.eci;
- if (eci->gt_id > XE_MAX_GT_PER_TILE)
+ if (eci->gt_id >= XE_MAX_GT_PER_TILE)
return -EINVAL;
gt = xe_device_get_gt(xe, eci->gt_id);
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/xe/query: fix gt_id bounds check
2024-03-21 11:06 [PATCH] drm/xe/query: fix gt_id bounds check Matthew Auld
@ 2024-03-21 11:20 ` Ghimiray, Himal Prasad
0 siblings, 0 replies; 2+ messages in thread
From: Ghimiray, Himal Prasad @ 2024-03-21 11:20 UTC (permalink / raw)
To: Auld, Matthew, intel-xe@lists.freedesktop.org
Cc: Das, Nirmoy, stable@vger.kernel.org
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of
> Matthew Auld
> Sent: 21 March 2024 16:37
> To: intel-xe@lists.freedesktop.org
> Cc: Das, Nirmoy <nirmoy.das@intel.com>; stable@vger.kernel.org
> Subject: [PATCH] drm/xe/query: fix gt_id bounds check
>
> The user provided gt_id should always be less than the
> XE_MAX_GT_PER_TILE.
>
> Fixes: 7793d00d1bf5 ("drm/xe: Correlate engine and cpu timestamps with
> better accuracy")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Cc: <stable@vger.kernel.org> # v6.8+
> ---
> drivers/gpu/drm/xe/xe_query.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_query.c
> b/drivers/gpu/drm/xe/xe_query.c index fcd8680d2ccc..df407d73e5f5 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -133,7 +133,7 @@ query_engine_cycles(struct xe_device *xe,
> return -EINVAL;
>
> eci = &resp.eci;
> - if (eci->gt_id > XE_MAX_GT_PER_TILE)
> + if (eci->gt_id >= XE_MAX_GT_PER_TILE)
Acked-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> return -EINVAL;
>
> gt = xe_device_get_gt(xe, eci->gt_id);
> --
> 2.44.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-21 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 11:06 [PATCH] drm/xe/query: fix gt_id bounds check Matthew Auld
2024-03-21 11:20 ` Ghimiray, Himal Prasad
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox