From: Matthew Brost <matthew.brost@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: "Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
stable@vger.kernel.org
Subject: [PATCH] drm/xe: Restrict user fences to long running VMs
Date: Mon, 3 Jun 2024 10:53:12 -0700 [thread overview]
Message-ID: <20240603175312.1915763-1-matthew.brost@intel.com> (raw)
User fences are intended to be used on long running VMs, enforce this
restriction. This addresses possible concerns of using user fences in
dma-fence and having the dma-fence signal before the user fence.
Fixes: d1df9bfbf68c ("drm/xe: Only allow 1 ufence per exec / bind IOCTL")
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_exec.c | 3 ++-
drivers/gpu/drm/xe/xe_vm.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index 97eeb973e897..a145813ad229 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -168,7 +168,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
num_ufence++;
}
- if (XE_IOCTL_DBG(xe, num_ufence > 1)) {
+ if (XE_IOCTL_DBG(xe, num_ufence > 1) ||
+ XE_IOCTL_DBG(xe, num_ufence && !xe_vm_in_lr_mode(vm))) {
err = -EINVAL;
goto err_syncs;
}
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 26b409e1b0f0..85da3a8a83b6 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -3226,7 +3226,8 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
num_ufence++;
}
- if (XE_IOCTL_DBG(xe, num_ufence > 1)) {
+ if (XE_IOCTL_DBG(xe, num_ufence > 1) ||
+ XE_IOCTL_DBG(xe, num_ufence && !xe_vm_in_lr_mode(vm))) {
err = -EINVAL;
goto free_syncs;
}
--
2.34.1
next reply other threads:[~2024-06-03 17:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 17:53 Matthew Brost [this message]
2024-06-03 20:42 ` [PATCH] drm/xe: Restrict user fences to long running VMs Thomas Hellström
2024-06-03 22:18 ` Matthew Brost
2024-06-04 19:38 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-04 19:39 ` ✓ CI.checkpatch: " Patchwork
2024-06-04 19:39 ` ✓ CI.KUnit: " Patchwork
2024-06-04 19:51 ` ✓ CI.Build: " Patchwork
2024-06-04 19:51 ` ✗ CI.Hooks: failure " Patchwork
2024-06-04 19:53 ` ✓ CI.checksparse: success " Patchwork
2024-06-04 20:21 ` ✗ CI.BAT: failure " Patchwork
2024-06-05 1:19 ` ✗ CI.FULL: " Patchwork
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=20240603175312.1915763-1-matthew.brost@intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox