]> Gentwo Git Trees - linux/.git/commit
drm/xe: Assign ioctl xe file handler to vm in xe_vm_create
authorPiotr Piórkowski <piotr.piorkowski@intel.com>
Mon, 11 Aug 2025 10:43:57 +0000 (12:43 +0200)
committerMichał Winiarski <michal.winiarski@intel.com>
Tue, 12 Aug 2025 11:03:36 +0000 (13:03 +0200)
commit9337166fa1d80f7bb7c7d3a8f901f21c348c0f2a
treea85d5ed0820b6d08359eda1e14004c7427a09ad0
parent17593a69b75f098280ad88b625f2d8c5bfe4c6a1
drm/xe: Assign ioctl xe file handler to vm in xe_vm_create

In several code paths, such as xe_pt_create(), the vm->xef field is used
to determine whether a VM originates from userspace or the kernel.

Previously, this handler was only assigned in xe_vm_create_ioctl(),
after the VM was created by xe_vm_create(). However, xe_vm_create()
triggers page table creation, and that function assumes vm->xef should
be already set. This could lead to incorrect origin detection.

To fix this problem and ensure consistency in the initialization of
the VM object, let's move the assignment of this handler to
xe_vm_create.

v2:
 - take reference to the xe file object only when xef is not NULL
 - release the reference to the xe file object on the error path (Matthew)

Fixes: 7f387e6012b6 ("drm/xe: add XE_BO_FLAG_PINNED_LATE_RESTORE")
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20250811104358.2064150-2-piotr.piorkowski@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
drivers/gpu/drm/xe/xe_migrate.c
drivers/gpu/drm/xe/xe_pxp_submit.c
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm.h