From: sashiko-bot@kernel.org
To: tilak.tirumalesh.tangudu@intel.com
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/xe/ggtt: invalidate engine GGTT TLBs for multi-queue GTs
Date: Fri, 21 Aug 2026 07:56:46 +0000 [thread overview]
Message-ID: <20260821075647.6218E1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260821074238.3000501-4-tilak.tirumalesh.tangudu@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Engine TLB invalidation is incorrectly gated on a mutable software configuration flag, leading to stale TLBs and memory corruption when multi-queue scheduling is disabled.
--
--- Patch [3]: [PATCH 3/3] drm/xe/ggtt: invalidate engine GGTT TLBs for multi-queue GTs ---
commit 1bb3febf0df767bbdf46eda5e034dfd13af1e727
Author: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>
drm/xe/ggtt: invalidate engine GGTT TLBs for multi-queue GTs
This commit introduces an engine TLB invalidation on GGTT unmap to ensure
that engines do not hit stale cached translations after the memory is freed.
The invalidation logic is gated on the GT having a multi-queue engine
class mask enabled.
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index 3564345fd7403..60eb9a3d29cc2 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
[ ... ]
> @@ -603,6 +607,23 @@ static void xe_ggtt_invalidate(struct xe_ggtt *ggtt)
> ggtt_invalidate_gt_tlb(ggtt->tile->media_gt);
> }
>
> +/*
> + * Drain engine-side GGTT TLBs on teardown so a recycled range's next
> + * occupant can't hit a predecessor's cached translation.
> + */
> +static void xe_ggtt_invalidate_engine(struct xe_ggtt *ggtt)
> +{
> + struct xe_gt *gt = ggtt->tile->primary_gt;
> + int err;
> +
> + if (!gt || !gt->info.multi_queue_engine_class_mask)
> + return;
[Severity: High]
Does this skip necessary hardware invalidation if the multi-queue scheduling
feature is disabled in software?
If a privileged user disables the multi-queue feature via configfs,
gt->info.multi_queue_engine_class_mask is cleared to 0. However, the hardware
physical capability of having independent engine TLBs does not disappear when
this software feature is disabled.
When the mask is cleared, xe_ggtt_invalidate_engine() will silently skip
the engine TLB invalidation on GGTT unmap, leaving the independent engine
TLBs unflushed and potentially causing data corruption or a use-after-free
when a recycled range is accessed. (Also note that in ggtt_node_remove(),
the unmap path falls back to writing a scratch PTE when this mask is 0,
which does not prevent engines from using their still-valid, stale TLB
entries.)
Should this check use an immutable hardware capability flag instead of the
active software configuration mask?
> +
> + err = xe_tlb_inval_ggtt_full(>->tlb_inval);
> + xe_gt_WARN(gt, err, "Failed to invalidate engine GGTT TLBs (%pe)",
> + ERR_PTR(err));
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260821074238.3000501-1-tilak.tirumalesh.tangudu@intel.com?part=3
next prev parent reply other threads:[~2026-08-21 7:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 7:42 [PATCH 0/3] drm/xe/ggtt: fix stale GGTT mappings on unmap tilak.tirumalesh.tangudu
2026-08-21 7:42 ` [PATCH 1/3] drm/xe/ggtt: stop mapping unmapped GGTT pages to scratch tilak.tirumalesh.tangudu
2026-08-24 0:32 ` Niranjana Vishwanathapura
2026-08-21 7:42 ` [PATCH 2/3] drm/xe/tlb_inval: add FULL_INTRA_VF GGTT invalidation helper tilak.tirumalesh.tangudu
2026-08-24 0:41 ` Niranjana Vishwanathapura
2026-08-24 10:03 ` Tangudu, Tilak Tirumalesh
2026-08-24 0:59 ` Niranjana Vishwanathapura
2026-08-21 7:42 ` [PATCH 3/3] drm/xe/ggtt: invalidate engine GGTT TLBs for multi-queue GTs tilak.tirumalesh.tangudu
2026-08-21 7:56 ` sashiko-bot [this message]
2026-08-24 0:56 ` Niranjana Vishwanathapura
2026-08-21 7:54 ` ✓ CI.KUnit: success for drm/xe/ggtt: fix stale GGTT mappings on unmap Patchwork
2026-08-21 8:49 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-21 9:38 ` ✓ Xe.CI.FULL: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-08-24 16:34 [PATCH 0/3] " tilak.tirumalesh.tangudu
2026-08-24 16:34 ` [PATCH 3/3] drm/xe/ggtt: invalidate engine GGTT TLBs for multi-queue GTs tilak.tirumalesh.tangudu
2026-08-24 16:48 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260821075647.6218E1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tilak.tirumalesh.tangudu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.