Skip to contentSkip to conversation

tests/i915/query: Test invalid TOPO_INFO flags

PATCH In review Stuart Summers 2 participants 3 messages Jun 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/i915/query: Test invalid TOPO_INFO flags

Current tests only check for invalid flags in the i915_query_ioctl itself. A user might add invalid flags in the actual TOPO_INFO data, though, so adding a test cast to confirm the kernel appropriately rejects this.

---
 tests/i915/i915_query.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
tests/i915/i915_query.c +20 -2
index ecbec3ae..8a84d867 100644
@@ -33,6 +33,8 @@ IGT_TEST_DESCRIPTION("Testing the i915 query uAPI.");
  */
 #define MIN_TOPOLOGY_ITEM_SIZE (sizeof(struct drm_i915_query_topology_info) + 3)
 
+#define INVALID_FLAGS 42
+
 static int
 __i915_query(int fd, struct drm_i915_query *q)
 {
@@ -80,7 +82,7 @@ static void test_query_garbage(int fd)
 	 * change in the future.
 	 */
 	memset(&query, 0, sizeof(query));
-	query.flags = 42;
+	query.flags = INVALID_FLAGS;
 	igt_assert_eq(__i915_query(fd, &query), -EINVAL);
 
 	/* Test a couple of invalid pointers. */
@@ -96,6 +98,7 @@ static void test_query_garbage_items(int fd)
 {
 	struct drm_i915_query_item items[2];
 	struct drm_i915_query_item *items_ptr;
+	struct drm_i915_query_topology_info *topo_info;
 	int i, n_items;
 
 	/*
@@ -104,9 +107,24 @@ static void test_query_garbage_items(int fd)
 	 */
 	memset(items, 0, sizeof(items));
 	items[0].query_id = DRM_I915_QUERY_TOPOLOGY_INFO;
-	items[0].flags = 42;
+	items[0].flags = INVALID_FLAGS;
+	i915_query_items(fd, items, 1);
+	igt_assert_eq(items[0].length, -EINVAL);
+
+	/*
+	 * Currently no TopologyInfo item flags are valid.
+	 * Subject to change in the future.
+	 */
+	memset(items, 0, sizeof(items));
+	items[0].query_id = DRM_I915_QUERY_TOPOLOGY_INFO;
+	items[0].flags = 0;
+	i915_query_items(fd, items, 1);
+	topo_info = calloc(1, items[0].length);
+	topo_info->flags = INVALID_FLAGS;
+	items[0].data_ptr = to_user_pointer(topo_info);
 	i915_query_items(fd, items, 1);
 	igt_assert_eq(items[0].length, -EINVAL);
+	free(topo_info);
 
 	/*
 	 * Test an invalid query id in the second item and verify that the first
Signature · 6 lines
2.21.0.5.gaeb582a983

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/query: Test invalid TOPO_INFO flags

== Series Details ==

== Series Details ==

Series: tests/i915/query: Test invalid TOPO_INFO flags
URL : https://patchwork.freedesktop.org/series/62552/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6327 -> IGTPW_3188
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_3188 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_3188, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/62552/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_3188:

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- fi-gdg-551: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3188/fi-gdg-551/igt@[email protected]

Participating hosts (50 -> 43)
------------------------------

Additional (1): fi-gdg-551
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* IGT: IGT_5064 -> IGTPW_3188

CI_DRM_6327: d2ee3427319b7e89e9ab49c8e4b714789b611dfe @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3188: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3188/
IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

#2 lore raw

Re: [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/query: Test invalid TOPO_INFO flags

Quoted 35 lines · Patchwork

== Series Details ==

Series: tests/i915/query: Test invalid TOPO_INFO flags
URL : https://patchwork.freedesktop.org/series/62552/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6327 -> IGTPW_3188
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_3188 absolutely need to
be
verified manually.

If you think the reported changes have nothing to do with the
changes
introduced in IGTPW_3188, please notify your bug team to allow them to document this new failure mode, which will reduce false
positives in CI.

External URL:
https://patchwork.freedesktop.org/api/1.0/series/62552/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in
IGTPW_3188:

Quoted 8 lines

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- fi-gdg-551: NOTRUN -> [FAIL][1]
[1]:
https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3188/fi-gdg-551/igt@[email protected]

Seems like something new/unrelated?

<7>[   80.892026] [drm:vgem_gem_dumb_create [vgem]] Created object of
size 1
<1>[   80.892056] BUG: kernel NULL pointer dereference, address:

0000000000000000

Thanks,
Stuart

Quoted 23 lines

Participating hosts (50 -> 43)
------------------------------

Additional (1): fi-gdg-551
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-
squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* IGT: IGT_5064 -> IGTPW_3188

CI_DRM_6327: d2ee3427319b7e89e9ab49c8e4b714789b611dfe @
git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3188: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3188/
IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

Quoted 4 lines

== Logs ==

For more details see:
https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3188/

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev