All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
@ 2020-03-02 17:33 Emil Velikov
  2020-03-02 18:52 ` [igt-dev] ✓ Fi.CI.BAT: success for ts/core_setmaster: new test for drop/set master semantics (rev3) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Emil Velikov @ 2020-03-02 17:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

From: Emil Velikov <emil.velikov@collabora.com>

This test adds three distinct subtests:
 - drop/set master as root
 - drop/set master as non-root
 - drop/set master for a shared fd

Currently the second subtest will fail, with kernel patch to address
that has been submitted.

v2: Add to the autotools build
v3:
 - Add igt_describe()
 - Use igt_fixture() for tweak_perm
 - Enhance comments

Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 tests/Makefile.sources |   1 +
 tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build      |   1 +
 3 files changed, 208 insertions(+)
 create mode 100644 tests/core_setmaster.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index b87d6333..5da36a91 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -18,6 +18,7 @@ TESTS_progs = \
 	core_getclient \
 	core_getstats \
 	core_getversion \
+	core_setmaster \
 	core_setmaster_vs_auth \
 	debugfs_test \
 	dmabuf \
diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
new file mode 100644
index 00000000..58ed9771
--- /dev/null
+++ b/tests/core_setmaster.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright © 2020 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Emil Velikov <emil.l.velikov@gmail.com>
+ *
+ */
+
+/*
+ * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
+ *
+ * Test checks if the ioctls succeed or fail, depending if the applications was
+ * run with root, user privileges or if we have separate privileged arbitrator.
+ */
+
+#include "igt.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+
+IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
+		     " access");
+
+static bool is_master(int fd)
+{
+	/* FIXME: replace with drmIsMaster once we bumped libdrm version */
+	return drmAuthMagic(fd, 0) != -EACCES;
+}
+
+static void check_drop_set(void)
+{
+	int master;
+
+	master = __drm_open_driver(DRIVER_ANY);
+
+	/* Ensure we have a valid device. This is _extremely_ unlikely to
+	 * trigger as tweak_perm() aims to ensure we have the correct rights.
+	 * Although:
+	 * - according to the manual igt_drop_root() + igt_skip() is broken
+	 * - there is _no_ guarantee that we'll open a device handled by
+	 * tweak_perm()
+	 * - having a device is integral part of the test
+	 */
+	igt_assert_neq(master, -1);
+
+	/* At this point we're master capable due to:
+	 * - being root - always
+	 * - normal user - as the only drm only drm client (on this VT)
+	 */
+	igt_assert_eq(is_master(master), true);
+
+	/* If we have SYS_CAP_ADMIN we're in the textbook best-case scenario.
+	 *
+	 * Otherwise newer kernels allow the application to drop/revoke its
+	 * master capability and request it again later.
+	 *
+	 * In this case, we address two types of issues:
+	 * - the application no longer need suid-root (or equivalent) which
+	 * was otherwise required _solely_ for these two ioctls
+	 * - plenty of applications ignore (or discard) the result of the
+	 * calls all together.
+	 */
+	igt_assert_eq(drmDropMaster(master), 0);
+	igt_assert_eq(drmSetMaster(master), 0);
+
+	close(master);
+}
+
+static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save)
+{
+	char path[256];
+	struct stat st;
+	unsigned i;
+
+	for (i = 0; i < max_perm; i++) {
+		snprintf(path, sizeof(path), "/dev/dri/card%u", i);
+
+		/* Existing userspace assumes there's no gaps, do the same. */
+		if (stat(path, &st) != 0)
+			break;
+
+		if (save) {
+			/* Save and toggle */
+			saved_perm[i] = st.st_mode & (S_IROTH | S_IWOTH);
+			st.st_mode |= S_IROTH | S_IWOTH;
+		} else {
+			/* Clear and restore */
+			st.st_mode &= ~(S_IROTH | S_IWOTH);
+			st.st_mode |= saved_perm[i];
+		}
+
+		/* There's only one way for chmod to fail - race vs rmmod.
+		 * In that case, do _not_ error/skip, since:
+		 * - we need to restore the [correct] permissions
+		 * - __drm_open_driver() can open earlier device, aka the
+		 * failure may be irrelevant.
+		 */
+		chmod(path, st.st_mode);
+	}
+	return i;
+}
+
+
+igt_main
+{
+	igt_describe("Ensure that root can Set/DropMaster");
+	igt_subtest("master-drop-set-root") {
+		check_drop_set();
+	}
+
+
+	igt_subtest_group {
+		uint8_t saved_perm[255];
+		unsigned num;
+
+		/* Upon dropping root we end up as random user, which
+		 * a) is not in the video group, and
+		 * b) lacks ACL (set via logind or otherwise), thus
+		 * any open() fill fail.
+		 *
+		 * As such, save the state of original other rw permissions
+		 * and toggle them on.
+		 */
+
+		/* Note: we use a fixture to ensure the permissions are
+		 * restored on skip or failure.
+		 */
+		igt_fixture {
+			num = tweak_perm(saved_perm, ARRAY_SIZE(saved_perm),
+					 true);
+		}
+
+		igt_describe("Ensure first normal user can Set/DropMaster");
+		igt_subtest("master-drop-set-user") {
+			igt_fork(child, 1) {
+				igt_drop_root();
+				check_drop_set();
+			}
+			igt_waitchildren();
+		}
+
+		/* Restore the original permissions */
+		igt_fixture {
+			tweak_perm(saved_perm, num, false);
+		}
+	}
+
+	igt_describe("Check the Set/DropMaster behaviour on shared fd");
+	igt_subtest("master-drop-set-shared-fd") {
+		int master;
+
+		master = __drm_open_driver(DRIVER_ANY);
+
+		/* Double-check if open has failed */
+		igt_assert_neq(master, -1);
+
+		igt_assert_eq(is_master(master), true);
+		igt_fork(child, 1) {
+			igt_drop_root();
+
+			/* Dropping root privileges should not alter the
+			 * master capability of the fd */
+			igt_assert_eq(is_master(master), true);
+
+			/* Even though we've got the master capable fd, we're
+			 * a different process (kernel struct pid *) than the
+			 * one which opened the device node.
+			 *
+			 * This ensures that existing workcases of separate
+			 * (privileged) arbitrator still work. For example:
+			 * - logind + X/Wayland compositor
+			 * - weston-launch + weston
+			 */
+			igt_assert_eq(drmDropMaster(master), -1);
+			igt_assert_eq(errno, EACCES);
+			igt_assert_eq(drmSetMaster(master), -1);
+			igt_assert_eq(errno, EACCES);
+
+			close(master);
+		}
+		igt_waitchildren();
+
+		close(master);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index fa0103e3..d8fb9f3e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -3,6 +3,7 @@ test_progs = [
 	'core_getclient',
 	'core_getstats',
 	'core_getversion',
+	'core_setmaster',
 	'core_setmaster_vs_auth',
 	'debugfs_test',
 	'dmabuf',
-- 
2.25.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for ts/core_setmaster: new test for drop/set master semantics (rev3)
  2020-03-02 17:33 [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Emil Velikov
@ 2020-03-02 18:52 ` Patchwork
  2020-03-03  8:03 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2020-03-02 18:52 UTC (permalink / raw)
  To: Emil Velikov; +Cc: igt-dev

== Series Details ==

Series: ts/core_setmaster: new test for drop/set master semantics (rev3)
URL   : https://patchwork.freedesktop.org/series/73650/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8046 -> IGTPW_4245
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html

Known issues
------------

  Here are the changes found in IGTPW_4245 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-skl-6600u:       [PASS][1] -> [INCOMPLETE][2] ([i915#146] / [i915#69])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-skl-6600u/igt@gem_exec_suspend@basic-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-skl-6600u/igt@gem_exec_suspend@basic-s3.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       [PASS][3] -> [DMESG-WARN][4] ([i915#44])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html

  * igt@prime_vgem@basic-gtt:
    - fi-tgl-y:           [PASS][5] -> [DMESG-WARN][6] ([CI#94] / [i915#402]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-tgl-y/igt@prime_vgem@basic-gtt.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-tgl-y/igt@prime_vgem@basic-gtt.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-tgl-y:           [FAIL][7] ([CI#94]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html

  * igt@kms_addfb_basic@addfb25-modifier-no-flag:
    - fi-tgl-y:           [DMESG-WARN][9] ([CI#94] / [i915#402]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-tgl-y/igt@kms_addfb_basic@addfb25-modifier-no-flag.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-tgl-y/igt@kms_addfb_basic@addfb25-modifier-no-flag.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][11] ([fdo#111096] / [i915#323]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Warnings ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-kbl-guc:         [FAIL][13] ([i915#704]) -> [SKIP][14] ([fdo#109271])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/fi-kbl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/fi-kbl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html

  
  [CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#44]: https://gitlab.freedesktop.org/drm/intel/issues/44
  [i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
  [i915#704]: https://gitlab.freedesktop.org/drm/intel/issues/704


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

  Additional (6): fi-bdw-5557u fi-bwr-2160 fi-snb-2520m fi-gdg-551 fi-bsw-kefka fi-snb-2600 
  Missing    (6): fi-ilk-m540 fi-byt-squawks fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5483 -> IGTPW_4245

  CI-20190529: 20190529
  CI_DRM_8046: be13ba469987146d8e75f7c07103c0a087a3b520 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html
  IGT_5483: 1707153df224ffb6333c6c660a792b7f334eb3d3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@core_setmaster@master-drop-set-root
+igt@core_setmaster@master-drop-set-shared-fd
+igt@core_setmaster@master-drop-set-user

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for ts/core_setmaster: new test for drop/set master semantics (rev3)
  2020-03-02 17:33 [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Emil Velikov
  2020-03-02 18:52 ` [igt-dev] ✓ Fi.CI.BAT: success for ts/core_setmaster: new test for drop/set master semantics (rev3) Patchwork
@ 2020-03-03  8:03 ` Patchwork
  2020-03-03 13:13 ` [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Petri Latvala
  2020-03-03 13:13 ` Petri Latvala
  3 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2020-03-03  8:03 UTC (permalink / raw)
  To: Emil Velikov; +Cc: igt-dev

== Series Details ==

Series: ts/core_setmaster: new test for drop/set master semantics (rev3)
URL   : https://patchwork.freedesktop.org/series/73650/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8046_full -> IGTPW_4245_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4245_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4245_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@core_setmaster@master-drop-set-user} (NEW):
    - shard-iclb:         NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb8/igt@core_setmaster@master-drop-set-user.html
    - shard-kbl:          NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl6/igt@core_setmaster@master-drop-set-user.html
    - shard-snb:          NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-snb2/igt@core_setmaster@master-drop-set-user.html
    - shard-tglb:         NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb7/igt@core_setmaster@master-drop-set-user.html
    - shard-apl:          NOTRUN -> [FAIL][5]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl8/igt@core_setmaster@master-drop-set-user.html
    - shard-glk:          NOTRUN -> [FAIL][6]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk9/igt@core_setmaster@master-drop-set-user.html
    - shard-hsw:          NOTRUN -> [FAIL][7]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw5/igt@core_setmaster@master-drop-set-user.html

  * igt@perf@enable-disable:
    - shard-hsw:          [PASS][8] -> [FAIL][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-hsw1/igt@perf@enable-disable.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw5/igt@perf@enable-disable.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8046_full and IGTPW_4245_full:

### New IGT tests (3) ###

  * igt@core_setmaster@master-drop-set-root:
    - Statuses : 5 pass(s)
    - Exec time: [0.01, 0.02] s

  * igt@core_setmaster@master-drop-set-shared-fd:
    - Statuses : 7 pass(s)
    - Exec time: [0.01, 0.03] s

  * igt@core_setmaster@master-drop-set-user:
    - Statuses : 7 fail(s)
    - Exec time: [0.01, 0.06] s

  

Known issues
------------

  Here are the changes found in IGTPW_4245_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@rcs0-s3:
    - shard-kbl:          [PASS][10] -> [DMESG-WARN][11] ([i915#180]) +6 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl7/igt@gem_ctx_isolation@rcs0-s3.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl1/igt@gem_ctx_isolation@rcs0-s3.html

  * igt@gem_ctx_isolation@vecs0-s3:
    - shard-apl:          [PASS][12] -> [DMESG-WARN][13] ([i915#180])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl6/igt@gem_ctx_isolation@vecs0-s3.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl4/igt@gem_ctx_isolation@vecs0-s3.html

  * igt@gem_exec_schedule@implicit-both-bsd:
    - shard-iclb:         [PASS][14] -> [SKIP][15] ([i915#677]) +1 similar issue
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb7/igt@gem_exec_schedule@implicit-both-bsd.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb4/igt@gem_exec_schedule@implicit-both-bsd.html

  * igt@gem_exec_schedule@preempt-bsd:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([fdo#112146]) +2 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb3/igt@gem_exec_schedule@preempt-bsd.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb4/igt@gem_exec_schedule@preempt-bsd.html

  * igt@gem_exec_whisper@basic-queues-priority-all:
    - shard-glk:          [PASS][18] -> [DMESG-WARN][19] ([i915#118] / [i915#95])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk2/igt@gem_exec_whisper@basic-queues-priority-all.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk3/igt@gem_exec_whisper@basic-queues-priority-all.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-apl:          [PASS][20] -> [DMESG-WARN][21] ([fdo#111870] / [i915#211] / [i915#836])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl3/igt@gem_userptr_blits@sync-unmap-after-close.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl7/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [PASS][22] -> [FAIL][23] ([i915#454])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@i915_pm_dc@dc6-dpms.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_rpm@pm-tiling:
    - shard-hsw:          [PASS][24] -> [SKIP][25] ([fdo#109271]) +1 similar issue
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-hsw6/igt@i915_pm_rpm@pm-tiling.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw5/igt@i915_pm_rpm@pm-tiling.html
    - shard-tglb:         [PASS][26] -> [SKIP][27] ([i915#1316])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-tglb3/igt@i915_pm_rpm@pm-tiling.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb8/igt@i915_pm_rpm@pm-tiling.html
    - shard-glk:          [PASS][28] -> [SKIP][29] ([fdo#109271]) +1 similar issue
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk4/igt@i915_pm_rpm@pm-tiling.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk6/igt@i915_pm_rpm@pm-tiling.html
    - shard-iclb:         [PASS][30] -> [SKIP][31] ([i915#1316])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb7/igt@i915_pm_rpm@pm-tiling.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb1/igt@i915_pm_rpm@pm-tiling.html

  * igt@i915_pm_rps@waitboost:
    - shard-iclb:         [PASS][32] -> [FAIL][33] ([i915#413])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@i915_pm_rps@waitboost.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb6/igt@i915_pm_rps@waitboost.html

  * igt@kms_color@pipe-c-legacy-gamma:
    - shard-kbl:          [PASS][34] -> [FAIL][35] ([i915#71])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl3/igt@kms_color@pipe-c-legacy-gamma.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl3/igt@kms_color@pipe-c-legacy-gamma.html
    - shard-apl:          [PASS][36] -> [FAIL][37] ([i915#71])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl4/igt@kms_color@pipe-c-legacy-gamma.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl7/igt@kms_color@pipe-c-legacy-gamma.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-glk:          [PASS][38] -> [FAIL][39] ([i915#899])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk9/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk2/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][40] -> [SKIP][41] ([fdo#109441]) +6 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_vblank@pipe-a-accuracy-idle:
    - shard-glk:          [PASS][42] -> [FAIL][43] ([i915#43])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk3/igt@kms_vblank@pipe-a-accuracy-idle.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk2/igt@kms_vblank@pipe-a-accuracy-idle.html

  * igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
    - shard-iclb:         [PASS][44] -> [SKIP][45] ([fdo#109278])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb8/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb1/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
    - shard-tglb:         [PASS][46] -> [SKIP][47] ([fdo#112015])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-tglb5/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb8/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html

  * igt@perf_pmu@busy-no-semaphores-vcs1:
    - shard-iclb:         [PASS][48] -> [SKIP][49] ([fdo#112080]) +13 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb4/igt@perf_pmu@busy-no-semaphores-vcs1.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb3/igt@perf_pmu@busy-no-semaphores-vcs1.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [PASS][50] -> [SKIP][51] ([fdo#109276]) +21 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@prime_busy@hang-bsd2.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb8/igt@prime_busy@hang-bsd2.html

  
#### Possible fixes ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [SKIP][52] ([fdo#112080]) -> [PASS][53] +10 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb7/igt@gem_busy@busy-vcs1.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb2/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][54] ([fdo#110841]) -> [PASS][55]
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb4/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb6/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_schedule@implicit-write-read-bsd1:
    - shard-iclb:         [SKIP][56] ([fdo#109276] / [i915#677]) -> [PASS][57] +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb6/igt@gem_exec_schedule@implicit-write-read-bsd1.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb4/igt@gem_exec_schedule@implicit-write-read-bsd1.html

  * igt@gem_exec_schedule@independent-bsd2:
    - shard-iclb:         [SKIP][58] ([fdo#109276]) -> [PASS][59] +12 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb3/igt@gem_exec_schedule@independent-bsd2.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb4/igt@gem_exec_schedule@independent-bsd2.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
    - shard-iclb:         [SKIP][60] ([i915#677]) -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb4/igt@gem_exec_schedule@pi-distinct-iova-bsd.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb7/igt@gem_exec_schedule@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@reorder-wide-bsd:
    - shard-iclb:         [SKIP][62] ([fdo#112146]) -> [PASS][63] +5 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@gem_exec_schedule@reorder-wide-bsd.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb8/igt@gem_exec_schedule@reorder-wide-bsd.html

  * igt@gem_exec_whisper@basic-queues-forked:
    - shard-apl:          [INCOMPLETE][64] ([fdo#103927]) -> [PASS][65]
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl4/igt@gem_exec_whisper@basic-queues-forked.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl8/igt@gem_exec_whisper@basic-queues-forked.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-tglb:         [FAIL][66] ([i915#644]) -> [PASS][67]
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-tglb6/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb1/igt@gem_ppgtt@flink-and-close-vma-leak.html
    - shard-kbl:          [FAIL][68] ([i915#644]) -> [PASS][69]
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl1/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl1/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [DMESG-WARN][70] ([i915#716]) -> [PASS][71]
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk9/igt@gen9_exec_parse@allowed-all.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk2/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_rpm@debugfs-forcewake-user:
    - shard-hsw:          [SKIP][72] ([fdo#109271]) -> [PASS][73]
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-hsw6/igt@i915_pm_rpm@debugfs-forcewake-user.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw6/igt@i915_pm_rpm@debugfs-forcewake-user.html
    - shard-iclb:         [SKIP][74] ([i915#1316]) -> [PASS][75]
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@i915_pm_rpm@debugfs-forcewake-user.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb2/igt@i915_pm_rpm@debugfs-forcewake-user.html
    - shard-tglb:         [SKIP][76] ([i915#1316]) -> [PASS][77]
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-tglb7/igt@i915_pm_rpm@debugfs-forcewake-user.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb7/igt@i915_pm_rpm@debugfs-forcewake-user.html
    - shard-glk:          [SKIP][78] ([fdo#109271]) -> [PASS][79]
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk3/igt@i915_pm_rpm@debugfs-forcewake-user.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk3/igt@i915_pm_rpm@debugfs-forcewake-user.html

  * igt@i915_suspend@fence-restore-untiled:
    - shard-kbl:          [INCOMPLETE][80] ([fdo#103665]) -> [PASS][81]
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl1/igt@i915_suspend@fence-restore-untiled.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl6/igt@i915_suspend@fence-restore-untiled.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][82] ([i915#180]) -> [PASS][83] +1 similar issue
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl1/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl4/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_legacy@flip-vs-cursor-legacy:
    - shard-iclb:         [FAIL][84] ([IGT#5]) -> [PASS][85]
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb2/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb5/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-apl:          [DMESG-WARN][86] ([i915#180]) -> [PASS][87]
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl1/igt@kms_fbcon_fbt@fbc-suspend.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl4/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
    - shard-glk:          [FAIL][88] ([i915#79]) -> [PASS][89]
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk9/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk5/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc:
    - shard-snb:          [SKIP][90] ([fdo#109271]) -> [PASS][91]
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-snb6/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-snb2/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-pwrite:
    - shard-glk:          [FAIL][92] ([i915#49]) -> [PASS][93]
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk5/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-pwrite.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk2/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-render:
    - shard-tglb:         [SKIP][94] ([i915#668]) -> [PASS][95] +6 similar issues
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-tglb2/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-render.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-tglb2/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-render.html

  * igt@kms_psr@psr2_basic:
    - shard-iclb:         [SKIP][96] ([fdo#109441]) -> [PASS][97] +1 similar issue
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-iclb6/igt@kms_psr@psr2_basic.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-iclb2/igt@kms_psr@psr2_basic.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [FAIL][98] ([i915#31]) -> [PASS][99]
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-kbl7/igt@kms_setmode@basic.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-kbl7/igt@kms_setmode@basic.html

  * igt@perf@oa-exponents:
    - shard-glk:          [FAIL][100] ([i915#84]) -> [PASS][101]
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-glk5/igt@perf@oa-exponents.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-glk2/igt@perf@oa-exponents.html

  * igt@perf@short-reads:
    - shard-hsw:          [FAIL][102] ([i915#51]) -> [PASS][103]
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-hsw6/igt@perf@short-reads.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw6/igt@perf@short-reads.html

  
#### Warnings ####

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-snb:          [DMESG-WARN][104] ([fdo#110789] / [fdo#111870] / [i915#478]) -> [DMESG-WARN][105] ([fdo#111870] / [i915#478])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-snb5/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-snb2/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
    - shard-hsw:          [DMESG-WARN][106] ([fdo#110789] / [fdo#111870]) -> [DMESG-WARN][107] ([fdo#111870])
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-hsw5/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-hsw1/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  * igt@i915_pm_rpm@drm-resources-equal:
    - shard-snb:          [SKIP][108] ([fdo#109271]) -> [INCOMPLETE][109] ([i915#82])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-snb2/igt@i915_pm_rpm@drm-resources-equal.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-snb5/igt@i915_pm_rpm@drm-resources-equal.html

  * igt@runner@aborted:
    - shard-apl:          [FAIL][110] ([fdo#103927]) -> ([FAIL][111], [FAIL][112]) ([fdo#103927] / [fdo#111870] / [i915#211] / [i915#771])
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8046/shard-apl6/igt@runner@aborted.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl2/igt@runner@aborted.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/shard-apl7/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [IGT#5]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/5
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112015]: https://bugs.freedesktop.org/show_bug.cgi?id=112015
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1316]: https://gitlab.freedesktop.org/drm/intel/issues/1316
  [i915#1356]: https://gitlab.freedesktop.org/drm/intel/issues/1356
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#211]: https://gitlab.freedesktop.org/drm/intel/issues/211
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#43]: https://gitlab.freedesktop.org/drm/intel/issues/43
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#51]: https://gitlab.freedesktop.org/drm/intel/issues/51
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#668]: https://gitlab.freedesktop.org/drm/intel/issues/668
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#71]: https://gitlab.freedesktop.org/drm/intel/issues/71
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#771]: https://gitlab.freedesktop.org/drm/intel/issues/771
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#836]: https://gitlab.freedesktop.org/drm/intel/issues/836
  [i915#84]: https://gitlab.freedesktop.org/drm/intel/issues/84
  [i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5483 -> IGTPW_4245
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8046: be13ba469987146d8e75f7c07103c0a087a3b520 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html
  IGT_5483: 1707153df224ffb6333c6c660a792b7f334eb3d3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4245/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-02 17:33 [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Emil Velikov
  2020-03-02 18:52 ` [igt-dev] ✓ Fi.CI.BAT: success for ts/core_setmaster: new test for drop/set master semantics (rev3) Patchwork
  2020-03-03  8:03 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2020-03-03 13:13 ` Petri Latvala
  2020-03-03 14:46   ` Emil Velikov
  2020-03-03 13:13 ` Petri Latvala
  3 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2020-03-03 13:13 UTC (permalink / raw)
  To: Emil Velikov; +Cc: igt-dev

On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov@collabora.com>
> 
> This test adds three distinct subtests:
>  - drop/set master as root
>  - drop/set master as non-root
>  - drop/set master for a shared fd
> 
> Currently the second subtest will fail, with kernel patch to address
> that has been submitted.
> 
> v2: Add to the autotools build
> v3:
>  - Add igt_describe()
>  - Use igt_fixture() for tweak_perm
>  - Enhance comments
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> ---
>  tests/Makefile.sources |   1 +
>  tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build      |   1 +
>  3 files changed, 208 insertions(+)
>  create mode 100644 tests/core_setmaster.c
> 
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index b87d6333..5da36a91 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -18,6 +18,7 @@ TESTS_progs = \
>  	core_getclient \
>  	core_getstats \
>  	core_getversion \
> +	core_setmaster \
>  	core_setmaster_vs_auth \
>  	debugfs_test \
>  	dmabuf \
> diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> new file mode 100644
> index 00000000..58ed9771
> --- /dev/null
> +++ b/tests/core_setmaster.c
> @@ -0,0 +1,206 @@
> +/*
> + * Copyright © 2020 Collabora, Ltd.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Emil Velikov <emil.l.velikov@gmail.com>
> + *
> + */
> +
> +/*
> + * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
> + *
> + * Test checks if the ioctls succeed or fail, depending if the applications was
> + * run with root, user privileges or if we have separate privileged arbitrator.
> + */
> +
> +#include "igt.h"
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <sys/stat.h>
> +
> +IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
> +		     " access");
> +
> +static bool is_master(int fd)
> +{
> +	/* FIXME: replace with drmIsMaster once we bumped libdrm version */
> +	return drmAuthMagic(fd, 0) != -EACCES;
> +}
> +
> +static void check_drop_set(void)
> +{
> +	int master;
> +
> +	master = __drm_open_driver(DRIVER_ANY);
> +
> +	/* Ensure we have a valid device. This is _extremely_ unlikely to
> +	 * trigger as tweak_perm() aims to ensure we have the correct rights.
> +	 * Although:
> +	 * - according to the manual igt_drop_root() + igt_skip() is broken

I asked for clarification on this and didn't get a reply. I'm not
seeing such a mention. Well, there is the text warning about
igt_drop_root() and atexit handlers and recommending the use of
igt_drop_root() in a child process to avoid issues, and this is in a
child process.

Whatever I'm missing here surely also applies to igt_assert as well?


> +	 * - there is _no_ guarantee that we'll open a device handled by
> +	 * tweak_perm()

This is a point that came to mind later, the building blocks for that
guarantee are in igt_device_scan.

1) If filter already set (test being run with --device), use that
   filter (igt_device_filter_get or so). Otherwise loop through the
   generated card%u names, using drm:/dev/dri/card%u as the
   filter. igt_device_scan.c stuff already has a list of all possible
   devices but I don't see an easy way to get to the list.

2) igt_device_card_match() gets you a card

3) card->card should be the path to /dev/dri to chmod on

4) igt_open_card(card) gives you an fd to that card


> +	 * - having a device is integral part of the test

It's an integral part of all tests. The issue with the use of
igt_require vs igt_assert is whether it's a prerequisite or the thing
you're actually testing.


> +	 */
> +	igt_assert_neq(master, -1);
> +
> +	/* At this point we're master capable due to:
> +	 * - being root - always
> +	 * - normal user - as the only drm only drm client (on this VT)
> +	 */
> +	igt_assert_eq(is_master(master), true);

Just igt_assert(is_master(master))


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-02 17:33 [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Emil Velikov
                   ` (2 preceding siblings ...)
  2020-03-03 13:13 ` [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Petri Latvala
@ 2020-03-03 13:13 ` Petri Latvala
  3 siblings, 0 replies; 14+ messages in thread
From: Petri Latvala @ 2020-03-03 13:13 UTC (permalink / raw)
  To: Emil Velikov; +Cc: igt-dev

On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> Subject: [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics

Forgot to ask: What is ts?


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-03 13:13 ` [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Petri Latvala
@ 2020-03-03 14:46   ` Emil Velikov
  2020-03-04 11:25     ` Petri Latvala
  0 siblings, 1 reply; 14+ messages in thread
From: Emil Velikov @ 2020-03-03 14:46 UTC (permalink / raw)
  To: Petri Latvala; +Cc: IGT development

On Tue, 3 Mar 2020 at 13:13, Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov@collabora.com>
> >
> > This test adds three distinct subtests:
> >  - drop/set master as root
> >  - drop/set master as non-root
> >  - drop/set master for a shared fd
> >
> > Currently the second subtest will fail, with kernel patch to address
> > that has been submitted.
> >
> > v2: Add to the autotools build
> > v3:
> >  - Add igt_describe()
> >  - Use igt_fixture() for tweak_perm
> >  - Enhance comments
> >
> > Cc: Petri Latvala <petri.latvala@intel.com>
> > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > ---
> >  tests/Makefile.sources |   1 +
> >  tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
> >  tests/meson.build      |   1 +
> >  3 files changed, 208 insertions(+)
> >  create mode 100644 tests/core_setmaster.c
> >
> > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > index b87d6333..5da36a91 100644
> > --- a/tests/Makefile.sources
> > +++ b/tests/Makefile.sources
> > @@ -18,6 +18,7 @@ TESTS_progs = \
> >       core_getclient \
> >       core_getstats \
> >       core_getversion \
> > +     core_setmaster \
> >       core_setmaster_vs_auth \
> >       debugfs_test \
> >       dmabuf \
> > diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> > new file mode 100644
> > index 00000000..58ed9771
> > --- /dev/null
> > +++ b/tests/core_setmaster.c
> > @@ -0,0 +1,206 @@
> > +/*
> > + * Copyright © 2020 Collabora, Ltd.
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + * Authors:
> > + *    Emil Velikov <emil.l.velikov@gmail.com>
> > + *
> > + */
> > +
> > +/*
> > + * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
> > + *
> > + * Test checks if the ioctls succeed or fail, depending if the applications was
> > + * run with root, user privileges or if we have separate privileged arbitrator.
> > + */
> > +
> > +#include "igt.h"
> > +#include <unistd.h>
> > +#include <stdlib.h>
> > +#include <stdio.h>
> > +#include <string.h>
> > +#include <sys/stat.h>
> > +
> > +IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
> > +                  " access");
> > +
> > +static bool is_master(int fd)
> > +{
> > +     /* FIXME: replace with drmIsMaster once we bumped libdrm version */
> > +     return drmAuthMagic(fd, 0) != -EACCES;
> > +}
> > +
> > +static void check_drop_set(void)
> > +{
> > +     int master;
> > +
> > +     master = __drm_open_driver(DRIVER_ANY);
> > +
> > +     /* Ensure we have a valid device. This is _extremely_ unlikely to
> > +      * trigger as tweak_perm() aims to ensure we have the correct rights.
> > +      * Although:
> > +      * - according to the manual igt_drop_root() + igt_skip() is broken
>
> I asked for clarification on this and didn't get a reply. I'm not
> seeing such a mention. Well, there is the text warning about
> igt_drop_root() and atexit handlers and recommending the use of
> igt_drop_root() in a child process to avoid issues, and this is in a
> child process.
>
> Whatever I'm missing here surely also applies to igt_assert as well?
>
Darn it ... got the wrong function which explains the confusion.

In particular igt_skip() isn't propagated properly within a
igt_fork(), as documented [1].
This results in a) the test failing [2] (instead of skipping) with b)
semi-magical trace.

If the IGT team is happy with those pitfalls, I can switch to igt_require :-)

[1] https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_core.h#L1045
[2] igt_skip: Assertion `"!test_child` failed


>
> > +      * - there is _no_ guarantee that we'll open a device handled by
> > +      * tweak_perm()
>
> This is a point that came to mind later, the building blocks for that
> guarantee are in igt_device_scan.
>
> 1) If filter already set (test being run with --device), use that
>    filter (igt_device_filter_get or so). Otherwise loop through the
>    generated card%u names, using drm:/dev/dri/card%u as the
>    filter. igt_device_scan.c stuff already has a list of all possible
>    devices but I don't see an easy way to get to the list.
>
> 2) igt_device_card_match() gets you a card
>
> 3) card->card should be the path to /dev/dri to chmod on
>
> 4) igt_open_card(card) gives you an fd to that card
>
Not entirely sure what you're suggesting here. Can you please elaborate?

>
> > +      * - having a device is integral part of the test
>
> It's an integral part of all tests. The issue with the use of
> igt_require vs igt_assert is whether it's a prerequisite or the thing
> you're actually testing.
>
The latter. I can reword that comment to "successfully opening a
device is part of the test" or anything that you'd prefer.

>
> > +      */
> > +     igt_assert_neq(master, -1);
> > +
> > +     /* At this point we're master capable due to:
> > +      * - being root - always
> > +      * - normal user - as the only drm only drm client (on this VT)
> > +      */
> > +     igt_assert_eq(is_master(master), true);
>
> Just igt_assert(is_master(master))
>
Sure fixed, alongside the s/ts/test/ type in the summary.

Is there some dos and don'ts about which igt_assert* functions to use?
Would it make sense to write short list + mass conversion to the
recommended ones?

Thanks
Emil
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-03 14:46   ` Emil Velikov
@ 2020-03-04 11:25     ` Petri Latvala
  2020-03-04 13:26       ` Emil Velikov
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2020-03-04 11:25 UTC (permalink / raw)
  To: Emil Velikov; +Cc: IGT development

On Tue, Mar 03, 2020 at 02:46:51PM +0000, Emil Velikov wrote:
> On Tue, 3 Mar 2020 at 13:13, Petri Latvala <petri.latvala@intel.com> wrote:
> >
> > On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> > > From: Emil Velikov <emil.velikov@collabora.com>
> > >
> > > This test adds three distinct subtests:
> > >  - drop/set master as root
> > >  - drop/set master as non-root
> > >  - drop/set master for a shared fd
> > >
> > > Currently the second subtest will fail, with kernel patch to address
> > > that has been submitted.
> > >
> > > v2: Add to the autotools build
> > > v3:
> > >  - Add igt_describe()
> > >  - Use igt_fixture() for tweak_perm
> > >  - Enhance comments
> > >
> > > Cc: Petri Latvala <petri.latvala@intel.com>
> > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > ---
> > >  tests/Makefile.sources |   1 +
> > >  tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
> > >  tests/meson.build      |   1 +
> > >  3 files changed, 208 insertions(+)
> > >  create mode 100644 tests/core_setmaster.c
> > >
> > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > > index b87d6333..5da36a91 100644
> > > --- a/tests/Makefile.sources
> > > +++ b/tests/Makefile.sources
> > > @@ -18,6 +18,7 @@ TESTS_progs = \
> > >       core_getclient \
> > >       core_getstats \
> > >       core_getversion \
> > > +     core_setmaster \
> > >       core_setmaster_vs_auth \
> > >       debugfs_test \
> > >       dmabuf \
> > > diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> > > new file mode 100644
> > > index 00000000..58ed9771
> > > --- /dev/null
> > > +++ b/tests/core_setmaster.c
> > > @@ -0,0 +1,206 @@
> > > +/*
> > > + * Copyright © 2020 Collabora, Ltd.
> > > + *
> > > + * Permission is hereby granted, free of charge, to any person obtaining a
> > > + * copy of this software and associated documentation files (the "Software"),
> > > + * to deal in the Software without restriction, including without limitation
> > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > > + * and/or sell copies of the Software, and to permit persons to whom the
> > > + * Software is furnished to do so, subject to the following conditions:
> > > + *
> > > + * The above copyright notice and this permission notice (including the next
> > > + * paragraph) shall be included in all copies or substantial portions of the
> > > + * Software.
> > > + *
> > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > > + * IN THE SOFTWARE.
> > > + *
> > > + * Authors:
> > > + *    Emil Velikov <emil.l.velikov@gmail.com>
> > > + *
> > > + */
> > > +
> > > +/*
> > > + * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
> > > + *
> > > + * Test checks if the ioctls succeed or fail, depending if the applications was
> > > + * run with root, user privileges or if we have separate privileged arbitrator.
> > > + */
> > > +
> > > +#include "igt.h"
> > > +#include <unistd.h>
> > > +#include <stdlib.h>
> > > +#include <stdio.h>
> > > +#include <string.h>
> > > +#include <sys/stat.h>
> > > +
> > > +IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
> > > +                  " access");
> > > +
> > > +static bool is_master(int fd)
> > > +{
> > > +     /* FIXME: replace with drmIsMaster once we bumped libdrm version */
> > > +     return drmAuthMagic(fd, 0) != -EACCES;
> > > +}
> > > +
> > > +static void check_drop_set(void)
> > > +{
> > > +     int master;
> > > +
> > > +     master = __drm_open_driver(DRIVER_ANY);
> > > +
> > > +     /* Ensure we have a valid device. This is _extremely_ unlikely to
> > > +      * trigger as tweak_perm() aims to ensure we have the correct rights.
> > > +      * Although:
> > > +      * - according to the manual igt_drop_root() + igt_skip() is broken
> >
> > I asked for clarification on this and didn't get a reply. I'm not
> > seeing such a mention. Well, there is the text warning about
> > igt_drop_root() and atexit handlers and recommending the use of
> > igt_drop_root() in a child process to avoid issues, and this is in a
> > child process.
> >
> > Whatever I'm missing here surely also applies to igt_assert as well?
> >
> Darn it ... got the wrong function which explains the confusion.
> 
> In particular igt_skip() isn't propagated properly within a
> igt_fork(), as documented [1].
> This results in a) the test failing [2] (instead of skipping) with b)
> semi-magical trace.
> 
> If the IGT team is happy with those pitfalls, I can switch to igt_require :-)
> 
> [1] https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_core.h#L1045
> [2] igt_skip: Assertion `"!test_child` failed

Ah, now I see!

Indeed skip isn't propagated properly and we should get that fixed at
some point. No need to hold your patch as hostage though.

With a comment that states that skip is not properly propagated from
child processes, keep the igt_assert and __drm_open_driver() usage in
check_drop_set(). There's igt_assert_fd() btw for a shorthand check
for fd != -1.

The second subtest can use igt_require though, by way of using
drm_open_driver().


> 
> 
> >
> > > +      * - there is _no_ guarantee that we'll open a device handled by
> > > +      * tweak_perm()
> >
> > This is a point that came to mind later, the building blocks for that
> > guarantee are in igt_device_scan.
> >
> > 1) If filter already set (test being run with --device), use that
> >    filter (igt_device_filter_get or so). Otherwise loop through the
> >    generated card%u names, using drm:/dev/dri/card%u as the
> >    filter. igt_device_scan.c stuff already has a list of all possible
> >    devices but I don't see an easy way to get to the list.
> >
> > 2) igt_device_card_match() gets you a card
> >
> > 3) card->card should be the path to /dev/dri to chmod on
> >
> > 4) igt_open_card(card) gives you an fd to that card
> >
> Not entirely sure what you're suggesting here. Can you please elaborate?

lib/igt_device_scan.[ch] is for device selection and you can use that
to make sure chown has hit the device drm_open_driver() is
opening. Although I wrote that comment thinking you only chmod one of
them but that was a misreading from my part, ignore this comment. You
chmod all of them. Even with --device usage chmoding all devices will
ensure the only way for chmodding not to be done is not having the
proper kernel modules modprobed. Which drm_open_driver will do. Yikes.

Which luckily brings us to the best of both worlds. In the igt_fixture
before the first subtest:

/* Ensure modules are loaded and the device file exists */
close(drm_open_driver(DRIVER_ANY));

Now having the igt_assert (as opposed to igt_require()) in the child
process makes even more sense.


> 
> >
> > > +      * - having a device is integral part of the test
> >
> > It's an integral part of all tests. The issue with the use of
> > igt_require vs igt_assert is whether it's a prerequisite or the thing
> > you're actually testing.
> >
> The latter. I can reword that comment to "successfully opening a
> device is part of the test" or anything that you'd prefer.

I would prefer that yes. The skip propagation is enough to justify
igt_assert though. And having that module reloading drm_open_driver()
in the fixture.


> 
> >
> > > +      */
> > > +     igt_assert_neq(master, -1);
> > > +
> > > +     /* At this point we're master capable due to:
> > > +      * - being root - always
> > > +      * - normal user - as the only drm only drm client (on this VT)
> > > +      */
> > > +     igt_assert_eq(is_master(master), true);
> >
> > Just igt_assert(is_master(master))
> >
> Sure fixed, alongside the s/ts/test/ type in the summary.
> 
> Is there some dos and don'ts about which igt_assert* functions to use?
> Would it make sense to write short list + mass conversion to the
> recommended ones?

In general, use igt_assert_eq(x, y) instead of igt_assert(x == y) to
get better error messages on failure, as it prints the values of both
operands. However, for values that are already just booleans, plain
igt_assert() reads a bit better.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-04 11:25     ` Petri Latvala
@ 2020-03-04 13:26       ` Emil Velikov
  2020-03-04 14:17         ` Petri Latvala
  0 siblings, 1 reply; 14+ messages in thread
From: Emil Velikov @ 2020-03-04 13:26 UTC (permalink / raw)
  To: Petri Latvala; +Cc: IGT development

On Wed, 4 Mar 2020 at 11:25, Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Tue, Mar 03, 2020 at 02:46:51PM +0000, Emil Velikov wrote:
> > On Tue, 3 Mar 2020 at 13:13, Petri Latvala <petri.latvala@intel.com> wrote:
> > >
> > > On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> > > > From: Emil Velikov <emil.velikov@collabora.com>
> > > >
> > > > This test adds three distinct subtests:
> > > >  - drop/set master as root
> > > >  - drop/set master as non-root
> > > >  - drop/set master for a shared fd
> > > >
> > > > Currently the second subtest will fail, with kernel patch to address
> > > > that has been submitted.
> > > >
> > > > v2: Add to the autotools build
> > > > v3:
> > > >  - Add igt_describe()
> > > >  - Use igt_fixture() for tweak_perm
> > > >  - Enhance comments
> > > >
> > > > Cc: Petri Latvala <petri.latvala@intel.com>
> > > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > > ---
> > > >  tests/Makefile.sources |   1 +
> > > >  tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
> > > >  tests/meson.build      |   1 +
> > > >  3 files changed, 208 insertions(+)
> > > >  create mode 100644 tests/core_setmaster.c
> > > >
> > > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > > > index b87d6333..5da36a91 100644
> > > > --- a/tests/Makefile.sources
> > > > +++ b/tests/Makefile.sources
> > > > @@ -18,6 +18,7 @@ TESTS_progs = \
> > > >       core_getclient \
> > > >       core_getstats \
> > > >       core_getversion \
> > > > +     core_setmaster \
> > > >       core_setmaster_vs_auth \
> > > >       debugfs_test \
> > > >       dmabuf \
> > > > diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> > > > new file mode 100644
> > > > index 00000000..58ed9771
> > > > --- /dev/null
> > > > +++ b/tests/core_setmaster.c
> > > > @@ -0,0 +1,206 @@
> > > > +/*
> > > > + * Copyright © 2020 Collabora, Ltd.
> > > > + *
> > > > + * Permission is hereby granted, free of charge, to any person obtaining a
> > > > + * copy of this software and associated documentation files (the "Software"),
> > > > + * to deal in the Software without restriction, including without limitation
> > > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > > > + * and/or sell copies of the Software, and to permit persons to whom the
> > > > + * Software is furnished to do so, subject to the following conditions:
> > > > + *
> > > > + * The above copyright notice and this permission notice (including the next
> > > > + * paragraph) shall be included in all copies or substantial portions of the
> > > > + * Software.
> > > > + *
> > > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > > > + * IN THE SOFTWARE.
> > > > + *
> > > > + * Authors:
> > > > + *    Emil Velikov <emil.l.velikov@gmail.com>
> > > > + *
> > > > + */
> > > > +
> > > > +/*
> > > > + * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
> > > > + *
> > > > + * Test checks if the ioctls succeed or fail, depending if the applications was
> > > > + * run with root, user privileges or if we have separate privileged arbitrator.
> > > > + */
> > > > +
> > > > +#include "igt.h"
> > > > +#include <unistd.h>
> > > > +#include <stdlib.h>
> > > > +#include <stdio.h>
> > > > +#include <string.h>
> > > > +#include <sys/stat.h>
> > > > +
> > > > +IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
> > > > +                  " access");
> > > > +
> > > > +static bool is_master(int fd)
> > > > +{
> > > > +     /* FIXME: replace with drmIsMaster once we bumped libdrm version */
> > > > +     return drmAuthMagic(fd, 0) != -EACCES;
> > > > +}
> > > > +
> > > > +static void check_drop_set(void)
> > > > +{
> > > > +     int master;
> > > > +
> > > > +     master = __drm_open_driver(DRIVER_ANY);
> > > > +
> > > > +     /* Ensure we have a valid device. This is _extremely_ unlikely to
> > > > +      * trigger as tweak_perm() aims to ensure we have the correct rights.
> > > > +      * Although:
> > > > +      * - according to the manual igt_drop_root() + igt_skip() is broken
> > >
> > > I asked for clarification on this and didn't get a reply. I'm not
> > > seeing such a mention. Well, there is the text warning about
> > > igt_drop_root() and atexit handlers and recommending the use of
> > > igt_drop_root() in a child process to avoid issues, and this is in a
> > > child process.
> > >
> > > Whatever I'm missing here surely also applies to igt_assert as well?
> > >
> > Darn it ... got the wrong function which explains the confusion.
> >
> > In particular igt_skip() isn't propagated properly within a
> > igt_fork(), as documented [1].
> > This results in a) the test failing [2] (instead of skipping) with b)
> > semi-magical trace.
> >
> > If the IGT team is happy with those pitfalls, I can switch to igt_require :-)
> >
> > [1] https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_core.h#L1045
> > [2] igt_skip: Assertion `"!test_child` failed
>
> Ah, now I see!
>
> Indeed skip isn't propagated properly and we should get that fixed at
> some point. No need to hold your patch as hostage though.
>
AFAICT I'm the only person who ever dares running tests as non-root,
which explains the current state ;-)

> With a comment that states that skip is not properly propagated from
> child processes, keep the igt_assert and __drm_open_driver() usage in
> check_drop_set().

Ack, comment tweaked.

> There's igt_assert_fd() btw for a shorthand check
> for fd != -1.
>
See my comment below.

> The second subtest can use igt_require though, by way of using
> drm_open_driver().
>
Do you really mean "second" aka "master-drop-set-user" here?
Above you're agree with using igt_assert(), yet here you suggest
(again) for igt_require()...

I'm confused :-\

drm_open_driver() does not look like a good solution here.
In particular we're testing core DRM functionality so anything GEM
(like in the embedded gem_quiescent_gpu call) is irrelevant.

Additionally, both gem_quiescent_gpu and the atexit handler require
root to drop the caches, et al.

Thinking about it, you're likely talking about the 3rd subtest aka
"master-drop-set-shared-fd". Sure we can use igt_require() there,
although I'd rather keep the__drm_open_driver() + igt_require()
combination.

Do you agree?

>
> >
> >
> > >
> > > > +      * - there is _no_ guarantee that we'll open a device handled by
> > > > +      * tweak_perm()
> > >
> > > This is a point that came to mind later, the building blocks for that
> > > guarantee are in igt_device_scan.
> > >
> > > 1) If filter already set (test being run with --device), use that
> > >    filter (igt_device_filter_get or so). Otherwise loop through the
> > >    generated card%u names, using drm:/dev/dri/card%u as the
> > >    filter. igt_device_scan.c stuff already has a list of all possible
> > >    devices but I don't see an easy way to get to the list.
> > >
> > > 2) igt_device_card_match() gets you a card
> > >
> > > 3) card->card should be the path to /dev/dri to chmod on
> > >
> > > 4) igt_open_card(card) gives you an fd to that card
> > >
> > Not entirely sure what you're suggesting here. Can you please elaborate?
>
> lib/igt_device_scan.[ch] is for device selection and you can use that
> to make sure chown has hit the device drm_open_driver() is
> opening. Although I wrote that comment thinking you only chmod one of
> them but that was a misreading from my part, ignore this comment. You
> chmod all of them. Even with --device usage chmoding all devices will
> ensure the only way for chmodding not to be done is not having the
> proper kernel modules modprobed. Which drm_open_driver will do. Yikes.
>
> Which luckily brings us to the best of both worlds. In the igt_fixture
> before the first subtest:
>
> /* Ensure modules are loaded and the device file exists */
> close(drm_open_driver(DRIVER_ANY));
>
> Now having the igt_assert (as opposed to igt_require()) in the child
> process makes even more sense.
>
Thinking about it close(drm_open_driver(...)) looks like a workaround,
instead of addressing the issue.
Even though it seems like it might work, the modprobe machinery seems partial:
 - in the non i915 case, modprobe failure is a _debug_ message
 - the DRIVER_FOO to module name mapping is partial
 - for some drivers, the module name differs from the name in drmGetVersion()
 - some drivers have changed their module name

So I'd suggest omitting the workaround and leaving the igt_assert() in
check_drop_set() do it's job.

>
> >
> > >
> > > > +      * - having a device is integral part of the test
> > >
> > > It's an integral part of all tests. The issue with the use of
> > > igt_require vs igt_assert is whether it's a prerequisite or the thing
> > > you're actually testing.
> > >
> > The latter. I can reword that comment to "successfully opening a
> > device is part of the test" or anything that you'd prefer.
>
> I would prefer that yes. The skip propagation is enough to justify
> igt_assert though. And having that module reloading drm_open_driver()
> in the fixture.
>
Comment fixed.

>
> >
> > >
> > > > +      */
> > > > +     igt_assert_neq(master, -1);
> > > > +
> > > > +     /* At this point we're master capable due to:
> > > > +      * - being root - always
> > > > +      * - normal user - as the only drm only drm client (on this VT)
> > > > +      */
> > > > +     igt_assert_eq(is_master(master), true);
> > >
> > > Just igt_assert(is_master(master))
> > >
> > Sure fixed, alongside the s/ts/test/ type in the summary.
> >
> > Is there some dos and don'ts about which igt_assert* functions to use?
> > Would it make sense to write short list + mass conversion to the
> > recommended ones?
>
> In general, use igt_assert_eq(x, y) instead of igt_assert(x == y) to
> get better error messages on failure, as it prints the values of both
> operands. However, for values that are already just booleans, plain
> igt_assert() reads a bit better.
>
From a quick look:
 - 700+ instances of igt_assert(... == ...)
 - 200+ instances of igt_assert(... != ...)
 - 10+ instances of igt_assert_[n]eq(... {true,false})
 - 200+ instances of igt_assert_fd permutations >= 0, < 0, -1

While I agree on the readability aspect, as-is we're in a pretty weird
spot. How about we a) document b) add basic CI plumbing (so reviewers
don't need to spend brain cycles) and c) update the existing codebase
in few large commits?

None of which seems like a blocker for this patch IMHO. Although I can
produce a follow-up patch or two addressing some of the
inconsistencies.

-Emil
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-04 13:26       ` Emil Velikov
@ 2020-03-04 14:17         ` Petri Latvala
  2020-03-06 14:17           ` Emil Velikov
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2020-03-04 14:17 UTC (permalink / raw)
  To: Emil Velikov; +Cc: IGT development

On Wed, Mar 04, 2020 at 01:26:49PM +0000, Emil Velikov wrote:
> On Wed, 4 Mar 2020 at 11:25, Petri Latvala <petri.latvala@intel.com> wrote:
> >
> > On Tue, Mar 03, 2020 at 02:46:51PM +0000, Emil Velikov wrote:
> > > On Tue, 3 Mar 2020 at 13:13, Petri Latvala <petri.latvala@intel.com> wrote:
> > > >
> > > > On Mon, Mar 02, 2020 at 05:33:14PM +0000, Emil Velikov wrote:
> > > > > From: Emil Velikov <emil.velikov@collabora.com>
> > > > >
> > > > > This test adds three distinct subtests:
> > > > >  - drop/set master as root
> > > > >  - drop/set master as non-root
> > > > >  - drop/set master for a shared fd
> > > > >
> > > > > Currently the second subtest will fail, with kernel patch to address
> > > > > that has been submitted.
> > > > >
> > > > > v2: Add to the autotools build
> > > > > v3:
> > > > >  - Add igt_describe()
> > > > >  - Use igt_fixture() for tweak_perm
> > > > >  - Enhance comments
> > > > >
> > > > > Cc: Petri Latvala <petri.latvala@intel.com>
> > > > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > > > ---
> > > > >  tests/Makefile.sources |   1 +
> > > > >  tests/core_setmaster.c | 206 +++++++++++++++++++++++++++++++++++++++++
> > > > >  tests/meson.build      |   1 +
> > > > >  3 files changed, 208 insertions(+)
> > > > >  create mode 100644 tests/core_setmaster.c
> > > > >
> > > > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > > > > index b87d6333..5da36a91 100644
> > > > > --- a/tests/Makefile.sources
> > > > > +++ b/tests/Makefile.sources
> > > > > @@ -18,6 +18,7 @@ TESTS_progs = \
> > > > >       core_getclient \
> > > > >       core_getstats \
> > > > >       core_getversion \
> > > > > +     core_setmaster \
> > > > >       core_setmaster_vs_auth \
> > > > >       debugfs_test \
> > > > >       dmabuf \
> > > > > diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> > > > > new file mode 100644
> > > > > index 00000000..58ed9771
> > > > > --- /dev/null
> > > > > +++ b/tests/core_setmaster.c
> > > > > @@ -0,0 +1,206 @@
> > > > > +/*
> > > > > + * Copyright © 2020 Collabora, Ltd.
> > > > > + *
> > > > > + * Permission is hereby granted, free of charge, to any person obtaining a
> > > > > + * copy of this software and associated documentation files (the "Software"),
> > > > > + * to deal in the Software without restriction, including without limitation
> > > > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > > > > + * and/or sell copies of the Software, and to permit persons to whom the
> > > > > + * Software is furnished to do so, subject to the following conditions:
> > > > > + *
> > > > > + * The above copyright notice and this permission notice (including the next
> > > > > + * paragraph) shall be included in all copies or substantial portions of the
> > > > > + * Software.
> > > > > + *
> > > > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > > > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > > > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > > > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > > > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > > > > + * IN THE SOFTWARE.
> > > > > + *
> > > > > + * Authors:
> > > > > + *    Emil Velikov <emil.l.velikov@gmail.com>
> > > > > + *
> > > > > + */
> > > > > +
> > > > > +/*
> > > > > + * Testcase: Check that drop/setMaster behaves correctly wrt root/user access
> > > > > + *
> > > > > + * Test checks if the ioctls succeed or fail, depending if the applications was
> > > > > + * run with root, user privileges or if we have separate privileged arbitrator.
> > > > > + */
> > > > > +
> > > > > +#include "igt.h"
> > > > > +#include <unistd.h>
> > > > > +#include <stdlib.h>
> > > > > +#include <stdio.h>
> > > > > +#include <string.h>
> > > > > +#include <sys/stat.h>
> > > > > +
> > > > > +IGT_TEST_DESCRIPTION("Check that Drop/SetMaster behaves correctly wrt root/user"
> > > > > +                  " access");
> > > > > +
> > > > > +static bool is_master(int fd)
> > > > > +{
> > > > > +     /* FIXME: replace with drmIsMaster once we bumped libdrm version */
> > > > > +     return drmAuthMagic(fd, 0) != -EACCES;
> > > > > +}
> > > > > +
> > > > > +static void check_drop_set(void)
> > > > > +{
> > > > > +     int master;
> > > > > +
> > > > > +     master = __drm_open_driver(DRIVER_ANY);
> > > > > +
> > > > > +     /* Ensure we have a valid device. This is _extremely_ unlikely to
> > > > > +      * trigger as tweak_perm() aims to ensure we have the correct rights.
> > > > > +      * Although:
> > > > > +      * - according to the manual igt_drop_root() + igt_skip() is broken
> > > >
> > > > I asked for clarification on this and didn't get a reply. I'm not
> > > > seeing such a mention. Well, there is the text warning about
> > > > igt_drop_root() and atexit handlers and recommending the use of
> > > > igt_drop_root() in a child process to avoid issues, and this is in a
> > > > child process.
> > > >
> > > > Whatever I'm missing here surely also applies to igt_assert as well?
> > > >
> > > Darn it ... got the wrong function which explains the confusion.
> > >
> > > In particular igt_skip() isn't propagated properly within a
> > > igt_fork(), as documented [1].
> > > This results in a) the test failing [2] (instead of skipping) with b)
> > > semi-magical trace.
> > >
> > > If the IGT team is happy with those pitfalls, I can switch to igt_require :-)
> > >
> > > [1] https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_core.h#L1045
> > > [2] igt_skip: Assertion `"!test_child` failed
> >
> > Ah, now I see!
> >
> > Indeed skip isn't propagated properly and we should get that fixed at
> > some point. No need to hold your patch as hostage though.
> >
> AFAICT I'm the only person who ever dares running tests as non-root,
> which explains the current state ;-)

Yeah generally we just assume tests are run as root and we lack the
necessary checks on the tests that do require root. =(

> > With a comment that states that skip is not properly propagated from
> > child processes, keep the igt_assert and __drm_open_driver() usage in
> > check_drop_set().
> 
> Ack, comment tweaked.
> 
> > There's igt_assert_fd() btw for a shorthand check
> > for fd != -1.
> >
> See my comment below.
> 
> > The second subtest can use igt_require though, by way of using
> > drm_open_driver().
> >
> Do you really mean "second" aka "master-drop-set-user" here?
> Above you're agree with using igt_assert(), yet here you suggest
> (again) for igt_require()...
> 
> I'm confused :-\

Sorry, the first subtest is so small that it slipped from my eyes. I
mean the last subtest, the shared-fd one. The one that opens the
driver in the main process.

> 
> drm_open_driver() does not look like a good solution here.
> In particular we're testing core DRM functionality so anything GEM
> (like in the embedded gem_quiescent_gpu call) is irrelevant.
> 
> Additionally, both gem_quiescent_gpu and the atexit handler require
> root to drop the caches, et al.
> 
> Thinking about it, you're likely talking about the 3rd subtest aka
> "master-drop-set-shared-fd". Sure we can use igt_require() there,
> although I'd rather keep the__drm_open_driver() + igt_require()
> combination.
> 
> Do you agree?

For i915, gem_quiescent_gpu and pals are required so pending work
failing is reported on the correct test. Without that done, results
are hilariously racy.



> 
> >
> > >
> > >
> > > >
> > > > > +      * - there is _no_ guarantee that we'll open a device handled by
> > > > > +      * tweak_perm()
> > > >
> > > > This is a point that came to mind later, the building blocks for that
> > > > guarantee are in igt_device_scan.
> > > >
> > > > 1) If filter already set (test being run with --device), use that
> > > >    filter (igt_device_filter_get or so). Otherwise loop through the
> > > >    generated card%u names, using drm:/dev/dri/card%u as the
> > > >    filter. igt_device_scan.c stuff already has a list of all possible
> > > >    devices but I don't see an easy way to get to the list.
> > > >
> > > > 2) igt_device_card_match() gets you a card
> > > >
> > > > 3) card->card should be the path to /dev/dri to chmod on
> > > >
> > > > 4) igt_open_card(card) gives you an fd to that card
> > > >
> > > Not entirely sure what you're suggesting here. Can you please elaborate?
> >
> > lib/igt_device_scan.[ch] is for device selection and you can use that
> > to make sure chown has hit the device drm_open_driver() is
> > opening. Although I wrote that comment thinking you only chmod one of
> > them but that was a misreading from my part, ignore this comment. You
> > chmod all of them. Even with --device usage chmoding all devices will
> > ensure the only way for chmodding not to be done is not having the
> > proper kernel modules modprobed. Which drm_open_driver will do. Yikes.
> >
> > Which luckily brings us to the best of both worlds. In the igt_fixture
> > before the first subtest:
> >
> > /* Ensure modules are loaded and the device file exists */
> > close(drm_open_driver(DRIVER_ANY));
> >
> > Now having the igt_assert (as opposed to igt_require()) in the child
> > process makes even more sense.
> >
> Thinking about it close(drm_open_driver(...)) looks like a workaround,
> instead of addressing the issue.
> Even though it seems like it might work, the modprobe machinery seems partial:
>  - in the non i915 case, modprobe failure is a _debug_ message

igt_warn("Could not load i915\n");

Looks like a warn to me.

>  - the DRIVER_FOO to module name mapping is partial

Yes, we don't have all of them, but we should have all that have
module reloading tests.

>  - for some drivers, the module name differs from the name in
     drmGetVersion()

Hence the special cased modprobe hook for i915 and the now-removed
virtio-gpu.

>  - some drivers have changed their module name

The ones we modprobe in IGT don't seem to have?


Now, for i915 in particular since we do a load of module reload
testing, our required semantics for tests are to leave the state of
the system at test exit time in either

1) module is loaded and working
2) module not loaded

For i915, not doing drm_open_driver() first means you don't have
/dev/dri/card0 if the previously run test is something from
i915_module_load.

See commit 676d031e6bd9 for a related fix.


> > In general, use igt_assert_eq(x, y) instead of igt_assert(x == y) to
> > get better error messages on failure, as it prints the values of both
> > operands. However, for values that are already just booleans, plain
> > igt_assert() reads a bit better.
> >
> From a quick look:
>  - 700+ instances of igt_assert(... == ...)
>  - 200+ instances of igt_assert(... != ...)
>  - 10+ instances of igt_assert_[n]eq(... {true,false})
>  - 200+ instances of igt_assert_fd permutations >= 0, < 0, -1
> 
> While I agree on the readability aspect, as-is we're in a pretty weird
> spot. How about we a) document b) add basic CI plumbing (so reviewers
> don't need to spend brain cycles) and c) update the existing codebase
> in few large commits?

Weird spot is a good name for this state. a+c gets +1 from me, and b
in principle but I don't know how feasible it is to implement.

There's lib/igt.cocci that hasn't been touched in a while...

> None of which seems like a blocker for this patch IMHO.

No, definitely not blocking this!


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-04 14:17         ` Petri Latvala
@ 2020-03-06 14:17           ` Emil Velikov
  2020-03-06 14:28             ` Petri Latvala
  0 siblings, 1 reply; 14+ messages in thread
From: Emil Velikov @ 2020-03-06 14:17 UTC (permalink / raw)
  To: Petri Latvala; +Cc: IGT development

On Wed, 4 Mar 2020 at 14:17, Petri Latvala <petri.latvala@intel.com> wrote:

[snip]
> > Thinking about it, you're likely talking about the 3rd subtest aka
> > "master-drop-set-shared-fd". Sure we can use igt_require() there,
> > although I'd rather keep the__drm_open_driver() + igt_require()
> > combination.
> >
> > Do you agree?
>
> For i915, gem_quiescent_gpu and pals are required so pending work
> failing is reported on the correct test. Without that done, results
> are hilariously racy.
>
Sure I get that, yet there is _no_ work being done in these tests.

[snip]
> > Thinking about it close(drm_open_driver(...)) looks like a workaround,
> > instead of addressing the issue.
> > Even though it seems like it might work, the modprobe machinery seems partial:
> >  - in the non i915 case, modprobe failure is a _debug_ message
>
> igt_warn("Could not load i915\n");
>
> Looks like a warn to me.
>
Note: _non_ i915 case.

> >  - the DRIVER_FOO to module name mapping is partial
>
> Yes, we don't have all of them, but we should have all that have
> module reloading tests.
>
Agreed, yet this is not a module reloading test.

> >  - for some drivers, the module name differs from the name in
>      drmGetVersion()
>
> Hence the special cased modprobe hook for i915 and the now-removed
> virtio-gpu.
>
Virtio-gpu is a perfect example.

> >  - some drivers have changed their module name
>
> The ones we modprobe in IGT don't seem to have?
>
>
> Now, for i915 in particular since we do a load of module reload
> testing, our required semantics for tests are to leave the state of
> the system at test exit time in either
>
> 1) module is loaded and working
> 2) module not loaded
>
> For i915, not doing drm_open_driver() first means you don't have
> /dev/dri/card0 if the previously run test is something from
> i915_module_load.
>
> See commit 676d031e6bd9 for a related fix.
>
I agree with the point of having reloading tests, so having a modprobe
machinery, of sorts, makes sense.

Here we are relying on the _partial_ machinery to workaround a
extremely unlikely corner-case.
Given the probability of actually needing that WA is negligible, we
might as well omit it.

Tl:Dr; let's use __drm_open_driver() + igt_require() for
"master-drop-set-shared-fd"

Shall I sent v4 with that?


[snip]
>
> Weird spot is a good name for this state. a+c gets +1 from me, and b
> in principle but I don't know how feasible it is to implement.
>
> There's lib/igt.cocci that hasn't been touched in a while...
>
Doubt I'll get to cocci it - a quick grep job will do for the initial run.

Will post some patches after this test is finished.

Thanks
-Emil
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-06 14:17           ` Emil Velikov
@ 2020-03-06 14:28             ` Petri Latvala
  2020-03-06 16:32               ` Emil Velikov
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2020-03-06 14:28 UTC (permalink / raw)
  To: Emil Velikov; +Cc: IGT development

On Fri, Mar 06, 2020 at 02:17:07PM +0000, Emil Velikov wrote:
> On Wed, 4 Mar 2020 at 14:17, Petri Latvala <petri.latvala@intel.com> wrote:
> 
> [snip]
> > > Thinking about it, you're likely talking about the 3rd subtest aka
> > > "master-drop-set-shared-fd". Sure we can use igt_require() there,
> > > although I'd rather keep the__drm_open_driver() + igt_require()
> > > combination.
> > >
> > > Do you agree?
> >
> > For i915, gem_quiescent_gpu and pals are required so pending work
> > failing is reported on the correct test. Without that done, results
> > are hilariously racy.
> >
> Sure I get that, yet there is _no_ work being done in these tests.
> 
> [snip]
> > > Thinking about it close(drm_open_driver(...)) looks like a workaround,
> > > instead of addressing the issue.
> > > Even though it seems like it might work, the modprobe machinery seems partial:
> > >  - in the non i915 case, modprobe failure is a _debug_ message
> >
> > igt_warn("Could not load i915\n");
> >
> > Looks like a warn to me.
> >
> Note: _non_ i915 case.

I need glasses. Yes, the other probes have debug messages.

> > >  - the DRIVER_FOO to module name mapping is partial
> >
> > Yes, we don't have all of them, but we should have all that have
> > module reloading tests.
> >
> Agreed, yet this is not a module reloading test.

I mean that we modprobe all drivers that have module loading tests, or
otherwise special module handling. This test not being a module
reloading test doesn't matter, see example below.

> > >  - for some drivers, the module name differs from the name in
> >      drmGetVersion()
> >
> > Hence the special cased modprobe hook for i915 and the now-removed
> > virtio-gpu.
> >
> Virtio-gpu is a perfect example.

And we don't modprobe that anymore.


> > >  - some drivers have changed their module name
> >
> > The ones we modprobe in IGT don't seem to have?
> >
> >
> > Now, for i915 in particular since we do a load of module reload
> > testing, our required semantics for tests are to leave the state of
> > the system at test exit time in either
> >
> > 1) module is loaded and working
> > 2) module not loaded
> >
> > For i915, not doing drm_open_driver() first means you don't have
> > /dev/dri/card0 if the previously run test is something from
> > i915_module_load.
> >
> > See commit 676d031e6bd9 for a related fix.
> >
> I agree with the point of having reloading tests, so having a modprobe
> machinery, of sorts, makes sense.
> 
> Here we are relying on the _partial_ machinery to workaround a
> extremely unlikely corner-case.

It is _extremely_ likely that we (i915 CI) could sometimes run
igt@i915_module_load@reload right before this test. Or
igt@i915_selftest@live. When we do, there's no /dev/dri/card0 at the
time of chmodding but is at the time of __drm_open_driver().


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-06 14:28             ` Petri Latvala
@ 2020-03-06 16:32               ` Emil Velikov
  2020-03-09 11:01                 ` Petri Latvala
  0 siblings, 1 reply; 14+ messages in thread
From: Emil Velikov @ 2020-03-06 16:32 UTC (permalink / raw)
  To: Petri Latvala; +Cc: IGT development

On Fri, 6 Mar 2020 at 14:28, Petri Latvala <petri.latvala@intel.com> wrote:

> It is _extremely_ likely that we (i915 CI) could sometimes run
> igt@i915_module_load@reload right before this test. Or
> igt@i915_selftest@live. When we do, there's no /dev/dri/card0 at the
> time of chmodding but is at the time of __drm_open_driver().
>
If I understand you correctly, if a test which does rmmod/modprobe
fails, the CI will still continue to run other tests.

Personally it seems to me that any follow-up tests would be
'incorrect' or misleading at the very least.
As such I imagined that the CI will stop at this point.

If that's doable and something people are interested in, as follow-up
one can drop the implicit modprobe from _all_ the drm_open_driver()
calls. Thus getting IGT coverage closer to a real-world use-case - aka
udev does the loading.

Either way, all of this is a brain dump which illustrates my confusion
on the topic.
Thanks a million for the help.

Will send v4 with the workaround + a comment in a moment.

-Emil
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-06 16:32               ` Emil Velikov
@ 2020-03-09 11:01                 ` Petri Latvala
  2020-03-09 13:53                   ` Emil Velikov
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2020-03-09 11:01 UTC (permalink / raw)
  To: Emil Velikov; +Cc: IGT development

On Fri, Mar 06, 2020 at 04:32:19PM +0000, Emil Velikov wrote:
> On Fri, 6 Mar 2020 at 14:28, Petri Latvala <petri.latvala@intel.com> wrote:
> 
> > It is _extremely_ likely that we (i915 CI) could sometimes run
> > igt@i915_module_load@reload right before this test. Or
> > igt@i915_selftest@live. When we do, there's no /dev/dri/card0 at the
> > time of chmodding but is at the time of __drm_open_driver().
> >
> If I understand you correctly, if a test which does rmmod/modprobe
> fails, the CI will still continue to run other tests.

It's worse than that. All subtests of i915_module_load except @reload
leave the module unloaded also on _success_. i915_selftest likewise
leaves the module unloaded. If they loaded the module back on success,
running module loading tests back-to-back would do an additional
module reload roundtrip.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics
  2020-03-09 11:01                 ` Petri Latvala
@ 2020-03-09 13:53                   ` Emil Velikov
  0 siblings, 0 replies; 14+ messages in thread
From: Emil Velikov @ 2020-03-09 13:53 UTC (permalink / raw)
  To: Petri Latvala; +Cc: IGT development

On Mon, 9 Mar 2020 at 11:01, Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Fri, Mar 06, 2020 at 04:32:19PM +0000, Emil Velikov wrote:
> > On Fri, 6 Mar 2020 at 14:28, Petri Latvala <petri.latvala@intel.com> wrote:
> >
> > > It is _extremely_ likely that we (i915 CI) could sometimes run
> > > igt@i915_module_load@reload right before this test. Or
> > > igt@i915_selftest@live. When we do, there's no /dev/dri/card0 at the
> > > time of chmodding but is at the time of __drm_open_driver().
> > >
> > If I understand you correctly, if a test which does rmmod/modprobe
> > fails, the CI will still continue to run other tests.
>
> It's worse than that. All subtests of i915_module_load except @reload
> leave the module unloaded also on _success_. i915_selftest likewise
> leaves the module unloaded. If they loaded the module back on success,
> running module loading tests back-to-back would do an additional
> module reload roundtrip.
>
Ouch, this sounds pretty nasty....

Pretty much all other tests ensure the state is restored as original upon exit.
So it would make sense to fix these by adding modprobe as a closing fixture.

Regardless, v4 [1] has the close(open(...)) workaround which should
cater for this.

Thanks again for the time in explaining these IGT subtleties.
-Emil

[1] https://lists.freedesktop.org/archives/igt-dev/2020-March/021081.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-03-09 13:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 17:33 [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Emil Velikov
2020-03-02 18:52 ` [igt-dev] ✓ Fi.CI.BAT: success for ts/core_setmaster: new test for drop/set master semantics (rev3) Patchwork
2020-03-03  8:03 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-03 13:13 ` [igt-dev] [PATCH i-g-t v3] ts/core_setmaster: new test for drop/set master semantics Petri Latvala
2020-03-03 14:46   ` Emil Velikov
2020-03-04 11:25     ` Petri Latvala
2020-03-04 13:26       ` Emil Velikov
2020-03-04 14:17         ` Petri Latvala
2020-03-06 14:17           ` Emil Velikov
2020-03-06 14:28             ` Petri Latvala
2020-03-06 16:32               ` Emil Velikov
2020-03-09 11:01                 ` Petri Latvala
2020-03-09 13:53                   ` Emil Velikov
2020-03-03 13:13 ` Petri Latvala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.