Skip to contentSkip to conversation

tests/i915/gem_create: Remove page nonaligned buffer tests

PATCH In review Ramalingam C 3 participants 5 messages Jan 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/i915/gem_create: Remove page nonaligned buffer tests

Considering that kernel returns the real memory size(page aligned) allocated, nonaligned buffer tests are not valid anymore. Hence removing them.

---
 tests/i915/gem_create.c | 46 -----------------------------------------
 1 file changed, 46 deletions(-)
tests/i915/gem_create.c +0 -46
index 8fc128dae6e2..d80479c757e8 100644
@@ -119,46 +119,6 @@ static void invalid_size_test(int fd)
 	igt_assert_eq(create_ioctl(fd, &create), -EINVAL);
 }
 
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size but smaller than the
- * object's last page boundary. pwrite here must be successful.
- */
-static void valid_nonaligned_size(int fd)
-{
-	struct drm_i915_gem_create create = {
-		.size = PAGE_SIZE / 2,
-	};
-	char buf[PAGE_SIZE];
-
-	igt_assert_eq(create_ioctl(fd, &create), 0);
-
-	gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
-
-	gem_close(fd, create.handle);
-}
-
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size and larger than the
- * object's last page boundary. pwrite here must fail.
- */
-static void invalid_nonaligned_size(int fd)
-{
-	struct drm_i915_gem_create create = {
-		.size = PAGE_SIZE / 2,
-	};
-	char buf[PAGE_SIZE];
-
-	igt_assert_eq(create_ioctl(fd, &create), 0);
-
-	/* This should fail. Hence cannot use gem_write. */
-	igt_assert(__gem_write(fd, create.handle,
-			       PAGE_SIZE / 2, buf, PAGE_SIZE));
-
-	gem_close(fd, create.handle);
-}
-
 static uint64_t atomic_compare_swap_u64(_Atomic(uint64_t) *ptr,
 					uint64_t oldval, uint64_t newval)
 {
@@ -304,12 +264,6 @@ igt_main
 	igt_subtest("create-invalid-size")
 		invalid_size_test(fd);
 
-	igt_subtest("create-valid-nonaligned")
-		valid_nonaligned_size(fd);
-
-	igt_subtest("create-invalid-nonaligned")
-		invalid_nonaligned_size(fd);
-
 	igt_subtest("create-size-update")
 		size_update(fd);
 
Signature · 6 lines
2.20.1

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

Quoting Ramalingam C (2020-01-27 08:46:10)

Quoted 26 lines

Considering that kernel returns the real memory size(page aligned) allocated, nonaligned buffer tests are not valid anymore. Hence removing them.

---
 tests/i915/gem_create.c | 46 -----------------------------------------
 1 file changed, 46 deletions(-)
tests/i915/gem_create.c +0 -7
index 8fc128dae6e2..d80479c757e8 100644
@@ -119,46 +119,6 @@ static void invalid_size_test(int fd)
        igt_assert_eq(create_ioctl(fd, &create), -EINVAL);
 }
 
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size but smaller than the
- * object's last page boundary. pwrite here must be successful.
- */
-static void valid_nonaligned_size(int fd)
-{

tests/i915/gem_create.c static void invalid_size_test(int fd) · line 138

Quoted 10 lines
tests/i915/gem_create.c +0 -10
-       struct drm_i915_gem_create create = {
-               .size = PAGE_SIZE / 2,
-       };
-       char buf[PAGE_SIZE];
-
-       igt_assert_eq(create_ioctl(fd, &create), 0);
-
-       gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
-
-       gem_close(fd, create.handle);

This is reasonable, just add a igt_assert(create.size >= PAGE_SIZE) as well. We pass in a small request, the kernel pads it to a minimum of system page size so that it will work with the usual page aligned interfaces. We verify that the extra size returned by the kernel is usable.

Quoted 9 lines
tests/i915/gem_create.c +0 -9
-}
-
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size and larger than the
- * object's last page boundary. pwrite here must fail.
- */
-static void invalid_nonaligned_size(int fd)
-{

tests/i915/gem_create.c static void invalid_size_test(int fd) · line 157

Quoted 10 lines
tests/i915/gem_create.c +0 -10
-       struct drm_i915_gem_create create = {
-               .size = PAGE_SIZE / 2,
-       };
-       char buf[PAGE_SIZE];
-
-       igt_assert_eq(create_ioctl(fd, &create), 0);
-
-       /* This should fail. Hence cannot use gem_write. */
-       igt_assert(__gem_write(fd, create.handle,
-                              PAGE_SIZE / 2, buf, PAGE_SIZE));

This is falling under gem_write testing, since we aren't looking at create.size and deliberating trying to write passed the end.

So I wouldn't be upset losing this.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw
Quoted 31 lines · Chris Wilson

Quoting Ramalingam C (2020-01-27 08:46:10)

Quoted 30 lines

Considering that kernel returns the real memory size(page aligned) allocated, nonaligned buffer tests are not valid anymore. Hence removing them.

---
 tests/i915/gem_create.c | 46 -----------------------------------------
 1 file changed, 46 deletions(-)
tests/i915/gem_create.c +0 -11
index 8fc128dae6e2..d80479c757e8 100644
@@ -119,46 +119,6 @@ static void invalid_size_test(int fd)
        igt_assert_eq(create_ioctl(fd, &create), -EINVAL);
 }
 
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size but smaller than the
- * object's last page boundary. pwrite here must be successful.
- */
-static void valid_nonaligned_size(int fd)
-{
-       struct drm_i915_gem_create create = {
-               .size = PAGE_SIZE / 2,
-       };
-       char buf[PAGE_SIZE];
Quoted 8 lines

tests/i915/gem_create.c static void invalid_size_test(int fd) · line 138

Quoted 6 lines
tests/i915/gem_create.c +0 -6
-
-       igt_assert_eq(create_ioctl(fd, &create), 0);
-
-       gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
-
-       gem_close(fd, create.handle);

This is reasonable, just add a igt_assert(create.size >= PAGE_SIZE) as

you mean igt_assert(create.size == PAGE_SIZE) right... ?

I will update this test.

-Ram

Quoted 28 lines

well. We pass in a small request, the kernel pads it to a minimum of system page size so that it will work with the usual page aligned interfaces. We verify that the extra size returned by the kernel is usable.

Quoted 9 lines
tests/i915/gem_create.c +0 -9
-}
-
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size and larger than the
- * object's last page boundary. pwrite here must fail.
- */
-static void invalid_nonaligned_size(int fd)
-{

tests/i915/gem_create.c static void invalid_size_test(int fd) · line 157

Quoted 10 lines
tests/i915/gem_create.c +0 -10
-       struct drm_i915_gem_create create = {
-               .size = PAGE_SIZE / 2,
-       };
-       char buf[PAGE_SIZE];
-
-       igt_assert_eq(create_ioctl(fd, &create), 0);
-
-       /* This should fail. Hence cannot use gem_write. */
-       igt_assert(__gem_write(fd, create.handle,
-                              PAGE_SIZE / 2, buf, PAGE_SIZE));

This is falling under gem_write testing, since we aren't looking at create.size and deliberating trying to write passed the end.

Quoted 2 lines

So I wouldn't be upset losing this.
-Chris

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

#3 lore raw

Quoting Ramalingam C (2020-01-27 09:46:46)

Quoted 40 lines · Chris Wilson
Quoted 31 lines

Quoting Ramalingam C (2020-01-27 08:46:10)

Quoted 30 lines

Considering that kernel returns the real memory size(page aligned) allocated, nonaligned buffer tests are not valid anymore. Hence removing them.

---
 tests/i915/gem_create.c | 46 -----------------------------------------
 1 file changed, 46 deletions(-)
tests/i915/gem_create.c +0 -11
index 8fc128dae6e2..d80479c757e8 100644
@@ -119,46 +119,6 @@ static void invalid_size_test(int fd)
        igt_assert_eq(create_ioctl(fd, &create), -EINVAL);
 }
 
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size but smaller than the
- * object's last page boundary. pwrite here must be successful.
- */
-static void valid_nonaligned_size(int fd)
-{
-       struct drm_i915_gem_create create = {
-               .size = PAGE_SIZE / 2,
-       };
-       char buf[PAGE_SIZE];
Quoted 8 lines

tests/i915/gem_create.c static void invalid_size_test(int fd) · line 138

Quoted 6 lines
tests/i915/gem_create.c +0 -6
-
-       igt_assert_eq(create_ioctl(fd, &create), 0);
-
-       gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
-
-       gem_close(fd, create.handle);

This is reasonable, just add a igt_assert(create.size >= PAGE_SIZE) as

Quoted 1 line

you mean igt_assert(create.size == PAGE_SIZE) right... ?

No, we already do return aligned to mr->min_page_size, so we want some generality. The minimum we expect is aligned to PAGE_SIZE, so that is the minimum we need to enforce to ensure consistency with system-page aligned uAPI (e.g. mmap).
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_create: Remove page nonaligned buffer tests

In reply to Ramalingam C
== Series Details ==

== Series Details ==

Series: tests/i915/gem_create: Remove page nonaligned buffer tests
URL : https://patchwork.freedesktop.org/series/72603/
State : success

== Summary ==

CI Bug Log - changes from IGT_5387 -> IGTPW_3998
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_close_race@basic-threads:
- fi-byt-n2820: [PASS][1] -> [INCOMPLETE][2] ([i915#45])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-byt-n2820/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-byt-n2820/igt@[email protected]

* igt@i915_module_load@reload-with-fault-injection:
- fi-skl-6700k2: [PASS][3] -> [DMESG-WARN][4] ([i915#889])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-skl-6700k2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-skl-6700k2/igt@[email protected]

* igt@i915_selftest@live_blt:
- fi-bsw-nick: [PASS][5] -> [DMESG-FAIL][6] ([i915#723])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-bsw-nick/igt@i915_selftest@live_blt.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-bsw-nick/igt@i915_selftest@live_blt.html

* igt@i915_selftest@live_gt_heartbeat:
- fi-bsw-nick: [PASS][7] -> [DMESG-FAIL][8] ([i915#541])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-bsw-nick/igt@i915_selftest@live_gt_heartbeat.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-bsw-nick/igt@i915_selftest@live_gt_heartbeat.html

* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [PASS][9] -> [DMESG-WARN][10] ([i915#44])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-hsw-peppy/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-hsw-peppy/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
- fi-icl-dsi: [PASS][11] -> [DMESG-WARN][12] ([i915#109])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5387/fi-icl-dsi/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/fi-icl-dsi/igt@[email protected]

#### Possible fixes ####

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

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

[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[i915#109]: https://gitlab.freedesktop.org/drm/intel/issues/109
[i915#44]: https://gitlab.freedesktop.org/drm/intel/issues/44
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#541]: https://gitlab.freedesktop.org/drm/intel/issues/541
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#723]: https://gitlab.freedesktop.org/drm/intel/issues/723
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#889]: https://gitlab.freedesktop.org/drm/intel/issues/889

Participating hosts (49 -> 44)
------------------------------

Additional (1): fi-apl-guc
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* IGT: IGT_5387 -> IGTPW_3998

CI-20190529: 20190529
CI_DRM_7816: 713d2a22a63ee93c0afea9a83c332f52ef90e91a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3998: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3998/index.html
IGT_5387: 2e04a36cb5eba1a979bce80b58c35687f324f066 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

-igt@gem_create@create-invalid-nonaligned
-igt@gem_create@create-valid-nonaligned

== Logs ==

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