drm/xe: Allow fault injection in exec queue IOCTLs
authorFrancois Dugast <francois.dugast@intel.com>
Wed, 5 Mar 2025 15:06:59 +0000 (16:06 +0100)
committerFrancois Dugast <francois.dugast@intel.com>
Thu, 6 Mar 2025 11:16:35 +0000 (12:16 +0100)
Use fault injection infrastructure to allow specific functions to
be configured over debugfs for failing during the execution of
xe_exec_queue_create_ioctl(). xe_exec_queue_destroy_ioctl() and
xe_exec_queue_get_property_ioctl() are not considered as there is
no unwinding code to test with fault injection.

This allows more thorough testing from user space by going through
code paths for error handling and unwinding which cannot be reached
by simply injecting errors in IOCTL arguments. This can help
increase code robustness.

The corresponding IGT series is:
https://patchwork.freedesktop.org/series/144138/

Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305150659.46276-1-francois.dugast@intel.com
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
drivers/gpu/drm/xe/xe_exec_queue.c
drivers/gpu/drm/xe/xe_hw_engine_group.c
drivers/gpu/drm/xe/xe_vm.c

index 7c5c003d3c408a1fd528f7f8aec03db44fbe225d..606922d9dd73028dc36c036cd9c109f4a94f8d44 100644 (file)
@@ -203,6 +203,7 @@ err_post_alloc:
        __xe_exec_queue_free(q);
        return ERR_PTR(err);
 }
+ALLOW_ERROR_INJECTION(xe_exec_queue_create, ERRNO);
 
 struct xe_exec_queue *xe_exec_queue_create_class(struct xe_device *xe, struct xe_gt *gt,
                                                 struct xe_vm *vm,
index 82750520a90a59a4e8cfb5897a25f2b31b703376..2d68c5b5262abf5bb085b5b87912b5fe23e2a214 100644 (file)
@@ -178,6 +178,7 @@ err_suspend:
        up_write(&group->mode_sem);
        return err;
 }
+ALLOW_ERROR_INJECTION(xe_hw_engine_group_add_exec_queue, ERRNO);
 
 /**
  * xe_hw_engine_group_del_exec_queue() - Delete an exec queue from a hw engine group
index 3dbd3d38008a5022202091c9c588e0e815badc51..338d98533fae3bacfce87199ab8078857a671d2c 100644 (file)
@@ -270,6 +270,7 @@ out_up_write:
 
        return err;
 }
+ALLOW_ERROR_INJECTION(xe_vm_add_compute_exec_queue, ERRNO);
 
 /**
  * xe_vm_remove_compute_exec_queue() - Remove compute exec queue from VM