Skip to contentSkip to conversation

igt/gem_exec_fence: Add subtest for invalid flags

PATCH In review Tvrtko Ursulin 3 participants 4 messages Nov 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igt/gem_exec_fence: Add subtest for invalid flags

From: Tvrtko Ursulin <[email protected]>

We need to check that the kernel rejects attempts to pass in unknown flags.

---
 tests/gem_exec_fence.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
tests/gem_exec_fence.c +31 -0
index 2a6da8b074a6..6ee944ffadda 100644
@@ -1017,6 +1017,34 @@ static void test_syncobj_invalid_wait(int fd)
 	syncobj_destroy(fd, fence.handle);
 }
 
+static void test_syncobj_invalid_flags(int fd)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	struct drm_i915_gem_exec_object2 obj;
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct local_gem_exec_fence fence = {
+		.handle = syncobj_create(fd),
+	};
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(&obj);
+	execbuf.buffer_count = 1;
+	execbuf.flags = LOCAL_EXEC_FENCE_ARRAY;
+	execbuf.cliprects_ptr = to_user_pointer(&fence);
+	execbuf.num_cliprects = 1;
+
+	memset(&obj, 0, sizeof(obj));
+	obj.handle = gem_create(fd, 4096);
+	gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
+
+	/* set all flags to hit an invalid one */
+	fence.flags = ~0;
+	igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL);
+
+	gem_close(fd, obj.handle);
+	syncobj_destroy(fd, fence.handle);
+}
+
 static void test_syncobj_signal(int fd)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
@@ -1539,6 +1567,9 @@ igt_main
 		igt_subtest("syncobj-invalid-wait")
 			test_syncobj_invalid_wait(i915);
 
+		igt_subtest("syncobj-invalid-flags")
+			test_syncobj_invalid_flags(i915);
+
 		igt_subtest("syncobj-signal")
 			test_syncobj_signal(i915);
 
Signature · 6 lines
2.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw

Quoting Tvrtko Ursulin (2017-11-03 11:57:54)

Quoted 35 lines

From: Tvrtko Ursulin <[email protected]>

We need to check that the kernel rejects attempts to pass in unknown flags.

---
 tests/gem_exec_fence.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
tests/gem_exec_fence.c +16 -0
index 2a6da8b074a6..6ee944ffadda 100644
@@ -1017,6 +1017,34 @@ static void test_syncobj_invalid_wait(int fd)
        syncobj_destroy(fd, fence.handle);
 }
 
+static void test_syncobj_invalid_flags(int fd)
+{
+       const uint32_t bbe = MI_BATCH_BUFFER_END;
+       struct drm_i915_gem_exec_object2 obj;
+       struct drm_i915_gem_execbuffer2 execbuf;
+       struct local_gem_exec_fence fence = {
+               .handle = syncobj_create(fd),
+       };
+
+       memset(&execbuf, 0, sizeof(execbuf));
+       execbuf.buffers_ptr = to_user_pointer(&obj);
+       execbuf.buffer_count = 1;
+       execbuf.flags = LOCAL_EXEC_FENCE_ARRAY;
+       execbuf.cliprects_ptr = to_user_pointer(&fence);
+       execbuf.num_cliprects = 1;
+

tests/gem_exec_fence.c static void test_syncobj_invalid_wait(int fd) · line 1045

Quoted 10 lines
tests/gem_exec_fence.c +10 -0
+       memset(&obj, 0, sizeof(obj));
+       obj.handle = gem_create(fd, 4096);
+       gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
+
+       /* set all flags to hit an invalid one */
+       fence.flags = ~0;
+       igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL);
+
+       gem_close(fd, obj.handle);
+       syncobj_destroy(fd, fence.handle);

Ok. All suggestions I have here end up being kcov-afl.

This applies the rule that the execbuf is correct for all but the single invalid field,

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.BAT: success for igt/gem_exec_fence: Add subtest for invalid flags

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: igt/gem_exec_fence: Add subtest for invalid flags
URL : https://patchwork.freedesktop.org/series/33120/
State : success

== Summary ==

IGT patchset tested on top of latest successful build c8d1ea24d3bfaf11b223bbe22407aeca196d0d89 tests/debugfs_test: Pretty print subdirectories

with latest DRM-Tip kernel build CI_DRM_3311
2f945d948d05 drm-tip: 2017y-11m-03d-09h-28m-20s UTC integration manifest

Testlist changes:
+igt@gem_exec_fence@syncobj-invalid-flags

Test chamelium:

        Subgroup dp-crc-fast:
                incomplete -> PASS       (fi-kbl-7500u) fdo#102514

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:447s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:468s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:381s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:541s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:277s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:517s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:505s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:513s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:505s
fi-cfl-s         total:289  pass:254  dwarn:3   dfail:0   fail:0   skip:32  time:565s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:439s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:262s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:588s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:494s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:432s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:430s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:433s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:462s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:495s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:574s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:479s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:582s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:572s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:455s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:596s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:653s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:529s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:508s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:470s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:581s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:425s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_472/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✗ Fi.CI.IGT: warning for igt/gem_exec_fence: Add subtest for invalid flags

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: igt/gem_exec_fence: Add subtest for invalid flags
URL : https://patchwork.freedesktop.org/series/33120/
State : warning

== Summary ==

Test drv_suspend:

        Subgroup fence-restore-untiled-hibernate:
                dmesg-fail -> FAIL       (shard-hsw) fdo#103375
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-B:
                pass       -> DMESG-WARN (shard-hsw)

fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375

shard-hsw total:2539 pass:1432 dwarn:1 dfail:0 fail:9 skip:1097 time:9322s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_472/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx