Skip to contentSkip to conversation

i915/gem_exec_params: add test_invalid_batch_start

PATCH Superseded Matthew Auld 3 participants 5 messages Mar 4, 2020 – Mar 5, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i915/gem_exec_params: add test_invalid_batch_start

Sanity check that kernel rejects too large batch_start_offset.

---
 tests/i915/gem_exec_params.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
tests/i915/gem_exec_params.c +20 -0
index cf7ea306..afc8d2c7 100644
@@ -268,6 +268,23 @@ static void mmapped(int i915)
 	gem_close(i915, buf);
 }
 
+static void test_invalid_batch_start(int fd)
+{
+	struct drm_i915_gem_exec_object2 exec = {
+		.handle = batch_create(fd),
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&exec),
+		.buffer_count = 1,
+		.batch_start_offset = 4096, /* space jump */
+	};
+
+	igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL);
+
+	gem_sync(fd, exec.handle);
+	gem_close(fd, exec.handle);
+}
+
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
 uint32_t batch[2] = {MI_BATCH_BUFFER_END};
@@ -507,6 +524,9 @@ igt_main
 	igt_subtest("batch-first")
 		test_batch_first(fd);
 
+	igt_subtest("invalid-batch-start-offset")
+		test_invalid_batch_start(fd);
+
 #define DIRT(name) \
 	igt_subtest(#name "-dirt") { \
 		execbuf.flags = 0; \
Signature · 6 lines
2.20.1

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

[igt-dev] ✗ GitLab.Pipeline: failure for i915/gem_exec_params: add test_invalid_batch_start

== Series Details ==

== Series Details ==

Series: i915/gem_exec_params: add test_invalid_batch_start
URL : https://patchwork.freedesktop.org/series/74288/
State : failure

== Summary ==

ERROR! This series introduces new undocumented tests:

gem_exec_params@invalid-batch-start-offset

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

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

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/116002
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for i915/gem_exec_params: add test_invalid_batch_start

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: i915/gem_exec_params: add test_invalid_batch_start
URL : https://patchwork.freedesktop.org/series/74288/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8068 -> IGTPW_4260
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_chamelium@dp-edid-read:
- fi-cml-u2: [PASS][1] -> [FAIL][2] ([i915#217] / [i915#976])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8068/fi-cml-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4260/fi-cml-u2/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][3] -> [FAIL][4] ([fdo#111407])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8068/fi-kbl-7500u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4260/fi-kbl-7500u/igt@[email protected]

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

#### Possible fixes ####

* igt@i915_getparams_basic@basic-eu-total:
- fi-tgl-y: [DMESG-WARN][7] ([CI#94] / [i915#402]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8068/fi-tgl-y/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4260/fi-tgl-y/igt@[email protected]

* igt@i915_selftest@live@gem_contexts:
- fi-cfl-8700k: [INCOMPLETE][9] ([i915#424]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8068/fi-cfl-8700k/igt@i915_selftest@live@gem_contexts.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4260/fi-cfl-8700k/igt@i915_selftest@live@gem_contexts.html

[CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[i915#217]: https://gitlab.freedesktop.org/drm/intel/issues/217
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#424]: https://gitlab.freedesktop.org/drm/intel/issues/424
[i915#976]: https://gitlab.freedesktop.org/drm/intel/issues/976

Participating hosts (52 -> 41)
------------------------------

Additional (1): fi-gdg-551
Missing (12): fi-ilk-m540 fi-hsw-4200u fi-skl-guc fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-cfl-8109u fi-bsw-kefka fi-kbl-7560u fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* IGT: IGT_5492 -> IGTPW_4260

CI-20190529: 20190529
CI_DRM_8068: f8e69af5cca45947ebce78f677b75b0ecc4ba744 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4260: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4260/index.html
IGT_5492: 2be153507cdd652843f6ab44cc2a52a7f30206d9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@gem_exec_params@invalid-batch-start-offset

== Logs ==

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Matthew Auld
Quoted 15 lines · Matthew Auld

Sanity check that kernel rejects too large batch_start_offset.

---
 tests/i915/gem_exec_params.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
tests/i915/gem_exec_params.c +0 -0
index cf7ea306..afc8d2c7 100644
@@ -268,6 +268,23 @@ static void mmapped(int i915)
 	gem_close(i915, buf);
 }

tests/i915/gem_exec_params.c static void mmapped(int i915) · line 279

Quoted 10 lines
tests/i915/gem_exec_params.c +9 -0
 
+static void test_invalid_batch_start(int fd)
+{
+	struct drm_i915_gem_exec_object2 exec = {
+		.handle = batch_create(fd),
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&exec),
+		.buffer_count = 1,
+		.batch_start_offset = 4096, /* space jump */

If we could get batch size from the handle would be more documentative.

Quoted 28 lines
tests/i915/gem_exec_params.c +11 -0
+	};
+
+	igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL);
+
+	gem_sync(fd, exec.handle);
+	gem_close(fd, exec.handle);
+}
+
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
 uint32_t batch[2] = {MI_BATCH_BUFFER_END};
@@ -507,6 +524,9 @@ igt_main
 	igt_subtest("batch-first")
 		test_batch_first(fd);
 
+	igt_subtest("invalid-batch-start-offset")
+		test_invalid_batch_start(fd);
+
 #define DIRT(name) \
 	igt_subtest(#name "-dirt") { \
 		execbuf.flags = 0; \
Signature · 6 lines
2.20.1

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

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

#4 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for i915/gem_exec_params: add test_invalid_batch_start

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: i915/gem_exec_params: add test_invalid_batch_start
URL : https://patchwork.freedesktop.org/series/74289/
State : failure

== Summary ==

Applying: i915/gem_exec_params: add test_invalid_batch_start
error: sha1 information is lacking or useless (tests/i915/gem_exec_params.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch Patch failed at 0001 i915/gem_exec_params: add test_invalid_batch_start When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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