[PATCH i-g-t 2/2] tests/intel/xe_exec_fault_mode: Extend invalid va test

Kumar, Janga Rahul janga.rahul.kumar at intel.com
Thu Mar 21 08:44:04 UTC 2024



> -----Original Message-----
> From: Dandamudi, Priyanka <priyanka.dandamudi at intel.com>
> Sent: Thursday, March 21, 2024 11:22 AM
> To: Dandamudi, Priyanka <priyanka.dandamudi at intel.com>; Bommu, Krishnaiah
> <krishnaiah.bommu at intel.com>; Kumar, Janga Rahul
> <janga.rahul.kumar at intel.com>; igt-dev at lists.freedesktop.org
> Subject: [PATCH i-g-t 2/2] tests/intel/xe_exec_fault_mode: Extend invalid va
> test
> 
> From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> 
> Extend invalid va test by enabling scratch page without pagefault and check for
> success of userfence.
> 
> v2: Rename flag NOPAGEFAULT to ENABLE_SCRATCH and add INVALID_VA to
> test.(Rahul)
> 
> Cc: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> Cc: Bommu Krishnaiah <krishnaiah.bommu at intel.com>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
LGTM,
Reviewed-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> ---
>  tests/intel/xe_exec_fault_mode.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/xe_exec_fault_mode.c
> b/tests/intel/xe_exec_fault_mode.c
> index 31a105d3c..b601eb23a 100644
> --- a/tests/intel/xe_exec_fault_mode.c
> +++ b/tests/intel/xe_exec_fault_mode.c
> @@ -32,12 +32,17 @@
>  #define PREFETCH	(0x1 << 5)
>  #define INVALID_FAULT	(0x1 << 6)
>  #define INVALID_VA	(0x1 << 7)
> +#define ENABLE_SCRATCH  (0x1 << 8)
> 
>  /**
>   * SUBTEST: invalid-va
>   * Description: Access invalid va and check for EIO through user fence.
>   * Test category: functionality test
>   *
> + * SUBTEST: invalid-va-scratch-nopagefault
> + * Description: Access invalid va without pageafault with scratch page enabled.
> + * Test category: functionality test
> + *
>   * SUBTEST: once-%s
>   * Description: Run %arg[1] fault mode test only once
>   * Test category: functionality test
> @@ -120,8 +125,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance
> *eci,
> 
>  	igt_assert(n_exec_queues <= MAX_N_EXEC_QUEUES);
> 
> -	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE |
> -			  DRM_XE_VM_CREATE_FLAG_FAULT_MODE, 0);
> +	if (flags & ENABLE_SCRATCH)
> +		vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE
> |
> +				  DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE,
> 0);
> +	else
> +		vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE
> |
> +				  DRM_XE_VM_CREATE_FLAG_FAULT_MODE,
> 0);
>  	bo_size = sizeof(*data) * n_execs;
>  	bo_size = xe_bb_size(fd, bo_size);
> 
> @@ -269,7 +278,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance
> *eci,
>  		j = flags & INVALIDATE ? n_execs - 1 : 0;
> 
>  		for (i = j; i < n_execs; i++) {
> -			if (flags & INVALID_VA)
> +			if (flags & INVALID_VA && !(flags & ENABLE_SCRATCH))
>  				igt_assert_eq(__xe_wait_ufence(fd,
> &data[i].exec_sync, USER_FENCE_VALUE,
>  							       exec_queues[i %
> n_exec_queues], &timeout), EIO);
>  			else
> @@ -384,6 +393,10 @@ igt_main
>  		xe_for_each_engine(fd, hwe)
>  			test_exec(fd, hwe, 1, 1, INVALID_VA);
> 
> +	igt_subtest("invalid-va-scratch-nopagefault")
> +		xe_for_each_engine(fd, hwe)
> +			test_exec(fd, hwe, 1, 1, ENABLE_SCRATCH |
> INVALID_VA);
> +
>  	igt_fixture {
>  		drm_close_driver(fd);
>  	}
> --
> 2.25.1



More information about the igt-dev mailing list