Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Deny unbinds if user fence pending
@ 2024-02-15 16:40 Mika Kuoppala
  2024-02-15 16:40 ` [PATCH 1/2] drm/xe: Expose user fence from xe_sync_entry Mika Kuoppala
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Mika Kuoppala @ 2024-02-15 16:40 UTC (permalink / raw)
  To: intel-xe
  Cc: Mika Kuoppala, Thomas Hellström, Matthew Brost, Jani Nikula,
	Joonas Lahtinen

If we ever want to intercept OP_MAP through
user fence, we need to make sure that sequences
of OP_MAP and OP_UNMAP can be tracked without them
coalescing and thus vanishing.

Enforce vm_bind_ioctl by enforcing wait on associated
user fences on bind, before unbinding: If there is
non signalled user fence pending when the unmap is
attempted, deny it with -EBUSY.

[1] states that -EINVAL should be returned if
the ufence was part of the previous OP_MAP inside
this ioctl. This can be added if there is need to
distinguish these apart. This series returns -EBUSY 
regardless if the OP_MAP was part of this or previous
ioctl.

[1] https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1159

Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Mika Kuoppala (2):
  drm/xe: Expose user fence from xe_sync_entry
  drm/xe: Deny unbinds if uapi ufence pending

 drivers/gpu/drm/xe/xe_sync.c       | 56 +++++++++++++++++++++++++-----
 drivers/gpu/drm/xe/xe_sync.h       |  4 +++
 drivers/gpu/drm/xe/xe_sync_types.h |  2 +-
 drivers/gpu/drm/xe/xe_vm.c         | 35 +++++++++++++++++++
 drivers/gpu/drm/xe/xe_vm_types.h   |  7 ++++
 5 files changed, 94 insertions(+), 10 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH v2 0/2] Deny unbinds if user fence pending
@ 2024-02-15 18:11 Mika Kuoppala
  2024-02-15 18:11 ` [PATCH 2/2] drm/xe: Deny unbinds if uapi ufence pending Mika Kuoppala
  0 siblings, 1 reply; 13+ messages in thread
From: Mika Kuoppala @ 2024-02-15 18:11 UTC (permalink / raw)
  To: intel-xe
  Cc: Mika Kuoppala, Thomas Hellström, Matthew Brost, Jani Nikula,
	Joonas Lahtinen

If we ever want to intercept OP_MAP through
user fence, we need to make sure that sequences
of OP_MAP and OP_UNMAP can be tracked without them
coalescing and thus vanishing.

Enforce vm_bind_ioctl by enforcing wait on associated
user fences on bind, before unbinding: If there is
non signalled user fence pending when the unmap is
attempted, deny it with -EBUSY.

[1] states that -EINVAL should be returned if
the ufence was part of the previous OP_MAP inside
this ioctl. This can be added if there is need to
distinguish these apart. This series returns -EBUSY 
regardless if the OP_MAP was part of this or previous
ioctl.

[1] https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1159

Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Mika Kuoppala (2):
  drm/xe: Expose user fence from xe_sync_entry
  drm/xe: Deny unbinds if uapi ufence pending

 drivers/gpu/drm/xe/xe_sync.c       | 58 ++++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_sync.h       |  4 +++
 drivers/gpu/drm/xe/xe_sync_types.h |  2 +-
 drivers/gpu/drm/xe/xe_vm.c         | 37 +++++++++++++++++++
 drivers/gpu/drm/xe/xe_vm_types.h   |  7 ++++
 5 files changed, 97 insertions(+), 11 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2024-02-15 18:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 16:40 [PATCH 0/2] Deny unbinds if user fence pending Mika Kuoppala
2024-02-15 16:40 ` [PATCH 1/2] drm/xe: Expose user fence from xe_sync_entry Mika Kuoppala
2024-02-15 17:13   ` Matthew Brost
2024-02-15 16:40 ` [PATCH 2/2] drm/xe: Deny unbinds if uapi ufence pending Mika Kuoppala
2024-02-15 17:21   ` Matthew Brost
2024-02-15 16:48 ` ✓ CI.Patch_applied: success for Deny unbinds if user fence pending Patchwork
2024-02-15 16:49 ` ✗ CI.checkpatch: warning " Patchwork
2024-02-15 16:50 ` ✓ CI.KUnit: success " Patchwork
2024-02-15 17:00 ` ✓ CI.Build: " Patchwork
2024-02-15 17:00 ` ✓ CI.Hooks: " Patchwork
2024-02-15 17:02 ` ✓ CI.checksparse: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-02-15 18:11 [PATCH v2 0/2] " Mika Kuoppala
2024-02-15 18:11 ` [PATCH 2/2] drm/xe: Deny unbinds if uapi ufence pending Mika Kuoppala
2024-02-15 18:34   ` Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox