All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-01-22 16:26 ` Janusz Krzysztofik
  0 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-01-22 16:26 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Matthew Auld

Working with a userptr GEM object backed by any type of mapping to
another GEM object, not only GTT mapping currently examined bu the
test, may cause a currently unavoidable lockdep splat inside the i915
driver.  Then, such operations are expected to fail in advance to
prevent from that badness to happen.

Extend the scope of the test by adding subtests which exercise other,
non-GTT mapping types.  Moreover, also succeed if a failure happens
as soon as a userptr object is created on top of an invalid mapping.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
 1 file changed, 59 insertions(+), 28 deletions(-)

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index a8d3783f..69e5bd1f 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -60,6 +60,7 @@
 
 #include "drm.h"
 #include "i915_drm.h"
+#include "i915/gem_mman.h"
 
 #include "intel_bufmgr.h"
 
@@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
 	return 0;
 }
 
-static int test_invalid_gtt_mapping(int fd)
+static int test_invalid_mapping(int fd, uint64_t flags)
 {
-	struct drm_i915_gem_mmap_gtt arg;
+	struct drm_i915_gem_mmap_offset arg;
 	uint32_t handle;
-	char *gtt, *map;
+	char *offset, *map;
 
 	/* Anonymous mapping to find a hole */
 	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
@@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
 	igt_assert_eq(copy(fd, handle, handle), 0);
 	gem_close(fd, handle);
 
-	/* GTT mapping */
+	/* object mapping */
 	memset(&arg, 0, sizeof(arg));
 	arg.handle = create_bo(fd, 0);
-	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
-	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
-		   PROT_READ | PROT_WRITE,
-		   MAP_SHARED | MAP_FIXED,
-		   fd, arg.offset);
-	igt_assert(gtt == map + PAGE_SIZE);
+	arg.flags = flags;
+	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
+	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
+		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
+	igt_assert(offset == map + PAGE_SIZE);
 	gem_close(fd, arg.handle);
-	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
+	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
 	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
 
-	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
+	    &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
+	    0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
 	/* boundaries */
-	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
+	    userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
 	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
 
@@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
 		igt_subtest("invalid-null-pointer")
 			test_invalid_null_pointer(fd);
 
-		igt_subtest("invalid-gtt-mapping")
-			test_invalid_gtt_mapping(fd);
+		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
+		igt_subtest("invalid-gtt-mapping") {
+			gem_require_mappable_ggtt(fd);
+			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
+		}
+		igt_subtest_group {
+			igt_fixture
+				igt_require(gem_has_mmap_offset(fd));
+
+			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
+			igt_subtest("invalid-wb-mapping")
+				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
+
+			igt_subtest_group {
+				igt_fixture
+					igt_require(gem_mmap_offset__has_wc(fd));
+
+				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
+				igt_subtest("invalid-wc-mapping")
+					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
+				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
+				igt_subtest("invalid-uc-mapping")
+					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
+			}
+		}
 
 		igt_subtest("forked-access")
 			test_forked_access(fd);
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-01-22 16:26 ` Janusz Krzysztofik
  0 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-01-22 16:26 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Matthew Auld

Working with a userptr GEM object backed by any type of mapping to
another GEM object, not only GTT mapping currently examined bu the
test, may cause a currently unavoidable lockdep splat inside the i915
driver.  Then, such operations are expected to fail in advance to
prevent from that badness to happen.

Extend the scope of the test by adding subtests which exercise other,
non-GTT mapping types.  Moreover, also succeed if a failure happens
as soon as a userptr object is created on top of an invalid mapping.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
 1 file changed, 59 insertions(+), 28 deletions(-)

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index a8d3783f..69e5bd1f 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -60,6 +60,7 @@
 
 #include "drm.h"
 #include "i915_drm.h"
+#include "i915/gem_mman.h"
 
 #include "intel_bufmgr.h"
 
@@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
 	return 0;
 }
 
-static int test_invalid_gtt_mapping(int fd)
+static int test_invalid_mapping(int fd, uint64_t flags)
 {
-	struct drm_i915_gem_mmap_gtt arg;
+	struct drm_i915_gem_mmap_offset arg;
 	uint32_t handle;
-	char *gtt, *map;
+	char *offset, *map;
 
 	/* Anonymous mapping to find a hole */
 	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
@@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
 	igt_assert_eq(copy(fd, handle, handle), 0);
 	gem_close(fd, handle);
 
-	/* GTT mapping */
+	/* object mapping */
 	memset(&arg, 0, sizeof(arg));
 	arg.handle = create_bo(fd, 0);
-	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
-	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
-		   PROT_READ | PROT_WRITE,
-		   MAP_SHARED | MAP_FIXED,
-		   fd, arg.offset);
-	igt_assert(gtt == map + PAGE_SIZE);
+	arg.flags = flags;
+	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
+	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
+		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
+	igt_assert(offset == map + PAGE_SIZE);
 	gem_close(fd, arg.handle);
-	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
+	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
 	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
 
-	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
+	    &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
+	    0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
 	/* boundaries */
-	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
-	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
-	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
-	gem_close(fd, handle);
+	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
+	    userptr_flags, &handle)) {
+		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
+		gem_close(fd, handle);
+	}
 
 	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
 
@@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
 		igt_subtest("invalid-null-pointer")
 			test_invalid_null_pointer(fd);
 
-		igt_subtest("invalid-gtt-mapping")
-			test_invalid_gtt_mapping(fd);
+		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
+		igt_subtest("invalid-gtt-mapping") {
+			gem_require_mappable_ggtt(fd);
+			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
+		}
+		igt_subtest_group {
+			igt_fixture
+				igt_require(gem_has_mmap_offset(fd));
+
+			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
+			igt_subtest("invalid-wb-mapping")
+				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
+
+			igt_subtest_group {
+				igt_fixture
+					igt_require(gem_mmap_offset__has_wc(fd));
+
+				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
+				igt_subtest("invalid-wc-mapping")
+					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
+				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
+				igt_subtest("invalid-uc-mapping")
+					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
+			}
+		}
 
 		igt_subtest("forked-access")
 			test_forked_access(fd);
-- 
2.21.0

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-22 16:26 ` [igt-dev] " Janusz Krzysztofik
  (?)
@ 2020-01-22 18:19 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2020-01-22 18:19 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: igt-dev

== Series Details ==

Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
URL   : https://patchwork.freedesktop.org/series/72411/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7794 -> IGTPW_3969
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with IGTPW_3969 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3969, 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_3969/index.html

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

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

### IGT changes ###

#### Warnings ####

  * igt@gem_exec_parallel@contexts:
    - fi-byt-j1900:       [TIMEOUT][1] ([fdo#112271]) -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-byt-j1900/igt@gem_exec_parallel@contexts.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-byt-j1900/igt@gem_exec_parallel@contexts.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-cfl-guc:         [PASS][3] -> [DMESG-WARN][4] ([i915#889])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-cfl-guc/igt@i915_module_load@reload-with-fault-injection.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-cfl-guc/igt@i915_module_load@reload-with-fault-injection.html
    - fi-skl-lmem:        [PASS][5] -> [DMESG-WARN][6] ([i915#889])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-skl-lmem/igt@i915_module_load@reload-with-fault-injection.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-skl-lmem/igt@i915_module_load@reload-with-fault-injection.html

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770r:       [PASS][7] -> [DMESG-FAIL][8] ([i915#725])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-hsw-4770r/igt@i915_selftest@live_blt.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-hsw-4770r/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_hangcheck:
    - fi-icl-u3:          [PASS][9] -> [INCOMPLETE][10] ([fdo#108569] / [i915#140])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-icl-u3/igt@i915_selftest@live_hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-icl-u3/igt@i915_selftest@live_hangcheck.html

  
#### Possible fixes ####

  * igt@gem_exec_parallel@fds:
    - fi-byt-n2820:       [INCOMPLETE][11] ([i915#45]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-byt-n2820/igt@gem_exec_parallel@fds.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-byt-n2820/igt@gem_exec_parallel@fds.html

  * igt@i915_selftest@live_gt_lrc:
    - fi-skl-6600u:       [DMESG-FAIL][13] ([i915#889]) -> [PASS][14] +7 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-skl-6600u/igt@i915_selftest@live_gt_lrc.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-skl-6600u/igt@i915_selftest@live_gt_lrc.html

  * igt@i915_selftest@live_late_gt_pm:
    - fi-skl-6600u:       [DMESG-WARN][15] ([i915#889]) -> [PASS][16] +23 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-skl-6600u/igt@i915_selftest@live_late_gt_pm.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-skl-6600u/igt@i915_selftest@live_late_gt_pm.html

  
#### Warnings ####

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-icl-u2:          [DMESG-WARN][17] ([IGT#4] / [i915#263]) -> [FAIL][18] ([i915#217])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/fi-icl-u2/igt@kms_chamelium@common-hpd-after-suspend.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/fi-icl-u2/igt@kms_chamelium@common-hpd-after-suspend.html

  
  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#217]: https://gitlab.freedesktop.org/drm/intel/issues/217
  [i915#263]: https://gitlab.freedesktop.org/drm/intel/issues/263
  [i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#889]: https://gitlab.freedesktop.org/drm/intel/issues/889


Participating hosts (53 -> 47)
------------------------------

  Additional (1): fi-kbl-7560u 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5377 -> IGTPW_3969

  CI-20190529: 20190529
  CI_DRM_7794: 00c5afbc7dc1d8e5cecea7a4369320d6ba99a5b8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3969: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/index.html
  IGT_5377: 1e6cb3e75925cf623df04f78430ae9299632ec3f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_userptr_blits@invalid-uc-mapping
+igt@gem_userptr_blits@invalid-wb-mapping
+igt@gem_userptr_blits@invalid-wc-mapping

== Logs ==

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

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

* [igt-dev] ✗ GitLab.Pipeline: warning for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-22 16:26 ` [igt-dev] " Janusz Krzysztofik
  (?)
  (?)
@ 2020-01-23 13:51 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2020-01-23 13:51 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: igt-dev

== Series Details ==

Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
URL   : https://patchwork.freedesktop.org/series/72411/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/100017 for the overview.

test:ninja-test-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1426330):
   #7 [main+0x30]
   #8 [__libc_start_main+0xe4]
   #9 [_start+0x34]
  qemu: uncaught target signal 6 (Aborted) - core dumped
  -------
  
  Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
  FAILED: meson-test 
  /usr/bin/meson test --no-rebuild --print-errorlogs
  ninja: build stopped: subcommand failed.
  section_end:1579716185:build_script
  ^[[0Ksection_start:1579716185:after_script
  ^[[0Ksection_end:1579716189:after_script
  ^[[0Ksection_start:1579716189:upload_artifacts_on_failure
  ^[[0K^[[32;1mUploading artifacts...^[[0;m
  build: found 1376 matching files                  ^[[0;m 
  Uploading artifacts to coordinator... ok          ^[[0;m  id^[[0;m=1426330 responseStatus^[[0;m=201 Created token^[[0;m=udgXWGTC
  section_end:1579716200:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

test:ninja-test-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1426504):
   #7 [main+0x30]
   #8 [__libc_start_main+0xe4]
   #9 [_start+0x34]
  qemu: uncaught target signal 6 (Aborted) - core dumped
  -------
  
  Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
  FAILED: meson-test 
  /usr/bin/meson test --no-rebuild --print-errorlogs
  ninja: build stopped: subcommand failed.
  section_end:1579716260:build_script
  ^[[0Ksection_start:1579716260:after_script
  ^[[0Ksection_end:1579716262:after_script
  ^[[0Ksection_start:1579716262:upload_artifacts_on_failure
  ^[[0K^[[32;1mUploading artifacts...^[[0;m
  build: found 1376 matching files                  ^[[0;m 
  Uploading artifacts to coordinator... ok          ^[[0;m  id^[[0;m=1426504 responseStatus^[[0;m=201 Created token^[[0;m=23syp2wr
  section_end:1579716278:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

test:ninja-test-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/1426505):
   #7 [main+0x30]
   #8 [__libc_start_main+0xe4]
   #9 [_start+0x34]
  qemu: uncaught target signal 6 (Aborted) - core dumped
  -------
  
  Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
  FAILED: meson-test 
  /usr/bin/meson test --no-rebuild --print-errorlogs
  ninja: build stopped: subcommand failed.
  section_end:1579716357:build_script
  ^[[0Ksection_start:1579716357:after_script
  ^[[0Ksection_end:1579716359:after_script
  ^[[0Ksection_start:1579716359:upload_artifacts_on_failure
  ^[[0K^[[32;1mUploading artifacts...^[[0;m
  build: found 1377 matching files                  ^[[0;m 
  Uploading artifacts to coordinator... ok          ^[[0;m  id^[[0;m=1426505 responseStatus^[[0;m=201 Created token^[[0;m=ezeXgLcT
  section_end:1579716369:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/100017
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-22 16:26 ` [igt-dev] " Janusz Krzysztofik
                   ` (2 preceding siblings ...)
  (?)
@ 2020-01-23 20:22 ` Patchwork
  2020-01-29 11:24   ` Chris Wilson
  -1 siblings, 1 reply; 15+ messages in thread
From: Patchwork @ 2020-01-23 20:22 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: igt-dev

== Series Details ==

Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
URL   : https://patchwork.freedesktop.org/series/72411/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

New tests
---------

  New tests have been introduced between CI_DRM_7794_full and IGTPW_3969_full:

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

  * igt@gem_userptr_blits@invalid-uc-mapping:
    - Statuses : 7 pass(s)
    - Exec time: [0.01, 0.02] s

  * igt@gem_userptr_blits@invalid-wb-mapping:
    - Statuses : 7 pass(s)
    - Exec time: [0.01, 0.02] s

  * igt@gem_userptr_blits@invalid-wc-mapping:
    - Statuses : 7 pass(s)
    - Exec time: [0.01, 0.02] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-iclb:         [PASS][1] -> [INCOMPLETE][2] ([fdo#109100] / [i915#140])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb5/igt@gem_ctx_isolation@bcs0-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb2/igt@gem_ctx_isolation@bcs0-s3.html

  * igt@gem_ctx_persistence@vcs1-mixed-process:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#109276] / [fdo#112080]) +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@gem_ctx_persistence@vcs1-mixed-process.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb6/igt@gem_ctx_persistence@vcs1-mixed-process.html

  * igt@gem_exec_reloc@basic-gtt-cpu:
    - shard-snb:          [PASS][5] -> [DMESG-WARN][6] ([i915#478])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb6/igt@gem_exec_reloc@basic-gtt-cpu.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb1/igt@gem_exec_reloc@basic-gtt-cpu.html

  * igt@gem_exec_schedule@preempt-contexts-bsd2:
    - shard-iclb:         [PASS][7] -> [SKIP][8] ([fdo#109276]) +14 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@gem_exec_schedule@preempt-contexts-bsd2.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb3/igt@gem_exec_schedule@preempt-contexts-bsd2.html

  * igt@gem_exec_schedule@wide-bsd:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([fdo#112146]) +6 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb8/igt@gem_exec_schedule@wide-bsd.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb4/igt@gem_exec_schedule@wide-bsd.html

  * igt@gem_persistent_relocs@forked-faulting-reloc-thrashing:
    - shard-iclb:         [PASS][11] -> [INCOMPLETE][12] ([i915#140])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb6/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb5/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html

  * igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing:
    - shard-glk:          [PASS][13] -> [INCOMPLETE][14] ([i915#58] / [i915#970] / [k.org#198133])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-glk3/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-glk3/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html

  * igt@gem_persistent_relocs@forked-interruptible-thrash-inactive:
    - shard-snb:          [PASS][15] -> [INCOMPLETE][16] ([i915#82])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb5/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb6/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html

  * igt@gem_persistent_relocs@forked-thrash-inactive:
    - shard-snb:          [PASS][17] -> [DMESG-WARN][18] ([fdo#110789] / [i915#478])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb6/igt@gem_persistent_relocs@forked-thrash-inactive.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb1/igt@gem_persistent_relocs@forked-thrash-inactive.html
    - shard-hsw:          [PASS][19] -> [INCOMPLETE][20] ([i915#61]) +1 similar issue
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-hsw8/igt@gem_persistent_relocs@forked-thrash-inactive.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-hsw6/igt@gem_persistent_relocs@forked-thrash-inactive.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-snb:          [PASS][21] -> [DMESG-WARN][22] ([fdo#110789] / [fdo#111870] / [i915#478])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb2/igt@gem_userptr_blits@sync-unmap-after-close.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb6/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@i915_pm_dc@dc5-dpms:
    - shard-iclb:         [PASS][23] -> [FAIL][24] ([i915#447])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb5/igt@i915_pm_dc@dc5-dpms.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb3/igt@i915_pm_dc@dc5-dpms.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][25] -> [FAIL][26] ([i915#454])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@i915_pm_dc@dc6-psr.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb6/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_selftest@mock_requests:
    - shard-tglb:         [PASS][27] -> [INCOMPLETE][28] ([i915#472]) +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-tglb1/igt@i915_selftest@mock_requests.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-tglb7/igt@i915_selftest@mock_requests.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][29] -> [INCOMPLETE][30] ([fdo#103665]) +2 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen:
    - shard-apl:          [PASS][31] -> [FAIL][32] ([i915#54])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl7/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [PASS][33] -> [DMESG-WARN][34] ([i915#180]) +4 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_flip@2x-flip-vs-wf_vblank:
    - shard-glk:          [PASS][35] -> [FAIL][36] ([i915#34])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-glk6/igt@kms_flip@2x-flip-vs-wf_vblank.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-glk2/igt@kms_flip@2x-flip-vs-wf_vblank.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-apl:          [PASS][37] -> [DMESG-WARN][38] ([i915#180]) +2 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl8/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
    - shard-tglb:         [PASS][39] -> [FAIL][40] ([i915#49]) +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-tglb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-tglb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [PASS][41] -> [SKIP][42] ([fdo#109441]) +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb8/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@perf_pmu@busy-vcs1:
    - shard-iclb:         [PASS][43] -> [SKIP][44] ([fdo#112080]) +9 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb2/igt@perf_pmu@busy-vcs1.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb7/igt@perf_pmu@busy-vcs1.html

  
#### Possible fixes ####

  * igt@gem_ctx_isolation@vcs1-none:
    - shard-iclb:         [SKIP][45] ([fdo#109276] / [fdo#112080]) -> [PASS][46] +2 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb5/igt@gem_ctx_isolation@vcs1-none.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb4/igt@gem_ctx_isolation@vcs1-none.html

  * igt@gem_exec_create@forked:
    - shard-glk:          [INCOMPLETE][47] ([i915#58] / [k.org#198133]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-glk9/igt@gem_exec_create@forked.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-glk4/igt@gem_exec_create@forked.html

  * igt@gem_exec_parallel@vcs1-fds:
    - shard-iclb:         [SKIP][49] ([fdo#112080]) -> [PASS][50] +11 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb6/igt@gem_exec_parallel@vcs1-fds.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb1/igt@gem_exec_parallel@vcs1-fds.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
    - shard-iclb:         [SKIP][51] ([i915#677]) -> [PASS][52] +1 similar issue
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@gem_exec_schedule@pi-distinct-iova-bsd.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb7/igt@gem_exec_schedule@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preempt-bsd:
    - shard-iclb:         [SKIP][53] ([fdo#112146]) -> [PASS][54] +3 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@gem_exec_schedule@preempt-bsd.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb8/igt@gem_exec_schedule@preempt-bsd.html

  * igt@gem_mmap_gtt@basic-small-bo-tiledy:
    - shard-snb:          [DMESG-WARN][55] ([i915#478]) -> [PASS][56] +1 similar issue
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb2/igt@gem_mmap_gtt@basic-small-bo-tiledy.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb4/igt@gem_mmap_gtt@basic-small-bo-tiledy.html

  * igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing:
    - shard-apl:          [INCOMPLETE][57] ([fdo#103927] / [i915#970]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl7/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl4/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
    - shard-kbl:          [INCOMPLETE][59] ([fdo#103665] / [i915#970]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-kbl7/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-kbl1/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html

  * igt@gem_persistent_relocs@forked-interruptible-thrash-inactive:
    - shard-hsw:          [INCOMPLETE][61] ([i915#530] / [i915#61]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-hsw7/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-hsw5/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html

  * igt@gem_persistent_relocs@forked-interruptible-thrashing:
    - shard-apl:          [INCOMPLETE][63] ([fdo#103927]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl1/igt@gem_persistent_relocs@forked-interruptible-thrashing.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl4/igt@gem_persistent_relocs@forked-interruptible-thrashing.html

  * igt@gem_persistent_relocs@forked-thrashing:
    - shard-tglb:         [INCOMPLETE][65] ([i915#472]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-tglb1/igt@gem_persistent_relocs@forked-thrashing.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-tglb6/igt@gem_persistent_relocs@forked-thrashing.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-apl:          [FAIL][67] ([i915#644]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl2/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl4/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gem_userptr_blits@sync-unmap-cycles:
    - shard-snb:          [DMESG-WARN][69] ([fdo#111870] / [i915#478]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb6/igt@gem_userptr_blits@sync-unmap-cycles.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb1/igt@gem_userptr_blits@sync-unmap-cycles.html

  * igt@i915_pm_rps@reset:
    - shard-iclb:         [FAIL][71] ([i915#413]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb8/igt@i915_pm_rps@reset.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb8/igt@i915_pm_rps@reset.html

  * igt@i915_selftest@mock_requests:
    - shard-kbl:          [INCOMPLETE][73] ([fdo#103665]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-kbl1/igt@i915_selftest@mock_requests.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-kbl2/igt@i915_selftest@mock_requests.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-apl:          [DMESG-WARN][75] ([i915#180]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-apl6/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_frontbuffer_tracking@fbc-rgb565-draw-render:
    - shard-tglb:         [FAIL][77] ([i915#49]) -> [PASS][78] +7 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-tglb4/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-render.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-tglb1/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-render.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          [DMESG-WARN][79] ([i915#180]) -> [PASS][80] +4 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-kbl1/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][81] ([fdo#109441]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@kms_psr@psr2_primary_mmap_cpu.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@prime_vgem@fence-wait-bsd2:
    - shard-iclb:         [SKIP][83] ([fdo#109276]) -> [PASS][84] +22 similar issues
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb8/igt@prime_vgem@fence-wait-bsd2.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb1/igt@prime_vgem@fence-wait-bsd2.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [FAIL][85] ([IGT#28]) -> [SKIP][86] ([fdo#109276] / [fdo#112080])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-iclb1/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-iclb3/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_tiled_blits@normal:
    - shard-hsw:          [FAIL][87] ([i915#818]) -> [FAIL][88] ([i915#694])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-hsw1/igt@gem_tiled_blits@normal.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-hsw5/igt@gem_tiled_blits@normal.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-snb:          [DMESG-WARN][89] ([fdo#111870] / [i915#478]) -> [DMESG-WARN][90] ([fdo#110789] / [fdo#111870] / [i915#478])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7794/shard-snb4/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/shard-snb2/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  
  [IGT#28]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/28
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#447]: https://gitlab.freedesktop.org/drm/intel/issues/447
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
  [i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#530]: https://gitlab.freedesktop.org/drm/intel/issues/530
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
  [i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
  [i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#970]: https://gitlab.freedesktop.org/drm/intel/issues/970
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

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


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5377 -> IGTPW_3969
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_7794: 00c5afbc7dc1d8e5cecea7a4369320d6ba99a5b8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3969: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/index.html
  IGT_5377: 1e6cb3e75925cf623df04f78430ae9299632ec3f @ 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_3969/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-22 16:26 ` [igt-dev] " Janusz Krzysztofik
@ 2020-01-28  0:59   ` Antonio Argenziano
  -1 siblings, 0 replies; 15+ messages in thread
From: Antonio Argenziano @ 2020-01-28  0:59 UTC (permalink / raw)
  To: Janusz Krzysztofik, igt-dev; +Cc: intel-gfx, Matthew Auld



On 22/01/20 08:26, Janusz Krzysztofik wrote:
> Working with a userptr GEM object backed by any type of mapping to
> another GEM object, not only GTT mapping currently examined bu the
> test, may cause a currently unavoidable lockdep splat inside the i915
> driver.  Then, such operations are expected to fail in advance to
> prevent from that badness to happen.
> 
> Extend the scope of the test by adding subtests which exercise other,
> non-GTT mapping types.  Moreover, also succeed if a failure happens
> as soon as a userptr object is created on top of an invalid mapping.
> 
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
>   tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
>   1 file changed, 59 insertions(+), 28 deletions(-)
> 
> diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> index a8d3783f..69e5bd1f 100644
> --- a/tests/i915/gem_userptr_blits.c
> +++ b/tests/i915/gem_userptr_blits.c
> @@ -60,6 +60,7 @@
>   
>   #include "drm.h"
>   #include "i915_drm.h"
> +#include "i915/gem_mman.h"
>   
>   #include "intel_bufmgr.h"
>   
> @@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
>   	return 0;
>   }
>   
> -static int test_invalid_gtt_mapping(int fd)
> +static int test_invalid_mapping(int fd, uint64_t flags)
>   {
> -	struct drm_i915_gem_mmap_gtt arg;
> +	struct drm_i915_gem_mmap_offset arg;
>   	uint32_t handle;
> -	char *gtt, *map;
> +	char *offset, *map;
>   
>   	/* Anonymous mapping to find a hole */
>   	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
> @@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
>   	igt_assert_eq(copy(fd, handle, handle), 0);
>   	gem_close(fd, handle);
>   
> -	/* GTT mapping */
> +	/* object mapping */
>   	memset(&arg, 0, sizeof(arg));
>   	arg.handle = create_bo(fd, 0);
> -	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
> -	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
> -		   PROT_READ | PROT_WRITE,
> -		   MAP_SHARED | MAP_FIXED,
> -		   fd, arg.offset);
> -	igt_assert(gtt == map + PAGE_SIZE);
> +	arg.flags = flags;
> +	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
> +	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
> +		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
> +	igt_assert(offset == map + PAGE_SIZE);
>   	gem_close(fd, arg.handle);
> -	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
> +	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
>   	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
>   
> -	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
> +	    &handle)) {

Not sure I follow why you converted this to an if. Do we expect the 
userptr IOCTL not to work? Could you add a small comment.

Antonio

> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
> +	    0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
>   	/* boundaries */
> -	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
> +	    userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
>   	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
>   
> @@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
>   		igt_subtest("invalid-null-pointer")
>   			test_invalid_null_pointer(fd);
>   
> -		igt_subtest("invalid-gtt-mapping")
> -			test_invalid_gtt_mapping(fd);
> +		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
> +		igt_subtest("invalid-gtt-mapping") {
> +			gem_require_mappable_ggtt(fd);
> +			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
> +		}
> +		igt_subtest_group {
> +			igt_fixture
> +				igt_require(gem_has_mmap_offset(fd));
> +
> +			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
> +			igt_subtest("invalid-wb-mapping")
> +				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
> +
> +			igt_subtest_group {
> +				igt_fixture
> +					igt_require(gem_mmap_offset__has_wc(fd));
> +
> +				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
> +				igt_subtest("invalid-wc-mapping")
> +					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
> +				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
> +				igt_subtest("invalid-uc-mapping")
> +					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
> +			}
> +		}
>   
>   		igt_subtest("forked-access")
>   			test_forked_access(fd);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-01-28  0:59   ` Antonio Argenziano
  0 siblings, 0 replies; 15+ messages in thread
From: Antonio Argenziano @ 2020-01-28  0:59 UTC (permalink / raw)
  To: Janusz Krzysztofik, igt-dev; +Cc: intel-gfx, Matthew Auld



On 22/01/20 08:26, Janusz Krzysztofik wrote:
> Working with a userptr GEM object backed by any type of mapping to
> another GEM object, not only GTT mapping currently examined bu the
> test, may cause a currently unavoidable lockdep splat inside the i915
> driver.  Then, such operations are expected to fail in advance to
> prevent from that badness to happen.
> 
> Extend the scope of the test by adding subtests which exercise other,
> non-GTT mapping types.  Moreover, also succeed if a failure happens
> as soon as a userptr object is created on top of an invalid mapping.
> 
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
>   tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
>   1 file changed, 59 insertions(+), 28 deletions(-)
> 
> diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> index a8d3783f..69e5bd1f 100644
> --- a/tests/i915/gem_userptr_blits.c
> +++ b/tests/i915/gem_userptr_blits.c
> @@ -60,6 +60,7 @@
>   
>   #include "drm.h"
>   #include "i915_drm.h"
> +#include "i915/gem_mman.h"
>   
>   #include "intel_bufmgr.h"
>   
> @@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
>   	return 0;
>   }
>   
> -static int test_invalid_gtt_mapping(int fd)
> +static int test_invalid_mapping(int fd, uint64_t flags)
>   {
> -	struct drm_i915_gem_mmap_gtt arg;
> +	struct drm_i915_gem_mmap_offset arg;
>   	uint32_t handle;
> -	char *gtt, *map;
> +	char *offset, *map;
>   
>   	/* Anonymous mapping to find a hole */
>   	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
> @@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
>   	igt_assert_eq(copy(fd, handle, handle), 0);
>   	gem_close(fd, handle);
>   
> -	/* GTT mapping */
> +	/* object mapping */
>   	memset(&arg, 0, sizeof(arg));
>   	arg.handle = create_bo(fd, 0);
> -	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
> -	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
> -		   PROT_READ | PROT_WRITE,
> -		   MAP_SHARED | MAP_FIXED,
> -		   fd, arg.offset);
> -	igt_assert(gtt == map + PAGE_SIZE);
> +	arg.flags = flags;
> +	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
> +	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
> +		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
> +	igt_assert(offset == map + PAGE_SIZE);
>   	gem_close(fd, arg.handle);
> -	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
> +	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
>   	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
>   
> -	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
> +	    &handle)) {

Not sure I follow why you converted this to an if. Do we expect the 
userptr IOCTL not to work? Could you add a small comment.

Antonio

> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
> +	    0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
>   	/* boundaries */
> -	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
> -	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
> -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> -	gem_close(fd, handle);
> +	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
> +	    userptr_flags, &handle)) {
> +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> +		gem_close(fd, handle);
> +	}
>   
>   	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
>   
> @@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
>   		igt_subtest("invalid-null-pointer")
>   			test_invalid_null_pointer(fd);
>   
> -		igt_subtest("invalid-gtt-mapping")
> -			test_invalid_gtt_mapping(fd);
> +		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
> +		igt_subtest("invalid-gtt-mapping") {
> +			gem_require_mappable_ggtt(fd);
> +			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
> +		}
> +		igt_subtest_group {
> +			igt_fixture
> +				igt_require(gem_has_mmap_offset(fd));
> +
> +			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
> +			igt_subtest("invalid-wb-mapping")
> +				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
> +
> +			igt_subtest_group {
> +				igt_fixture
> +					igt_require(gem_mmap_offset__has_wc(fd));
> +
> +				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
> +				igt_subtest("invalid-wc-mapping")
> +					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
> +				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
> +				igt_subtest("invalid-uc-mapping")
> +					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
> +			}
> +		}
>   
>   		igt_subtest("forked-access")
>   			test_forked_access(fd);
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-23 20:22 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
@ 2020-01-29 11:24   ` Chris Wilson
  2020-01-30 16:58     ` Janusz Krzysztofik
                       ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Chris Wilson @ 2020-01-29 11:24 UTC (permalink / raw)
  To: Janusz Krzysztofik, Patchwork, igt-dev

Quoting Patchwork (2020-01-23 20:22:25)
> == Series Details ==
> 
> Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> URL   : https://patchwork.freedesktop.org/series/72411/
> State : success
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> ====================================================
> 
> Summary
> -------
> 
>   **SUCCESS**
> 
>   No regressions found.
> 
>   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/index.html
> 
> New tests
> ---------
> 
>   New tests have been introduced between CI_DRM_7794_full and IGTPW_3969_full:
> 
> ### New IGT tests (3) ###
> 
>   * igt@gem_userptr_blits@invalid-uc-mapping:
>     - Statuses : 7 pass(s)
>     - Exec time: [0.01, 0.02] s
> 
>   * igt@gem_userptr_blits@invalid-wb-mapping:
>     - Statuses : 7 pass(s)
>     - Exec time: [0.01, 0.02] s
> 
>   * igt@gem_userptr_blits@invalid-wc-mapping:
>     - Statuses : 7 pass(s)
>     - Exec time: [0.01, 0.02] s

Ok, we need a bit more work to trigger the lockdep loop. We need a
cancel_userptr of the same object that is faulted via mmap-offset.

We're basically looking for the equivalent of this

<4> [175.968441] ======================================================
<4> [175.968444] WARNING: possible circular locking dependency detected
<4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
<4> [175.968449] ------------------------------------------------------
<4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
<4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: i915_vma_unbind+0xae/0x110 [i915]
<4> [175.968527]
but task is already holding lock:
<4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.+.}, at: unmap_vmas+0x0/0x150
<4> [175.968535]
which lock already depends on the new lock.
<4> [175.968538]
the existing dependency chain (in reverse order) is:
<4> [175.968541]
-> #2 (mmu_notifier_invalidate_range_start){+.+.}:
<4> [175.968546]        page_mkclean_one+0xda/0x210
<4> [175.968548]        rmap_walk_file+0xff/0x260
<4> [175.968551]        page_mkclean+0x9f/0xb0
<4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
<4> [175.968559]        mpage_submit_page+0x1a/0x70
<4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
<4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
<4> [175.968568]        ext4_writepages+0x5ba/0x12b0
<4> [175.968571]        do_writepages+0x46/0xe0
<4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
<4> [175.968576]        file_write_and_wait_range+0x3c/0x90
<4> [175.968579]        ext4_sync_file+0x1a4/0x540
<4> [175.968582]        do_fsync+0x33/0x60
<4> [175.968584]        __x64_sys_fsync+0xb/0x10
<4> [175.968587]        do_syscall_64+0x4f/0x220
<4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [175.968594]
-> #1 (&mapping->i_mmap_rwsem){++++}:
<4> [175.968599]        down_write+0x33/0x70
<4> [175.968601]        unmap_mapping_pages+0x48/0x130
<4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
<4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
<4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
<4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
<4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
<4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
<4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
<4> [175.968893]        drm_ioctl+0x2e1/0x390
<4> [175.968896]        do_vfs_ioctl+0x9c/0x730
<4> [175.968899]        ksys_ioctl+0x35/0x60
<4> [175.968901]        __x64_sys_ioctl+0x11/0x20
<4> [175.968904]        do_syscall_64+0x4f/0x220
<4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [175.968909]
-> #0 (&vm->mutex){+.+.}:
<4> [175.968914]        __lock_acquire+0x1328/0x15d0
<4> [175.968916]        lock_acquire+0xa7/0x1c0
<4> [175.968919]        __mutex_lock+0x9a/0x9c0
<4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
<4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
<4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
<4> [175.969052]        unmap_vmas+0x13e/0x150
<4> [175.969055]        unmap_region+0xa3/0x100
<4> [175.969057]        __do_munmap+0x26d/0x490
<4> [175.969060]        __vm_munmap+0x66/0xc0
<4> [175.969063]        __x64_sys_munmap+0x12/0x20
<4> [175.969066]        do_syscall_64+0x4f/0x220
<4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [175.969071]

cycle but with obj->mm.lock.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-28  0:59   ` [igt-dev] " Antonio Argenziano
@ 2020-01-30 16:06     ` Janusz Krzysztofik
  -1 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-01-30 16:06 UTC (permalink / raw)
  To: Antonio Argenziano; +Cc: igt-dev, intel-gfx, Matthew Auld

Hi Antonio,

On Tuesday, January 28, 2020 1:59:00 AM CET Antonio Argenziano wrote:
> 
> On 22/01/20 08:26, Janusz Krzysztofik wrote:
> > Working with a userptr GEM object backed by any type of mapping to
> > another GEM object, not only GTT mapping currently examined bu the
> > test, may cause a currently unavoidable lockdep splat inside the i915
> > driver.  Then, such operations are expected to fail in advance to
> > prevent from that badness to happen.
> > 
> > Extend the scope of the test by adding subtests which exercise other,
> > non-GTT mapping types.  Moreover, also succeed if a failure happens
> > as soon as a userptr object is created on top of an invalid mapping.
> > 
> > Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> > ---
> >   tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
> >   1 file changed, 59 insertions(+), 28 deletions(-)
> > 
> > diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> > index a8d3783f..69e5bd1f 100644
> > --- a/tests/i915/gem_userptr_blits.c
> > +++ b/tests/i915/gem_userptr_blits.c
> > @@ -60,6 +60,7 @@
> >   
> >   #include "drm.h"
> >   #include "i915_drm.h"
> > +#include "i915/gem_mman.h"
> >   
> >   #include "intel_bufmgr.h"
> >   
> > @@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
> >   	return 0;
> >   }
> >   
> > -static int test_invalid_gtt_mapping(int fd)
> > +static int test_invalid_mapping(int fd, uint64_t flags)
> >   {
> > -	struct drm_i915_gem_mmap_gtt arg;
> > +	struct drm_i915_gem_mmap_offset arg;
> >   	uint32_t handle;
> > -	char *gtt, *map;
> > +	char *offset, *map;
> >   
> >   	/* Anonymous mapping to find a hole */
> >   	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
> > @@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
> >   	igt_assert_eq(copy(fd, handle, handle), 0);
> >   	gem_close(fd, handle);
> >   
> > -	/* GTT mapping */
> > +	/* object mapping */
> >   	memset(&arg, 0, sizeof(arg));
> >   	arg.handle = create_bo(fd, 0);
> > -	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
> > -	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
> > -		   PROT_READ | PROT_WRITE,
> > -		   MAP_SHARED | MAP_FIXED,
> > -		   fd, arg.offset);
> > -	igt_assert(gtt == map + PAGE_SIZE);
> > +	arg.flags = flags;
> > +	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
> > +	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
> > +		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
> > +	igt_assert(offset == map + PAGE_SIZE);
> >   	gem_close(fd, arg.handle);
> > -	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
> > +	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
> >   	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
> >   
> > -	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
> > +	    &handle)) {
> 
> Not sure I follow why you converted this to an if. Do we expect the 
> userptr IOCTL not to work? Could you add a small comment.

Please have a look at Chris' response to CI report [1] for more information on 
what is expected.

Thanks,
Janusz

[1] https://lists.freedesktop.org/archives/igt-dev/2020-January/019515.html

> 
> Antonio
> 
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
> > +	    0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> >   	/* boundaries */
> > -	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
> > +	    userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> >   	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
> >   
> > @@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
> >   		igt_subtest("invalid-null-pointer")
> >   			test_invalid_null_pointer(fd);
> >   
> > -		igt_subtest("invalid-gtt-mapping")
> > -			test_invalid_gtt_mapping(fd);
> > +		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
> > +		igt_subtest("invalid-gtt-mapping") {
> > +			gem_require_mappable_ggtt(fd);
> > +			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
> > +		}
> > +		igt_subtest_group {
> > +			igt_fixture
> > +				igt_require(gem_has_mmap_offset(fd));
> > +
> > +			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
> > +			igt_subtest("invalid-wb-mapping")
> > +				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
> > +
> > +			igt_subtest_group {
> > +				igt_fixture
> > +					igt_require(gem_mmap_offset__has_wc(fd));
> > +
> > +				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
> > +				igt_subtest("invalid-wc-mapping")
> > +					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
> > +				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
> > +				igt_subtest("invalid-uc-mapping")
> > +					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
> > +			}
> > +		}
> >   
> >   		igt_subtest("forked-access")
> >   			test_forked_access(fd);
> > 
> 




_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-01-30 16:06     ` Janusz Krzysztofik
  0 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-01-30 16:06 UTC (permalink / raw)
  To: Antonio Argenziano; +Cc: igt-dev, intel-gfx, Matthew Auld

Hi Antonio,

On Tuesday, January 28, 2020 1:59:00 AM CET Antonio Argenziano wrote:
> 
> On 22/01/20 08:26, Janusz Krzysztofik wrote:
> > Working with a userptr GEM object backed by any type of mapping to
> > another GEM object, not only GTT mapping currently examined bu the
> > test, may cause a currently unavoidable lockdep splat inside the i915
> > driver.  Then, such operations are expected to fail in advance to
> > prevent from that badness to happen.
> > 
> > Extend the scope of the test by adding subtests which exercise other,
> > non-GTT mapping types.  Moreover, also succeed if a failure happens
> > as soon as a userptr object is created on top of an invalid mapping.
> > 
> > Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> > ---
> >   tests/i915/gem_userptr_blits.c | 87 +++++++++++++++++++++++-----------
> >   1 file changed, 59 insertions(+), 28 deletions(-)
> > 
> > diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> > index a8d3783f..69e5bd1f 100644
> > --- a/tests/i915/gem_userptr_blits.c
> > +++ b/tests/i915/gem_userptr_blits.c
> > @@ -60,6 +60,7 @@
> >   
> >   #include "drm.h"
> >   #include "i915_drm.h"
> > +#include "i915/gem_mman.h"
> >   
> >   #include "intel_bufmgr.h"
> >   
> > @@ -577,11 +578,11 @@ static int test_invalid_null_pointer(int fd)
> >   	return 0;
> >   }
> >   
> > -static int test_invalid_gtt_mapping(int fd)
> > +static int test_invalid_mapping(int fd, uint64_t flags)
> >   {
> > -	struct drm_i915_gem_mmap_gtt arg;
> > +	struct drm_i915_gem_mmap_offset arg;
> >   	uint32_t handle;
> > -	char *gtt, *map;
> > +	char *offset, *map;
> >   
> >   	/* Anonymous mapping to find a hole */
> >   	map = mmap(NULL, sizeof(linear) + 2 * PAGE_SIZE,
> > @@ -602,39 +603,46 @@ static int test_invalid_gtt_mapping(int fd)
> >   	igt_assert_eq(copy(fd, handle, handle), 0);
> >   	gem_close(fd, handle);
> >   
> > -	/* GTT mapping */
> > +	/* object mapping */
> >   	memset(&arg, 0, sizeof(arg));
> >   	arg.handle = create_bo(fd, 0);
> > -	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
> > -	gtt = mmap(map + PAGE_SIZE, sizeof(linear),
> > -		   PROT_READ | PROT_WRITE,
> > -		   MAP_SHARED | MAP_FIXED,
> > -		   fd, arg.offset);
> > -	igt_assert(gtt == map + PAGE_SIZE);
> > +	arg.flags = flags;
> > +	do_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &arg);
> > +	offset = mmap(map + PAGE_SIZE, sizeof(linear), PROT_READ | PROT_WRITE,
> > +		      MAP_SHARED | MAP_FIXED, fd, arg.offset);
> > +	igt_assert(offset == map + PAGE_SIZE);
> >   	gem_close(fd, arg.handle);
> > -	igt_assert(((unsigned long)gtt & (PAGE_SIZE - 1)) == 0);
> > +	igt_assert(((unsigned long)offset & (PAGE_SIZE - 1)) == 0);
> >   	igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);
> >   
> > -	gem_userptr(fd, gtt, sizeof(linear), 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset, sizeof(linear), 0, userptr_flags,
> > +	    &handle)) {
> 
> Not sure I follow why you converted this to an if. Do we expect the 
> userptr IOCTL not to work? Could you add a small comment.

Please have a look at Chris' response to CI report [1] for more information on 
what is expected.

Thanks,
Janusz

[1] https://lists.freedesktop.org/archives/igt-dev/2020-January/019515.html

> 
> Antonio
> 
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, gtt, PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset, PAGE_SIZE, 0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, gtt + sizeof(linear) - PAGE_SIZE, PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, offset + sizeof(linear) - PAGE_SIZE, PAGE_SIZE,
> > +	    0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> >   	/* boundaries */
> > -	gem_userptr(fd, map, 2*PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, map, 2 * PAGE_SIZE, 0, userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> > -	gem_userptr(fd, map + sizeof(linear), 2*PAGE_SIZE, 0, userptr_flags, &handle);
> > -	igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > -	gem_close(fd, handle);
> > +	if (!__gem_userptr(fd, map + sizeof(linear), 2 * PAGE_SIZE, 0,
> > +	    userptr_flags, &handle)) {
> > +		igt_assert_eq(copy(fd, handle, handle), -EFAULT);
> > +		gem_close(fd, handle);
> > +	}
> >   
> >   	munmap(map, sizeof(linear) + 2*PAGE_SIZE);
> >   
> > @@ -2009,8 +2017,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
> >   		igt_subtest("invalid-null-pointer")
> >   			test_invalid_null_pointer(fd);
> >   
> > -		igt_subtest("invalid-gtt-mapping")
> > -			test_invalid_gtt_mapping(fd);
> > +		igt_describe("Verify userptr on top of GTT mapping to GEM object will fail");
> > +		igt_subtest("invalid-gtt-mapping") {
> > +			gem_require_mappable_ggtt(fd);
> > +			test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
> > +		}
> > +		igt_subtest_group {
> > +			igt_fixture
> > +				igt_require(gem_has_mmap_offset(fd));
> > +
> > +			igt_describe("Verify userptr on top of CPU mapping to GEM object will fail");
> > +			igt_subtest("invalid-wb-mapping")
> > +				test_invalid_mapping(fd, I915_MMAP_OFFSET_WB);
> > +
> > +			igt_subtest_group {
> > +				igt_fixture
> > +					igt_require(gem_mmap_offset__has_wc(fd));
> > +
> > +				igt_describe("Verify userptr on top of coherent mapping to GEM object will fail");
> > +				igt_subtest("invalid-wc-mapping")
> > +					test_invalid_mapping(fd, I915_MMAP_OFFSET_WC);
> > +				igt_describe("Verify userptr on top of uncached mapping to GEM object will fail");
> > +				igt_subtest("invalid-uc-mapping")
> > +					test_invalid_mapping(fd, I915_MMAP_OFFSET_UC);
> > +			}
> > +		}
> >   
> >   		igt_subtest("forked-access")
> >   			test_forked_access(fd);
> > 
> 




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

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

* Re: [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-29 11:24   ` Chris Wilson
@ 2020-01-30 16:58     ` Janusz Krzysztofik
  2020-02-10 11:20       ` Janusz Krzysztofik
  2020-02-18  9:59       ` Janusz Krzysztofik
  2 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-01-30 16:58 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

Hi Chris,

Thanks for your response.

On Wednesday, January 29, 2020 12:24:39 PM CET Chris Wilson wrote:
> Quoting Patchwork (2020-01-23 20:22:25)
> > == Series Details ==
> > 
> > Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> > URL   : https://patchwork.freedesktop.org/series/72411/
> > State : success
> > 
> > == Summary ==
> > 
> > CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> > ====================================================
> > 
> > Summary
> > -------
> > 
> >   **SUCCESS**
> > 
> >   No regressions found.
> > 
> >   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/
index.html
> > 
> > New tests
> > ---------
> > 
> >   New tests have been introduced between CI_DRM_7794_full and 
IGTPW_3969_full:
> > 
> > ### New IGT tests (3) ###
> > 
> >   * igt@gem_userptr_blits@invalid-uc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wb-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> 
> Ok, we need a bit more work to trigger the lockdep loop. We need a
> cancel_userptr of the same object that is faulted via mmap-offset.
> 
> We're basically looking for the equivalent of this
> 
> <4> [175.968441] ======================================================
> <4> [175.968444] WARNING: possible circular locking dependency detected
> <4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
> <4> [175.968449] ------------------------------------------------------
> <4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
> <4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: 
i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.968527]
> but task is already holding lock:
> <4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.
+.}, at: unmap_vmas+0x0/0x150
> <4> [175.968535]
> which lock already depends on the new lock.
> <4> [175.968538]
> the existing dependency chain (in reverse order) is:
> <4> [175.968541]
> -> #2 (mmu_notifier_invalidate_range_start){+.+.}:
> <4> [175.968546]        page_mkclean_one+0xda/0x210
> <4> [175.968548]        rmap_walk_file+0xff/0x260
> <4> [175.968551]        page_mkclean+0x9f/0xb0
> <4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
> <4> [175.968559]        mpage_submit_page+0x1a/0x70
> <4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
> <4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
> <4> [175.968568]        ext4_writepages+0x5ba/0x12b0
> <4> [175.968571]        do_writepages+0x46/0xe0
> <4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
> <4> [175.968576]        file_write_and_wait_range+0x3c/0x90
> <4> [175.968579]        ext4_sync_file+0x1a4/0x540
> <4> [175.968582]        do_fsync+0x33/0x60
> <4> [175.968584]        __x64_sys_fsync+0xb/0x10
> <4> [175.968587]        do_syscall_64+0x4f/0x220
> <4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968594]
> -> #1 (&mapping->i_mmap_rwsem){++++}:
> <4> [175.968599]        down_write+0x33/0x70
> <4> [175.968601]        unmap_mapping_pages+0x48/0x130
> <4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
> <4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
> <4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
> <4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
> <4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
> <4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
> <4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
> <4> [175.968893]        drm_ioctl+0x2e1/0x390
> <4> [175.968896]        do_vfs_ioctl+0x9c/0x730
> <4> [175.968899]        ksys_ioctl+0x35/0x60
> <4> [175.968901]        __x64_sys_ioctl+0x11/0x20
> <4> [175.968904]        do_syscall_64+0x4f/0x220
> <4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968909]
> -> #0 (&vm->mutex){+.+.}:
> <4> [175.968914]        __lock_acquire+0x1328/0x15d0
> <4> [175.968916]        lock_acquire+0xa7/0x1c0
> <4> [175.968919]        __mutex_lock+0x9a/0x9c0
> <4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
> <4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
> <4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
> <4> [175.969052]        unmap_vmas+0x13e/0x150
> <4> [175.969055]        unmap_region+0xa3/0x100
> <4> [175.969057]        __do_munmap+0x26d/0x490
> <4> [175.969060]        __vm_munmap+0x66/0xc0
> <4> [175.969063]        __x64_sys_munmap+0x12/0x20
> <4> [175.969066]        do_syscall_64+0x4f/0x220
> <4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.969071]
> 
> cycle but with obj->mm.lock.

I've been looking at this since having your comment received, also at similar 
reports referred to in commit 4f2a572eda67 ("drm/i915/userptr: Never allow 
userptr into the mappable GGTT"), but I haven't been able to find out what 
exactly needs to be done.  Can you please give me more hints?

Thanks,
Janusz

> -Chris
> 




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

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

* Re: [Intel-gfx]  [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-29 11:24   ` Chris Wilson
@ 2020-02-10 11:20       ` Janusz Krzysztofik
  2020-02-10 11:20       ` Janusz Krzysztofik
  2020-02-18  9:59       ` Janusz Krzysztofik
  2 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-02-10 11:20 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

(adding intel-gfx to the loop)

Hi Chris,

On Wednesday, January 29, 2020 12:24:39 PM CET Chris Wilson wrote:
> Quoting Patchwork (2020-01-23 20:22:25)
> > == Series Details ==
> > 
> > Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> > URL   : https://patchwork.freedesktop.org/series/72411/
> > State : success
> > 
> > == Summary ==
> > 
> > CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> > ====================================================
> > 
> > Summary
> > -------
> > 
> >   **SUCCESS**
> > 
> >   No regressions found.
> > 
> >   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/
index.html
> > 
> > New tests
> > ---------
> > 
> >   New tests have been introduced between CI_DRM_7794_full and 
IGTPW_3969_full:
> > 
> > ### New IGT tests (3) ###
> > 
> >   * igt@gem_userptr_blits@invalid-uc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wb-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> 
> Ok, we need a bit more work to trigger the lockdep loop. We need a 
> cancel_userptr of the same object that is faulted via mmap-offset.

Does that mean it would be helpful if we could trigger that lockdep loop form 
gem_userptr_blits@invalid-*-mapping so we should focus on that?

My confusion also resulted partially from me not being able to find anything 
like cancel_userptr in the current code.  Anyway, I've been trying to find out 
a solution.  While working on that, I found there was a cancel_userptr() 
function but it had been dropped by commit 484d9a844d0d ("drm/i915/userptr: 
Avoid struct_mutex recursion for mmu_invalidate_range_start").

Other than that, it was not clear for me if what you tried to say was we 
needed that cancel_userptr for triggering the lockdep loop, or we needed it 
for having the issue resolved.

Anyway, taking into account that cancel_userptr() is no longer available, 
could you please give me another hint before I spend more time possibly going 
in a wrong direction?

Thanks,
Janusz


> 
> We're basically looking for the equivalent of this
> 
> <4> [175.968441] ======================================================
> <4> [175.968444] WARNING: possible circular locking dependency detected
> <4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
> <4> [175.968449] ------------------------------------------------------
> <4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
> <4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: 
i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.968527]
> but task is already holding lock:
> <4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.
+.}, at: unmap_vmas+0x0/0x150
> <4> [175.968535]
> which lock already depends on the new lock.
> <4> [175.968538]
> the existing dependency chain (in reverse order) is:
> <4> [175.968541]
> -> #2 (mmu_notifier_invalidate_range_start){+.+.}:
> <4> [175.968546]        page_mkclean_one+0xda/0x210
> <4> [175.968548]        rmap_walk_file+0xff/0x260
> <4> [175.968551]        page_mkclean+0x9f/0xb0
> <4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
> <4> [175.968559]        mpage_submit_page+0x1a/0x70
> <4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
> <4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
> <4> [175.968568]        ext4_writepages+0x5ba/0x12b0
> <4> [175.968571]        do_writepages+0x46/0xe0
> <4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
> <4> [175.968576]        file_write_and_wait_range+0x3c/0x90
> <4> [175.968579]        ext4_sync_file+0x1a4/0x540
> <4> [175.968582]        do_fsync+0x33/0x60
> <4> [175.968584]        __x64_sys_fsync+0xb/0x10
> <4> [175.968587]        do_syscall_64+0x4f/0x220
> <4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968594]
> -> #1 (&mapping->i_mmap_rwsem){++++}:
> <4> [175.968599]        down_write+0x33/0x70
> <4> [175.968601]        unmap_mapping_pages+0x48/0x130
> <4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
> <4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
> <4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
> <4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
> <4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
> <4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
> <4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
> <4> [175.968893]        drm_ioctl+0x2e1/0x390
> <4> [175.968896]        do_vfs_ioctl+0x9c/0x730
> <4> [175.968899]        ksys_ioctl+0x35/0x60
> <4> [175.968901]        __x64_sys_ioctl+0x11/0x20
> <4> [175.968904]        do_syscall_64+0x4f/0x220
> <4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968909]
> -> #0 (&vm->mutex){+.+.}:
> <4> [175.968914]        __lock_acquire+0x1328/0x15d0
> <4> [175.968916]        lock_acquire+0xa7/0x1c0
> <4> [175.968919]        __mutex_lock+0x9a/0x9c0
> <4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
> <4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
> <4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
> <4> [175.969052]        unmap_vmas+0x13e/0x150
> <4> [175.969055]        unmap_region+0xa3/0x100
> <4> [175.969057]        __do_munmap+0x26d/0x490
> <4> [175.969060]        __vm_munmap+0x66/0xc0
> <4> [175.969063]        __x64_sys_munmap+0x12/0x20
> <4> [175.969066]        do_syscall_64+0x4f/0x220
> <4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.969071]
> 
> cycle but with obj->mm.lock.
> -Chris
> 




_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-02-10 11:20       ` Janusz Krzysztofik
  0 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-02-10 11:20 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

(adding intel-gfx to the loop)

Hi Chris,

On Wednesday, January 29, 2020 12:24:39 PM CET Chris Wilson wrote:
> Quoting Patchwork (2020-01-23 20:22:25)
> > == Series Details ==
> > 
> > Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> > URL   : https://patchwork.freedesktop.org/series/72411/
> > State : success
> > 
> > == Summary ==
> > 
> > CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> > ====================================================
> > 
> > Summary
> > -------
> > 
> >   **SUCCESS**
> > 
> >   No regressions found.
> > 
> >   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/
index.html
> > 
> > New tests
> > ---------
> > 
> >   New tests have been introduced between CI_DRM_7794_full and 
IGTPW_3969_full:
> > 
> > ### New IGT tests (3) ###
> > 
> >   * igt@gem_userptr_blits@invalid-uc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wb-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> 
> Ok, we need a bit more work to trigger the lockdep loop. We need a 
> cancel_userptr of the same object that is faulted via mmap-offset.

Does that mean it would be helpful if we could trigger that lockdep loop form 
gem_userptr_blits@invalid-*-mapping so we should focus on that?

My confusion also resulted partially from me not being able to find anything 
like cancel_userptr in the current code.  Anyway, I've been trying to find out 
a solution.  While working on that, I found there was a cancel_userptr() 
function but it had been dropped by commit 484d9a844d0d ("drm/i915/userptr: 
Avoid struct_mutex recursion for mmu_invalidate_range_start").

Other than that, it was not clear for me if what you tried to say was we 
needed that cancel_userptr for triggering the lockdep loop, or we needed it 
for having the issue resolved.

Anyway, taking into account that cancel_userptr() is no longer available, 
could you please give me another hint before I spend more time possibly going 
in a wrong direction?

Thanks,
Janusz


> 
> We're basically looking for the equivalent of this
> 
> <4> [175.968441] ======================================================
> <4> [175.968444] WARNING: possible circular locking dependency detected
> <4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
> <4> [175.968449] ------------------------------------------------------
> <4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
> <4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: 
i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.968527]
> but task is already holding lock:
> <4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.
+.}, at: unmap_vmas+0x0/0x150
> <4> [175.968535]
> which lock already depends on the new lock.
> <4> [175.968538]
> the existing dependency chain (in reverse order) is:
> <4> [175.968541]
> -> #2 (mmu_notifier_invalidate_range_start){+.+.}:
> <4> [175.968546]        page_mkclean_one+0xda/0x210
> <4> [175.968548]        rmap_walk_file+0xff/0x260
> <4> [175.968551]        page_mkclean+0x9f/0xb0
> <4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
> <4> [175.968559]        mpage_submit_page+0x1a/0x70
> <4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
> <4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
> <4> [175.968568]        ext4_writepages+0x5ba/0x12b0
> <4> [175.968571]        do_writepages+0x46/0xe0
> <4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
> <4> [175.968576]        file_write_and_wait_range+0x3c/0x90
> <4> [175.968579]        ext4_sync_file+0x1a4/0x540
> <4> [175.968582]        do_fsync+0x33/0x60
> <4> [175.968584]        __x64_sys_fsync+0xb/0x10
> <4> [175.968587]        do_syscall_64+0x4f/0x220
> <4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968594]
> -> #1 (&mapping->i_mmap_rwsem){++++}:
> <4> [175.968599]        down_write+0x33/0x70
> <4> [175.968601]        unmap_mapping_pages+0x48/0x130
> <4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
> <4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
> <4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
> <4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
> <4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
> <4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
> <4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
> <4> [175.968893]        drm_ioctl+0x2e1/0x390
> <4> [175.968896]        do_vfs_ioctl+0x9c/0x730
> <4> [175.968899]        ksys_ioctl+0x35/0x60
> <4> [175.968901]        __x64_sys_ioctl+0x11/0x20
> <4> [175.968904]        do_syscall_64+0x4f/0x220
> <4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968909]
> -> #0 (&vm->mutex){+.+.}:
> <4> [175.968914]        __lock_acquire+0x1328/0x15d0
> <4> [175.968916]        lock_acquire+0xa7/0x1c0
> <4> [175.968919]        __mutex_lock+0x9a/0x9c0
> <4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
> <4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
> <4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
> <4> [175.969052]        unmap_vmas+0x13e/0x150
> <4> [175.969055]        unmap_region+0xa3/0x100
> <4> [175.969057]        __do_munmap+0x26d/0x490
> <4> [175.969060]        __vm_munmap+0x66/0xc0
> <4> [175.969063]        __x64_sys_munmap+0x12/0x20
> <4> [175.969066]        do_syscall_64+0x4f/0x220
> <4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.969071]
> 
> cycle but with obj->mm.lock.
> -Chris
> 




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

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

* Re: [Intel-gfx]  [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
  2020-01-29 11:24   ` Chris Wilson
@ 2020-02-18  9:59       ` Janusz Krzysztofik
  2020-02-10 11:20       ` Janusz Krzysztofik
  2020-02-18  9:59       ` Janusz Krzysztofik
  2 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-02-18  9:59 UTC (permalink / raw)
  To: Chris Wilson, igt-dev; +Cc: intel-gfx

Hi Chris,

Let me share some of my observations on the userptr(mmap_offset) case.

On Wednesday, January 29, 2020 12:24:39 PM CET Chris Wilson wrote:
> Quoting Patchwork (2020-01-23 20:22:25)
> > == Series Details ==
> > 
> > Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> > URL   : https://patchwork.freedesktop.org/series/72411/
> > State : success
> > 
> > == Summary ==
> > 
> > CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> > ====================================================
> > 
> > Summary
> > -------
> > 
> >   **SUCCESS**
> > 
> >   No regressions found.
> > 
> >   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/index.html
> > 
> > New tests
> > ---------
> > 
> >   New tests have been introduced between CI_DRM_7794_full and IGTPW_3969_full:
> > 
> > ### New IGT tests (3) ###
> > 
> >   * igt@gem_userptr_blits@invalid-uc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wb-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> 
> Ok, we need a bit more work to trigger the lockdep loop. We need a
> cancel_userptr of the same object that is faulted via mmap-offset.
> 
> We're basically looking for the equivalent of this
> 
> <4> [175.968441] ======================================================
> <4> [175.968444] WARNING: possible circular locking dependency detected
> <4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
> <4> [175.968449] ------------------------------------------------------
> <4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
> <4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.968527]
> but task is already holding lock:
> <4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.+.}, at: unmap_vmas+0x0/0x150
> <4> [175.968535]
> which lock already depends on the new lock.
> <4> [175.968538]
> the existing dependency chain (in reverse order) is:
> <4> [175.968541]
> -> #2 (mmu_notifier_invalidate_range_start){+.+.}:
> <4> [175.968546]        page_mkclean_one+0xda/0x210
> <4> [175.968548]        rmap_walk_file+0xff/0x260
> <4> [175.968551]        page_mkclean+0x9f/0xb0
> <4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
> <4> [175.968559]        mpage_submit_page+0x1a/0x70
> <4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
> <4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
> <4> [175.968568]        ext4_writepages+0x5ba/0x12b0
> <4> [175.968571]        do_writepages+0x46/0xe0
> <4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
> <4> [175.968576]        file_write_and_wait_range+0x3c/0x90
> <4> [175.968579]        ext4_sync_file+0x1a4/0x540
> <4> [175.968582]        do_fsync+0x33/0x60
> <4> [175.968584]        __x64_sys_fsync+0xb/0x10
> <4> [175.968587]        do_syscall_64+0x4f/0x220
> <4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968594]
> -> #1 (&mapping->i_mmap_rwsem){++++}:
> <4> [175.968599]        down_write+0x33/0x70
> <4> [175.968601]        unmap_mapping_pages+0x48/0x130
> <4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
> <4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
> <4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
> <4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
> <4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
> <4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
> <4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
> <4> [175.968893]        drm_ioctl+0x2e1/0x390
> <4> [175.968896]        do_vfs_ioctl+0x9c/0x730
> <4> [175.968899]        ksys_ioctl+0x35/0x60
> <4> [175.968901]        __x64_sys_ioctl+0x11/0x20
> <4> [175.968904]        do_syscall_64+0x4f/0x220
> <4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968909]
> -> #0 (&vm->mutex){+.+.}:
> <4> [175.968914]        __lock_acquire+0x1328/0x15d0
> <4> [175.968916]        lock_acquire+0xa7/0x1c0
> <4> [175.968919]        __mutex_lock+0x9a/0x9c0
> <4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
> <4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]

AFAICU, for that to happen, not only the userptr MMU notifier would have to be 
registered, but at least one userptr object would have to be added to the 
notifier's list of active objects.

For a userptr object to be ever added to the notifier's list of active 
objects,  it would have to be created without I915_USERPTR_UNSYNCHRONIZED flag 
set.  As "invalid-*-mapping" (or dynamic "invalid-mmap-offset" since 
addressing your comments in v3 of my patch) subtests create userptr objects 
with that flag set, we need "-sync" flavors of those subtests in order to have 
a chance for the lockdep loop to be exercised.  If that observation is not 
questionable to you, I'm going to address it in my next version of the patch.

Now, the only way to activate the MMU notifier for a userptr object is when 
__i915_gem_userptr_set_active() is called from i915_gem_userptr_get_pages(). 
That can happen when either all required pages have already been pinned before 
and are returned by __get_user_pages_fast(), or, if some pages are not yet 
pinned, when __i915_gem_userptr_get_pages_schedule() likely succeeds (returns 
-EAGAIN).  In the latter case, __i915_gem_userptr_get_pages_worker() work is 
scheduled.

In case of a userptr object backed by our mmap-offset mapping, 
get_user_pages_remote() called from __i915_gem_userptr_get_pages_worker() 
fails immediately with -EFAULT on (vm_flags & (VM_IO | VM_PFNMAP)) in 
mm/gup.c:check_vma_flags().  As a result, the MMU notifier is immediately 
deactivated for the object.  Then indeed, a time window with the MMU notifier 
being active for the object exists.  However, I still can't find out how 
userspace could trigger the lockdep loop *within* that time window in a 
reproducible manner.  Could you think of a way to do it?

On the other hand, if we could postpone activation of the userptr MMU notifier 
for an object, or otherwise prevent the notifier from doing its job until at 
least one page is successfully acquired, then a userptr object backed with 
mmap-offset mapping would never be able to trigger that lockdep loop, I 
believe.  If you find my conclusions not missing the point, I'm going to 
propose a patch (i915, not IGT).

Thanks,
Janusz


> <4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
> <4> [175.969052]        unmap_vmas+0x13e/0x150
> <4> [175.969055]        unmap_region+0xa3/0x100
> <4> [175.969057]        __do_munmap+0x26d/0x490
> <4> [175.969060]        __vm_munmap+0x66/0xc0
> <4> [175.969063]        __x64_sys_munmap+0x12/0x20
> <4> [175.969066]        do_syscall_64+0x4f/0x220
> <4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.969071]
> 
> cycle but with obj->mm.lock.
> -Chris
> 




_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] ✓ Fi.CI.IGT: success for tests/gem_userptr_blits: Enhance invalid mapping exercise
@ 2020-02-18  9:59       ` Janusz Krzysztofik
  0 siblings, 0 replies; 15+ messages in thread
From: Janusz Krzysztofik @ 2020-02-18  9:59 UTC (permalink / raw)
  To: Chris Wilson, igt-dev; +Cc: intel-gfx

Hi Chris,

Let me share some of my observations on the userptr(mmap_offset) case.

On Wednesday, January 29, 2020 12:24:39 PM CET Chris Wilson wrote:
> Quoting Patchwork (2020-01-23 20:22:25)
> > == Series Details ==
> > 
> > Series: tests/gem_userptr_blits: Enhance invalid mapping exercise
> > URL   : https://patchwork.freedesktop.org/series/72411/
> > State : success
> > 
> > == Summary ==
> > 
> > CI Bug Log - changes from CI_DRM_7794_full -> IGTPW_3969_full
> > ====================================================
> > 
> > Summary
> > -------
> > 
> >   **SUCCESS**
> > 
> >   No regressions found.
> > 
> >   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3969/index.html
> > 
> > New tests
> > ---------
> > 
> >   New tests have been introduced between CI_DRM_7794_full and IGTPW_3969_full:
> > 
> > ### New IGT tests (3) ###
> > 
> >   * igt@gem_userptr_blits@invalid-uc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wb-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> > 
> >   * igt@gem_userptr_blits@invalid-wc-mapping:
> >     - Statuses : 7 pass(s)
> >     - Exec time: [0.01, 0.02] s
> 
> Ok, we need a bit more work to trigger the lockdep loop. We need a
> cancel_userptr of the same object that is faulted via mmap-offset.
> 
> We're basically looking for the equivalent of this
> 
> <4> [175.968441] ======================================================
> <4> [175.968444] WARNING: possible circular locking dependency detected
> <4> [175.968447] 5.5.0-CI-CI_DRM_7828+ #1 Tainted: G     U
> <4> [175.968449] ------------------------------------------------------
> <4> [175.968452] gem_userptr_bli/1564 is trying to acquire lock:
> <4> [175.968455] ffff888208f49580 (&vm->mutex){+.+.}, at: i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.968527]
> but task is already holding lock:
> <4> [175.968529] ffffffff82664d40 (mmu_notifier_invalidate_range_start){+.+.}, at: unmap_vmas+0x0/0x150
> <4> [175.968535]
> which lock already depends on the new lock.
> <4> [175.968538]
> the existing dependency chain (in reverse order) is:
> <4> [175.968541]
> -> #2 (mmu_notifier_invalidate_range_start){+.+.}:
> <4> [175.968546]        page_mkclean_one+0xda/0x210
> <4> [175.968548]        rmap_walk_file+0xff/0x260
> <4> [175.968551]        page_mkclean+0x9f/0xb0
> <4> [175.968555]        clear_page_dirty_for_io+0xa2/0x2f0
> <4> [175.968559]        mpage_submit_page+0x1a/0x70
> <4> [175.968561]        mpage_process_page_bufs+0xe7/0x110
> <4> [175.968564]        mpage_prepare_extent_to_map+0x1d2/0x2b0
> <4> [175.968568]        ext4_writepages+0x5ba/0x12b0
> <4> [175.968571]        do_writepages+0x46/0xe0
> <4> [175.968573]        __filemap_fdatawrite_range+0xc6/0x100
> <4> [175.968576]        file_write_and_wait_range+0x3c/0x90
> <4> [175.968579]        ext4_sync_file+0x1a4/0x540
> <4> [175.968582]        do_fsync+0x33/0x60
> <4> [175.968584]        __x64_sys_fsync+0xb/0x10
> <4> [175.968587]        do_syscall_64+0x4f/0x220
> <4> [175.968591]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968594]
> -> #1 (&mapping->i_mmap_rwsem){++++}:
> <4> [175.968599]        down_write+0x33/0x70
> <4> [175.968601]        unmap_mapping_pages+0x48/0x130
> <4> [175.968671]        i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
> <4> [175.968715]        fence_update+0xfd/0x2d0 [i915]
> <4> [175.968759]        __i915_vma_unbind+0x1eb/0x530 [i915]
> <4> [175.968803]        i915_vma_release+0x101/0x220 [i915]
> <4> [175.968843]        __i915_gem_free_objects+0x113/0x530 [i915]
> <4> [175.968886]        i915_gem_create_ioctl+0x12/0x40 [i915]
> <4> [175.968890]        drm_ioctl_kernel+0xad/0xf0
> <4> [175.968893]        drm_ioctl+0x2e1/0x390
> <4> [175.968896]        do_vfs_ioctl+0x9c/0x730
> <4> [175.968899]        ksys_ioctl+0x35/0x60
> <4> [175.968901]        __x64_sys_ioctl+0x11/0x20
> <4> [175.968904]        do_syscall_64+0x4f/0x220
> <4> [175.968906]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.968909]
> -> #0 (&vm->mutex){+.+.}:
> <4> [175.968914]        __lock_acquire+0x1328/0x15d0
> <4> [175.968916]        lock_acquire+0xa7/0x1c0
> <4> [175.968919]        __mutex_lock+0x9a/0x9c0
> <4> [175.968962]        i915_vma_unbind+0xae/0x110 [i915]
> <4> [175.969004]        i915_gem_object_unbind+0x1dc/0x400 [i915]
> <4> [175.969045]        userptr_mn_invalidate_range_start+0xdd/0x190 [i915]

AFAICU, for that to happen, not only the userptr MMU notifier would have to be 
registered, but at least one userptr object would have to be added to the 
notifier's list of active objects.

For a userptr object to be ever added to the notifier's list of active 
objects,  it would have to be created without I915_USERPTR_UNSYNCHRONIZED flag 
set.  As "invalid-*-mapping" (or dynamic "invalid-mmap-offset" since 
addressing your comments in v3 of my patch) subtests create userptr objects 
with that flag set, we need "-sync" flavors of those subtests in order to have 
a chance for the lockdep loop to be exercised.  If that observation is not 
questionable to you, I'm going to address it in my next version of the patch.

Now, the only way to activate the MMU notifier for a userptr object is when 
__i915_gem_userptr_set_active() is called from i915_gem_userptr_get_pages(). 
That can happen when either all required pages have already been pinned before 
and are returned by __get_user_pages_fast(), or, if some pages are not yet 
pinned, when __i915_gem_userptr_get_pages_schedule() likely succeeds (returns 
-EAGAIN).  In the latter case, __i915_gem_userptr_get_pages_worker() work is 
scheduled.

In case of a userptr object backed by our mmap-offset mapping, 
get_user_pages_remote() called from __i915_gem_userptr_get_pages_worker() 
fails immediately with -EFAULT on (vm_flags & (VM_IO | VM_PFNMAP)) in 
mm/gup.c:check_vma_flags().  As a result, the MMU notifier is immediately 
deactivated for the object.  Then indeed, a time window with the MMU notifier 
being active for the object exists.  However, I still can't find out how 
userspace could trigger the lockdep loop *within* that time window in a 
reproducible manner.  Could you think of a way to do it?

On the other hand, if we could postpone activation of the userptr MMU notifier 
for an object, or otherwise prevent the notifier from doing its job until at 
least one page is successfully acquired, then a userptr object backed with 
mmap-offset mapping would never be able to trigger that lockdep loop, I 
believe.  If you find my conclusions not missing the point, I'm going to 
propose a patch (i915, not IGT).

Thanks,
Janusz


> <4> [175.969049]        __mmu_notifier_invalidate_range_start+0x148/0x250
> <4> [175.969052]        unmap_vmas+0x13e/0x150
> <4> [175.969055]        unmap_region+0xa3/0x100
> <4> [175.969057]        __do_munmap+0x26d/0x490
> <4> [175.969060]        __vm_munmap+0x66/0xc0
> <4> [175.969063]        __x64_sys_munmap+0x12/0x20
> <4> [175.969066]        do_syscall_64+0x4f/0x220
> <4> [175.969068]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
> <4> [175.969071]
> 
> cycle but with obj->mm.lock.
> -Chris
> 




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

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

end of thread, other threads:[~2020-02-18 10:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22 16:26 [Intel-gfx] [RFC PATCH i-g-t] tests/gem_userptr_blits: Enhance invalid mapping exercise Janusz Krzysztofik
2020-01-22 16:26 ` [igt-dev] " Janusz Krzysztofik
2020-01-22 18:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-23 13:51 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2020-01-23 20:22 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2020-01-29 11:24   ` Chris Wilson
2020-01-30 16:58     ` Janusz Krzysztofik
2020-02-10 11:20     ` [Intel-gfx] " Janusz Krzysztofik
2020-02-10 11:20       ` Janusz Krzysztofik
2020-02-18  9:59     ` [Intel-gfx] " Janusz Krzysztofik
2020-02-18  9:59       ` Janusz Krzysztofik
2020-01-28  0:59 ` [Intel-gfx] [RFC PATCH i-g-t] " Antonio Argenziano
2020-01-28  0:59   ` [igt-dev] " Antonio Argenziano
2020-01-30 16:06   ` Janusz Krzysztofik
2020-01-30 16:06     ` [igt-dev] " Janusz Krzysztofik

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.