Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr
@ 2020-01-31 13:12 Janusz Krzysztofik
  2020-01-31 13:12 ` [igt-dev] [RFC PATCH i-g-t 1/1] " Janusz Krzysztofik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2020-01-31 13:12 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Matthew Auld

I'm adding a cover letter in case it is required for having a related
kernel side patch been tested with this one.  Since I've proposed to
change an error code returned by an IOCTL, this patch is expected to
fail when tested alone, without the kernel side counterpart.

Thanks,
Janusz

Janusz Krzysztofik (1):
  tests/gem_mmap_offset: Exercise mapping to userptr

 tests/i915/gem_mmap_offset.c | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

-- 
2.21.0

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

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

* [igt-dev] [RFC PATCH i-g-t 1/1] tests/gem_mmap_offset: Exercise mapping to userptr
  2020-01-31 13:12 [igt-dev] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr Janusz Krzysztofik
@ 2020-01-31 13:12 ` Janusz Krzysztofik
  2020-01-31 14:37   ` Chris Wilson
  2020-01-31 13:23 ` [igt-dev] [Intel-gfx] [RFC PATCH i-g-t 0/1] " Petri Latvala
  2020-01-31 13:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: Janusz Krzysztofik @ 2020-01-31 13:12 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Matthew Auld

Creating a mapping to a userptr backed GEM object may cause a currently
unavoidable lockdep splat inside the i915 driver.  Then, such operation
is expected to fail to prevent from that badness to happen.

Add a respective subtest for each mapping type.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_mmap_offset.c | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 7c4088cdf..a5f28328b 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -141,6 +141,36 @@ static void bad_extensions(int i915)
 	gem_close(i915, arg.handle);
 }
 
+static bool has_userptr(int i915)
+{
+	uint32_t handle = 0;
+	void *ptr;
+
+	igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
+	if (__gem_userptr(i915, ptr, 4096, 0, 0, &handle) == 0)
+		gem_close(i915, handle);
+	free(ptr);
+
+	return handle;
+}
+
+static void userptr(int i915, uint64_t flags)
+{
+	struct drm_i915_gem_mmap_offset arg = {
+		.flags = flags,
+	};
+	void *ptr;
+
+	igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
+
+	gem_userptr(i915, ptr, 4096, 0, 0, &arg.handle);
+
+	igt_assert_eq(mmap_offset_ioctl(i915, &arg), -EINVAL);
+
+	gem_close(i915, arg.handle);
+	free(ptr);
+}
+
 static void basic_uaf(int i915)
 {
 	const uint32_t obj_size = 4096;
@@ -461,6 +491,31 @@ igt_main
 	igt_subtest_f("bad-extensions")
 		bad_extensions(i915);
 
+	igt_subtest_group {
+		igt_fixture
+			igt_require(has_userptr(i915));
+
+		for_each_mmap_offset_type(t) {
+			igt_describe_f("Verify %s mapping to userptr backed GEM object will fail",
+				       t->name);
+			igt_subtest_f("userptr-%s-mapping", t->name) {
+				switch (t->type) {
+				case I915_MMAP_OFFSET_GTT:
+					gem_require_mappable_ggtt(i915);
+					break;
+				case I915_MMAP_OFFSET_WC:
+				case I915_MMAP_OFFSET_UC:
+					igt_require(gem_mmap_offset__has_wc(i915));
+					break;
+				defalut:
+					break;
+				}
+
+				userptr(i915, t->type);
+			}
+		}
+	}
+
 	igt_describe("Check buffer object mapping persists after gem_close");
 	igt_subtest_f("basic-uaf")
 		basic_uaf(i915);
-- 
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] 6+ messages in thread

* Re: [igt-dev] [Intel-gfx] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr
  2020-01-31 13:12 [igt-dev] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr Janusz Krzysztofik
  2020-01-31 13:12 ` [igt-dev] [RFC PATCH i-g-t 1/1] " Janusz Krzysztofik
@ 2020-01-31 13:23 ` Petri Latvala
  2020-01-31 13:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2020-01-31 13:23 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: igt-dev, intel-gfx, Matthew Auld

On Fri, Jan 31, 2020 at 02:12:33PM +0100, Janusz Krzysztofik wrote:
> I'm adding a cover letter in case it is required for having a related
> kernel side patch been tested with this one.

For the record, Test-With doesn't require the IGT side to have a cover
letter.


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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_mmap_offset: Exercise mapping to userptr
  2020-01-31 13:12 [igt-dev] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr Janusz Krzysztofik
  2020-01-31 13:12 ` [igt-dev] [RFC PATCH i-g-t 1/1] " Janusz Krzysztofik
  2020-01-31 13:23 ` [igt-dev] [Intel-gfx] [RFC PATCH i-g-t 0/1] " Petri Latvala
@ 2020-01-31 13:44 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-01-31 13:44 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: igt-dev

== Series Details ==

Series: tests/gem_mmap_offset: Exercise mapping to userptr
URL   : https://patchwork.freedesktop.org/series/72822/
State : failure

== Summary ==

CI Bug Log - changes from IGT_5408 -> IGTPW_4059
====================================================

Summary
-------

  **FAILURE**

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

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_gem_contexts:
    - fi-cfl-8700k:       [PASS][1] -> [TIMEOUT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html

  * igt@runner@aborted:
    - fi-hsw-peppy:       NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-hsw-peppy/igt@runner@aborted.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-tgl-y:           [PASS][4] -> [INCOMPLETE][5] ([CI#94] / [i915#460] / [i915#472])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html

  * igt@i915_selftest@live_execlists:
    - fi-icl-y:           [PASS][6] -> [DMESG-FAIL][7] ([fdo#108569])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-icl-y/igt@i915_selftest@live_execlists.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-icl-y/igt@i915_selftest@live_execlists.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-cfl-guc:         [PASS][8] -> [INCOMPLETE][9] ([CI#80] / [fdo#106070] / [i915#424])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html

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

  
#### Possible fixes ####

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770r:       [DMESG-FAIL][12] ([i915#553] / [i915#725]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-hsw-4770r/igt@i915_selftest@live_blt.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-hsw-4770r/igt@i915_selftest@live_blt.html
    - fi-ivb-3770:        [DMESG-FAIL][14] ([i915#563]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-ivb-3770/igt@i915_selftest@live_blt.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-ivb-3770/igt@i915_selftest@live_blt.html

  * igt@kms_chamelium@dp-edid-read:
    - fi-cml-u2:          [FAIL][16] ([i915#976]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-cml-u2/igt@kms_chamelium@dp-edid-read.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-cml-u2/igt@kms_chamelium@dp-edid-read.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-icl-u2:          [FAIL][18] ([fdo#109635] / [i915#217]) -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-icl-u2/igt@kms_chamelium@hdmi-crc-fast.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-icl-u2/igt@kms_chamelium@hdmi-crc-fast.html

  
#### Warnings ####

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770:        [DMESG-FAIL][20] ([i915#553] / [i915#725]) -> [DMESG-FAIL][21] ([i915#725])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5408/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/fi-hsw-4770/igt@i915_selftest@live_blt.html

  
  [CI#80]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/80
  [CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
  [fdo#106070]: https://bugs.freedesktop.org/show_bug.cgi?id=106070
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109635]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [i915#217]: https://gitlab.freedesktop.org/drm/intel/issues/217
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#424]: https://gitlab.freedesktop.org/drm/intel/issues/424
  [i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
  [i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
  [i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
  [i915#563]: https://gitlab.freedesktop.org/drm/intel/issues/563
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#976]: https://gitlab.freedesktop.org/drm/intel/issues/976


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

  Additional (5): fi-kbl-soraka fi-bsw-n3050 fi-hsw-peppy fi-elk-e7500 fi-bsw-kefka 
  Missing    (5): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-byt-clapper 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5408 -> IGTPW_4059

  CI-20190529: 20190529
  CI_DRM_7850: ae66f2257648ce52c51298506977baa32873c9d5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4059: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4059/index.html
  IGT_5408: 8980bcd421744fb63d38270e1fcc9c7432d70d00 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_mmap_offset@userptr-gtt-mapping
+igt@gem_mmap_offset@userptr-uc-mapping
+igt@gem_mmap_offset@userptr-wb-mapping
+igt@gem_mmap_offset@userptr-wc-mapping

== Logs ==

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

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

* Re: [igt-dev] [RFC PATCH i-g-t 1/1] tests/gem_mmap_offset: Exercise mapping to userptr
  2020-01-31 13:12 ` [igt-dev] [RFC PATCH i-g-t 1/1] " Janusz Krzysztofik
@ 2020-01-31 14:37   ` Chris Wilson
  2020-01-31 14:56     ` Janusz Krzysztofik
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2020-01-31 14:37 UTC (permalink / raw)
  To: Janusz Krzysztofik, igt-dev; +Cc: intel-gfx, Matthew Auld

Quoting Janusz Krzysztofik (2020-01-31 13:12:34)
> Creating a mapping to a userptr backed GEM object may cause a currently
> unavoidable lockdep splat inside the i915 driver.  Then, such operation
> is expected to fail to prevent from that badness to happen.
> 
> Add a respective subtest for each mapping type.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_mmap_offset.c | 55 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 7c4088cdf..a5f28328b 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -141,6 +141,36 @@ static void bad_extensions(int i915)
>         gem_close(i915, arg.handle);
>  }
>  
> +static bool has_userptr(int i915)
> +{
> +       uint32_t handle = 0;
> +       void *ptr;
> +
> +       igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
> +       if (__gem_userptr(i915, ptr, 4096, 0, 0, &handle) == 0)
> +               gem_close(i915, handle);
> +       free(ptr);
> +
> +       return handle;
> +}
> +
> +static void userptr(int i915, uint64_t flags)
> +{
> +       struct drm_i915_gem_mmap_offset arg = {
> +               .flags = flags,
> +       };
> +       void *ptr;
> +
> +       igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
> +
> +       gem_userptr(i915, ptr, 4096, 0, 0, &arg.handle);
> +
> +       igt_assert_eq(mmap_offset_ioctl(i915, &arg), -EINVAL);

Not quite. The only reason it doesn't work is because the implementation
ties itself into knots, not that it is meant to not work. :|
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [RFC PATCH i-g-t 1/1] tests/gem_mmap_offset: Exercise mapping to userptr
  2020-01-31 14:37   ` Chris Wilson
@ 2020-01-31 14:56     ` Janusz Krzysztofik
  0 siblings, 0 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2020-01-31 14:56 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx, Matthew Auld

On Friday, January 31, 2020 3:37:05 PM CET Chris Wilson wrote:
> Quoting Janusz Krzysztofik (2020-01-31 13:12:34)
> > Creating a mapping to a userptr backed GEM object may cause a currently
> > unavoidable lockdep splat inside the i915 driver.  Then, such operation
> > is expected to fail to prevent from that badness to happen.
> > 
> > Add a respective subtest for each mapping type.
> > 
> > Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> > Cc: Matthew Auld <matthew.auld@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  tests/i915/gem_mmap_offset.c | 55 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> > 
> > diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> > index 7c4088cdf..a5f28328b 100644
> > --- a/tests/i915/gem_mmap_offset.c
> > +++ b/tests/i915/gem_mmap_offset.c
> > @@ -141,6 +141,36 @@ static void bad_extensions(int i915)
> >         gem_close(i915, arg.handle);
> >  }
> >  
> > +static bool has_userptr(int i915)
> > +{
> > +       uint32_t handle = 0;
> > +       void *ptr;
> > +
> > +       igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
> > +       if (__gem_userptr(i915, ptr, 4096, 0, 0, &handle) == 0)
> > +               gem_close(i915, handle);
> > +       free(ptr);
> > +
> > +       return handle;
> > +}
> > +
> > +static void userptr(int i915, uint64_t flags)
> > +{
> > +       struct drm_i915_gem_mmap_offset arg = {
> > +               .flags = flags,
> > +       };
> > +       void *ptr;
> > +
> > +       igt_assert_eq(posix_memalign(&ptr, 4096, 4096), 0);
> > +
> > +       gem_userptr(i915, ptr, 4096, 0, 0, &arg.handle);
> > +
> > +       igt_assert_eq(mmap_offset_ioctl(i915, &arg), -EINVAL);
> 
> Not quite. The only reason it doesn't work is because the implementation
> ties itself into knots, not that it is meant to not work. :|

Are you suggesting the test should fail if the IOCTL fails?  That would be 
fair, but how are we going to have that accepted by CI then, and merged?

Skipping also doesn't seem a good option to me.

I can add some more exhaustive examination should the IOCTL succeed, but that 
won't help to make CI happy.

From your long experience, what approach should we take?

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] 6+ messages in thread

end of thread, other threads:[~2020-01-31 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-31 13:12 [igt-dev] [RFC PATCH i-g-t 0/1] tests/gem_mmap_offset: Exercise mapping to userptr Janusz Krzysztofik
2020-01-31 13:12 ` [igt-dev] [RFC PATCH i-g-t 1/1] " Janusz Krzysztofik
2020-01-31 14:37   ` Chris Wilson
2020-01-31 14:56     ` Janusz Krzysztofik
2020-01-31 13:23 ` [igt-dev] [Intel-gfx] [RFC PATCH i-g-t 0/1] " Petri Latvala
2020-01-31 13:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox