-----Original Message----- From: Brost, Matthew matthew.brost@intel.com Sent: Friday, December 19, 2025 4:41 AM To: Auld, Matthew matthew.auld@intel.com Cc: Lucas De Marchi lucas.demarchi@intel.com; intel- xe@lists.freedesktop.org; Thomas Hellström thomas.hellstrom@linux.intel.com; Souza, Jose jose.souza@intel.com; Mrozek, Michal michal.mrozek@intel.com; Zhang, Carl carl.zhang@intel.com; stable@vger.kernel.org Subject: Re: [PATCH v3 1/2] drm/xe/uapi: disallow bind queue sharing
On Mon, Nov 24, 2025 at 01:41:55PM +0000, Matthew Auld wrote:
On 20/11/2025 15:34, Lucas De Marchi wrote:
On Thu, Nov 20, 2025 at 01:27:29PM +0000, Matthew Auld wrote:
Currently this is very broken if someone attempts to create a bind queue and share it across multiple VMs. For example currently we assume it is safe to acquire the user VM lock to protect some of the bind queue state, but if allow sharing the bind queue with multiple VMs then this quickly breaks down.
To fix this reject using a bind queue with any VM that is not the same VM that was originally passed when creating the bind queue. This a uAPI change, however this was more of an oversight on kernel side that we didn't reject this, and expectation is that userspace shouldn't be using bind queues in this way, so in theory this
change should go unnoticed.
Based on a patch from Matt Brost.
v2 (Matt B): - Hold the vm lock over queue create, to ensure it can't be closed as we attach the user_vm to the queue. - Make sure we actually check for NULL user_vm in destruction path. v3: - Fix error path handling.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Reported-by: Thomas Hellström thomas.hellstrom@linux.intel.com Signed-off-by: Matthew Auld matthew.auld@intel.com Cc: José Roberto de Souza jose.souza@intel.com Cc: Matthew Brost matthew.brost@intel.com Cc: Michal Mrozek michal.mrozek@intel.com Cc: Carl Zhang carl.zhang@intel.com Cc: stable@vger.kernel.org # v6.8+
we never had any platform officially supported back in 6.8. Let's make it 6.12 to avoid useless backporting work.
Acked-by: José Roberto de Souza jose.souza@intel.com
Michal / Carl, can you also ack compute/media are ok with this change?
I am ok , current media driver only use default 0, did not create bind exec queue .
Ping on this? I did a cursory grep for DRM_XE_ENGINE_CLASS_VM_BIND and found no users in compute-runtime or media-driver in upstream. This change should only be noticeable if you directly use DRM_XE_ENGINE_CLASS_VM_BIND to create a dedicated bind queue, which
you then pass into vm_bind.
Yes, ping? It would be good to get this series in.
Matt
Lucas De Marchi
Thanks Carl