From: Matthew Brost <matthew.brost@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: intel-xe@lists.freedesktop.org,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/xe/userptr: Drop bogus static from finish in force_invalidate
Date: Fri, 26 Jun 2026 02:16:25 -0700 [thread overview]
Message-ID: <aj5DaeJmRViA260Y@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260625224452.3243231-1-shuicheng.lin@intel.com>
On Thu, Jun 25, 2026 at 10:44:52PM +0000, Shuicheng Lin wrote:
> The local "finish" pointer in xe_vma_userptr_force_invalidate() is
> unconditionally written before each read, so the static storage class
> serves no purpose. Worse, it makes the variable a process-wide shared
> slot: the function's per-VM asserts do not exclude concurrent callers
> on different VMs, so two such callers can race on the slot and take
> the wrong if (finish) branch.
>
> The function is gated by CONFIG_DRM_XE_USERPTR_INVAL_INJECT
> (developer/test option, default n), so production builds are
> unaffected.
>
> Drop the static.
>
> Fixes: 18c4e536959e ("drm/xe/userptr: Convert invalidation to two-pass MMU notifier")
> Assisted-by: Claude:claude-opus-4.7
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
> ---
> drivers/gpu/drm/xe/xe_userptr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_userptr.c b/drivers/gpu/drm/xe/xe_userptr.c
> index 6761005c0b90..6f71bc66b14e 100644
> --- a/drivers/gpu/drm/xe/xe_userptr.c
> +++ b/drivers/gpu/drm/xe/xe_userptr.c
> @@ -269,7 +269,7 @@ static const struct mmu_interval_notifier_ops vma_userptr_notifier_ops = {
> */
> void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
> {
> - static struct mmu_interval_notifier_finish *finish;
> + struct mmu_interval_notifier_finish *finish;
> struct xe_vm *vm = xe_vma_vm(&uvma->vma);
>
> /* Protect against concurrent userptr pinning */
> --
> 2.43.0
>
prev parent reply other threads:[~2026-06-26 9:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 22:44 [PATCH] drm/xe/userptr: Drop bogus static from finish in force_invalidate Shuicheng Lin
2026-06-25 22:52 ` ✓ CI.KUnit: success for " Patchwork
2026-06-25 23:01 ` [PATCH] " Bai, Zongyao
2026-06-25 23:26 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-06-26 4:06 ` ✗ Xe.CI.FULL: " Patchwork
2026-06-26 9:16 ` Matthew Brost [this message]
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=aj5DaeJmRViA260Y@gsse-cloud1.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=shuicheng.lin@intel.com \
--cc=thomas.hellstrom@linux.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.