* [igt-dev] [RFC 0/4] Improve mmap interface coverage
@ 2019-03-12 21:57 Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 21:57 UTC (permalink / raw)
To: igt-dev
Adding some negative interface tests to the mmap IOCTL. The tests introduced
here supply some invalid parameters to the MMAP IOCTL and expect an error
in return.
The series also adds a new test for prime mmap correctness. The idea was to add
tests for all coherency correctness checks but the tests but all those I looked
at had a WC subtest. Since I probably missed something sending this as RFC :).
Antonio Argenziano (4):
tests/i915/gem_mmap_gtt: Add invalid parameters test
tests/i915/gem_mmap: Add invalid parameters tests
tests/i915/gem_mmap_wc: Add invalid params tests
tests/i915/prime_mmap: Add WC correctness test
tests/i915/gem_mmap.c | 18 ++++++++++++++
tests/i915/gem_mmap_gtt.c | 12 +++++++++
tests/i915/gem_mmap_wc.c | 52 +++++++++++++++++++++++++++++++++++++++
tests/prime_mmap.c | 36 +++++++++++++++++++++++++--
4 files changed, 116 insertions(+), 2 deletions(-)
--
2.20.1
_______________________________________________
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] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
@ 2019-03-12 21:57 ` Antonio Argenziano
2019-03-12 22:04 ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 21:57 UTC (permalink / raw)
To: igt-dev
Add a test for an invalid handle being passed to the IOCTL.
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
tests/i915/gem_mmap_gtt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index f6fbbe19..58f7403c 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -831,6 +831,18 @@ igt_main
igt_fixture
fd = drm_open_driver(DRIVER_INTEL);
+ igt_subtest("bad-object") {
+ struct drm_i915_gem_mmap arg;
+ int ret;
+
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = 0x10101010;
+ arg.offset = 0;
+ arg.size = 4096;
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
+ igt_assert(ret == -1 && errno == ENOENT);
+ }
+
igt_subtest("basic")
test_access(fd);
igt_subtest("basic-short")
--
2.20.1
_______________________________________________
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] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
@ 2019-03-12 21:57 ` Antonio Argenziano
2019-03-12 22:02 ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests Antonio Argenziano
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 21:57 UTC (permalink / raw)
To: igt-dev
Add a couple of tests that supply invalid parameters to the mmap IOCTL.
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
tests/i915/gem_mmap.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index 0ed15878..2a676b9a 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -136,6 +136,24 @@ igt_main
igt_assert(ret == -1 && errno == ENOENT);
}
+ igt_subtest("bad-offset") {
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = gem_create(fd, 4096);
+ arg.offset = 4096 + 1;
+ arg.size = 4096;
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
+ igt_assert(ret == -1 && errno == EINVAL);
+ }
+
+ igt_subtest("bad-size") {
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = gem_create(fd, 4096);
+ arg.offset = 4096;
+ arg.size = 0;
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
+ igt_assert(ret == -1 && errno == EINVAL);
+ }
+
igt_subtest("basic") {
arg.handle = gem_create(fd, OBJECT_SIZE);
arg.offset = 0;
--
2.20.1
_______________________________________________
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] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
@ 2019-03-12 21:57 ` Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 21:57 UTC (permalink / raw)
To: igt-dev
Add some invalid parameters tests for the MMAP IOCTL when the MMAP_WC
flag is supplied.
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
tests/i915/gem_mmap_wc.c | 52 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index baa68aa8..66945c87 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -463,6 +463,58 @@ igt_main
gem_require_mmap_wc(fd);
}
+ igt_subtest_group {
+
+ igt_subtest("bad-object") {
+ int ret;
+ struct drm_i915_gem_mmap arg;
+
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = 0x10101010;
+ arg.offset = 0;
+ arg.size = 4096;
+ arg.flags = I915_MMAP_WC;
+
+ errno = 0;
+
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
+ igt_assert(ret == -1 && errno == ENOENT);
+ }
+
+ igt_subtest("bad-offset") {
+ int ret;
+ struct drm_i915_gem_mmap arg;
+
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = gem_create(fd, 4096);
+ arg.offset = 4096 + 1;
+ arg.size = 4096;
+ arg.flags = I915_MMAP_WC;
+
+ errno = 0;
+
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
+ arg.flags = I915_MMAP_WC;
+ igt_assert(ret == -1 && errno == EINVAL);
+ }
+
+ igt_subtest("bad-size") {
+ int ret;
+ struct drm_i915_gem_mmap arg;
+
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = gem_create(fd, 4096);
+ arg.offset = 4096;
+ arg.size = 0;
+ arg.flags = I915_MMAP_WC;
+
+ errno = 0;
+
+ ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
+ igt_assert(ret == -1 && errno == EINVAL);
+ }
+ }
+
igt_subtest("invalid-flags")
test_invalid_flags(fd);
igt_subtest("close")
--
2.20.1
_______________________________________________
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] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
` (2 preceding siblings ...)
2019-03-12 21:57 ` [igt-dev] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests Antonio Argenziano
@ 2019-03-12 21:57 ` Antonio Argenziano
2019-03-12 22:07 ` Chris Wilson
2019-03-13 13:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage Patchwork
2019-03-13 16:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 1 reply; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 21:57 UTC (permalink / raw)
To: igt-dev
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
tests/prime_mmap.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index fc985784..d3833f91 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -73,7 +73,7 @@ fill_bo_cpu(char *ptr)
}
static void
-test_correct(void)
+test_correct_gtt(void)
{
int dma_buf_fd;
char *ptr1, *ptr2;
@@ -101,6 +101,37 @@ test_correct(void)
gem_close(fd, handle);
}
+static void
+test_correct_wc(void)
+{
+ int dma_buf_fd;
+ char *ptr1, *ptr2;
+ uint32_t handle;
+
+ gem_require_mmap_wc(fd);
+
+ handle = gem_create(fd, BO_SIZE);
+ fill_bo(handle, BO_SIZE);
+
+ dma_buf_fd = prime_handle_to_fd(fd, handle);
+ igt_assert(errno == 0);
+
+ /* Check correctness vs WC mapping */
+ ptr1 = gem_mmap__wc(fd, handle, 0, BO_SIZE, PROT_READ);
+ ptr2 = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0);
+ igt_assert(ptr1 != MAP_FAILED);
+ igt_assert(ptr2 != MAP_FAILED);
+ igt_assert(memcmp(ptr1, ptr2, BO_SIZE) == 0);
+
+ /* Check pattern correctness */
+ igt_assert(memcmp(ptr2, pattern, sizeof(pattern)) == 0);
+
+ munmap(ptr1, BO_SIZE);
+ munmap(ptr2, BO_SIZE);
+ close(dma_buf_fd);
+ gem_close(fd, handle);
+}
+
static void
test_map_unmap(void)
{
@@ -502,7 +533,8 @@ igt_main
const char *name;
void (*fn)(void);
} tests[] = {
- { "test_correct", test_correct },
+ { "test_correct_gtt", test_correct_gtt },
+ { "test_correct_wc", test_correct_wc },
{ "test_map_unmap", test_map_unmap },
{ "test_reprime", test_reprime },
{ "test_forked", test_forked },
--
2.20.1
_______________________________________________
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
* Re: [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
@ 2019-03-12 22:02 ` Chris Wilson
2019-03-12 22:13 ` Antonio Argenziano
2019-03-13 22:18 ` Antonio Argenziano
0 siblings, 2 replies; 15+ messages in thread
From: Chris Wilson @ 2019-03-12 22:02 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev
Quoting Antonio Argenziano (2019-03-12 21:57:36)
> Add a couple of tests that supply invalid parameters to the mmap IOCTL.
>
> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> tests/i915/gem_mmap.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
> index 0ed15878..2a676b9a 100644
> --- a/tests/i915/gem_mmap.c
> +++ b/tests/i915/gem_mmap.c
> @@ -136,6 +136,24 @@ igt_main
> igt_assert(ret == -1 && errno == ENOENT);
> }
>
> + igt_subtest("bad-offset") {
> + memset(&arg, 0, sizeof(arg));
> + arg.handle = gem_create(fd, 4096);
> + arg.offset = 4096 + 1;
> + arg.size = 4096;
> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
> + igt_assert(ret == -1 && errno == EINVAL);
Also arg.offset = -size is a good one.
Then size=8192 and arg.offset=-4096;
> + }
> +
> + igt_subtest("bad-size") {
> + memset(&arg, 0, sizeof(arg));
> + arg.handle = gem_create(fd, 4096);
> + arg.offset = 4096;
> + arg.size = 0;
> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
> + igt_assert(ret == -1 && errno == EINVAL);
Also >4096, -4096
-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: [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
@ 2019-03-12 22:04 ` Chris Wilson
2019-03-12 22:11 ` Antonio Argenziano
0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2019-03-12 22:04 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev
Quoting Antonio Argenziano (2019-03-12 21:57:35)
> Add a test for an invalid handle being passed to the IOCTL.
>
> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> tests/i915/gem_mmap_gtt.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> index f6fbbe19..58f7403c 100644
> --- a/tests/i915/gem_mmap_gtt.c
> +++ b/tests/i915/gem_mmap_gtt.c
> @@ -831,6 +831,18 @@ igt_main
> igt_fixture
> fd = drm_open_driver(DRIVER_INTEL);
>
> + igt_subtest("bad-object") {
> + struct drm_i915_gem_mmap arg;
> + int ret;
> +
> + memset(&arg, 0, sizeof(arg));
> + arg.handle = 0x10101010;
For bad handles, also try creating a valid handle and checking
for (i = 16; i < BITS_PER_TYPE(arg.handle); i++)
arg.handle = real_handle | BIT(i);
Especially with (1<<31) set as historically the idr was only a 31-bit
cyclic allocator, so might be susceptible to wraparound.
-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: [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
@ 2019-03-12 22:07 ` Chris Wilson
0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2019-03-12 22:07 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev
Quoting Antonio Argenziano (2019-03-12 21:57:38)
> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> tests/prime_mmap.c | 36 ++++++++++++++++++++++++++++++++++--
> 1 file changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> index fc985784..d3833f91 100644
> --- a/tests/prime_mmap.c
> +++ b/tests/prime_mmap.c
> @@ -73,7 +73,7 @@ fill_bo_cpu(char *ptr)
> }
>
> static void
> -test_correct(void)
> +test_correct_gtt(void)
> {
> int dma_buf_fd;
> char *ptr1, *ptr2;
> @@ -101,6 +101,37 @@ test_correct(void)
> gem_close(fd, handle);
> }
>
> +static void
> +test_correct_wc(void)
> +{
> + int dma_buf_fd;
> + char *ptr1, *ptr2;
> + uint32_t handle;
> +
> + gem_require_mmap_wc(fd);
> +
> + handle = gem_create(fd, BO_SIZE);
> + fill_bo(handle, BO_SIZE);
> +
> + dma_buf_fd = prime_handle_to_fd(fd, handle);
> + igt_assert(errno == 0);
> +
> + /* Check correctness vs WC mapping */
> + ptr1 = gem_mmap__wc(fd, handle, 0, BO_SIZE, PROT_READ);
> + ptr2 = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0);
But both for read. Where's the write through one mmap, check it arrives
in the second.
memcmp(ptr1, ptr2) just reduces to
memcmp(ptr1, pattern) || memcmp(ptr2, pattern)
The fault handling in the kernel is no different between those two.
-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: [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test
2019-03-12 22:04 ` Chris Wilson
@ 2019-03-12 22:11 ` Antonio Argenziano
2019-03-12 22:18 ` Chris Wilson
0 siblings, 1 reply; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 22:11 UTC (permalink / raw)
To: Chris Wilson, igt-dev
On 12/03/19 15:04, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-03-12 21:57:35)
>> Add a test for an invalid handle being passed to the IOCTL.
>>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> ---
>> tests/i915/gem_mmap_gtt.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
>> index f6fbbe19..58f7403c 100644
>> --- a/tests/i915/gem_mmap_gtt.c
>> +++ b/tests/i915/gem_mmap_gtt.c
>> @@ -831,6 +831,18 @@ igt_main
>> igt_fixture
>> fd = drm_open_driver(DRIVER_INTEL);
>>
>> + igt_subtest("bad-object") {
>> + struct drm_i915_gem_mmap arg;
>> + int ret;
>> +
>> + memset(&arg, 0, sizeof(arg));
>> + arg.handle = 0x10101010;
>
> For bad handles, also try creating a valid handle and checking
> for (i = 16; i < BITS_PER_TYPE(arg.handle); i++)
> arg.handle = real_handle | BIT(i);
>
> Especially with (1<<31) set as historically the idr was only a 31-bit
> cyclic allocator, so might be susceptible to wraparound.
Would:
real_handle = gem_create(...);
arg.handle = real_handle + 1;
guarantee an invalid handle?
Antonio
> -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: [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
2019-03-12 22:02 ` Chris Wilson
@ 2019-03-12 22:13 ` Antonio Argenziano
2019-03-13 22:18 ` Antonio Argenziano
1 sibling, 0 replies; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-12 22:13 UTC (permalink / raw)
To: Chris Wilson, igt-dev
On 12/03/19 15:02, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-03-12 21:57:36)
>> Add a couple of tests that supply invalid parameters to the mmap IOCTL.
>>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> ---
>> tests/i915/gem_mmap.c | 18 ++++++++++++++++++
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
>> index 0ed15878..2a676b9a 100644
>> --- a/tests/i915/gem_mmap.c
>> +++ b/tests/i915/gem_mmap.c
>> @@ -136,6 +136,24 @@ igt_main
>> igt_assert(ret == -1 && errno == ENOENT);
>> }
>>
>> + igt_subtest("bad-offset") {
>> + memset(&arg, 0, sizeof(arg));
>> + arg.handle = gem_create(fd, 4096);
>> + arg.offset = 4096 + 1;
>> + arg.size = 4096;
>> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> + igt_assert(ret == -1 && errno == EINVAL);
>
> Also arg.offset = -size is a good one.
>
> Then size=8192 and arg.offset=-4096;
>
>> + }
>> +
>> + igt_subtest("bad-size") {
>> + memset(&arg, 0, sizeof(arg));
>> + arg.handle = gem_create(fd, 4096);
>> + arg.offset = 4096;
>> + arg.size = 0;
>> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> + igt_assert(ret == -1 && errno == EINVAL);
>
> Also >4096, -4096
Makes sense, I'll make the same changes to all files (where applicable).
Antonio
> -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: [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test
2019-03-12 22:11 ` Antonio Argenziano
@ 2019-03-12 22:18 ` Chris Wilson
0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2019-03-12 22:18 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev
Quoting Antonio Argenziano (2019-03-12 22:11:06)
>
>
> On 12/03/19 15:04, Chris Wilson wrote:
> > Quoting Antonio Argenziano (2019-03-12 21:57:35)
> >> Add a test for an invalid handle being passed to the IOCTL.
> >>
> >> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> >> ---
> >> tests/i915/gem_mmap_gtt.c | 12 ++++++++++++
> >> 1 file changed, 12 insertions(+)
> >>
> >> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> >> index f6fbbe19..58f7403c 100644
> >> --- a/tests/i915/gem_mmap_gtt.c
> >> +++ b/tests/i915/gem_mmap_gtt.c
> >> @@ -831,6 +831,18 @@ igt_main
> >> igt_fixture
> >> fd = drm_open_driver(DRIVER_INTEL);
> >>
> >> + igt_subtest("bad-object") {
> >> + struct drm_i915_gem_mmap arg;
> >> + int ret;
> >> +
> >> + memset(&arg, 0, sizeof(arg));
> >> + arg.handle = 0x10101010;
> >
> > For bad handles, also try creating a valid handle and checking
> > for (i = 16; i < BITS_PER_TYPE(arg.handle); i++)
> > arg.handle = real_handle | BIT(i);
> >
> > Especially with (1<<31) set as historically the idr was only a 31-bit
> > cyclic allocator, so might be susceptible to wraparound.
>
> Would:
> real_handle = gem_create(...);
> arg.handle = real_handle + 1;
>
> guarantee an invalid handle?
If there's only been one handle allocated, yes.
-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
* [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
` (3 preceding siblings ...)
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
@ 2019-03-13 13:38 ` Patchwork
2019-03-13 16:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2019-03-13 13:38 UTC (permalink / raw)
To: Antonio Argenziano; +Cc: igt-dev
== Series Details ==
Series: Improve mmap interface coverage
URL : https://patchwork.freedesktop.org/series/57906/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5737 -> IGTPW_2600
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/57906/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2600 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@fork-gfx0:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109315] +17
* igt@gem_ctx_create@basic-files:
- fi-gdg-551: NOTRUN -> SKIP [fdo#109271] +106
* igt@gem_exec_basic@gtt-bsd2:
- fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] +57
* igt@gem_exec_basic@readonly-bsd1:
- fi-snb-2520m: NOTRUN -> SKIP [fdo#109271] +57
- fi-icl-u2: NOTRUN -> SKIP [fdo#109276] +7
* igt@gem_exec_parse@basic-allowed:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109289] +1
* igt@i915_selftest@live_contexts:
- fi-icl-u2: NOTRUN -> DMESG-FAIL [fdo#108569]
* igt@kms_addfb_basic@addfb25-y-tiled-small:
- fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] +56
* igt@kms_busy@basic-flip-a:
- fi-gdg-551: NOTRUN -> FAIL [fdo#103182]
* igt@kms_busy@basic-flip-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-gdg-551: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-snb-2520m: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_chamelium@dp-edid-read:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109316] +2
* igt@kms_chamelium@hdmi-edid-read:
- fi-hsw-peppy: NOTRUN -> SKIP [fdo#109271] +46
* igt@kms_chamelium@vga-hpd-fast:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109309] +1
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109285] +3
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: PASS -> FAIL [fdo#103167]
- fi-hsw-peppy: NOTRUN -> DMESG-FAIL [fdo#102614] / [fdo#107814]
- fi-icl-u2: NOTRUN -> FAIL [fdo#103167]
- fi-byt-clapper: NOTRUN -> FAIL [fdo#103167]
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] +48
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-byt-clapper: NOTRUN -> FAIL [fdo#103191] / [fdo#107362] +1
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107814]: https://bugs.freedesktop.org/show_bug.cgi?id=107814
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109294]: https://bugs.freedesktop.org/show_bug.cgi?id=109294
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109316]: https://bugs.freedesktop.org/show_bug.cgi?id=109316
[fdo#110028]: https://bugs.freedesktop.org/show_bug.cgi?id=110028
Participating hosts (41 -> 43)
------------------------------
Additional (7): fi-hsw-peppy fi-icl-u2 fi-snb-2520m fi-gdg-551 fi-icl-y fi-byt-n2820 fi-byt-clapper
Missing (5): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-ctg-p8600 fi-bdw-samus
Build changes
-------------
* IGT: IGT_4883 -> IGTPW_2600
CI_DRM_5737: d5bb7d77aa77996702426496078a597f30bead58 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2600: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2600/
IGT_4883: b25e06d6ddf2e42044cd9c93b613cbc7339a8c33 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@gem_mmap@bad-offset
+igt@gem_mmap@bad-size
+igt@gem_mmap_gtt@bad-object
+igt@gem_mmap_wc@bad-object
+igt@gem_mmap_wc@bad-offset
+igt@gem_mmap_wc@bad-size
+igt@prime_mmap@test_correct_gtt
+igt@prime_mmap@test_correct_wc
-igt@prime_mmap@test_correct
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2600/
_______________________________________________
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 Improve mmap interface coverage
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
` (4 preceding siblings ...)
2019-03-13 13:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage Patchwork
@ 2019-03-13 16:12 ` Patchwork
5 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2019-03-13 16:12 UTC (permalink / raw)
To: Antonio Argenziano; +Cc: igt-dev
== Series Details ==
Series: Improve mmap interface coverage
URL : https://patchwork.freedesktop.org/series/57906/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5737_full -> IGTPW_2600_full
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with IGTPW_2600_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_2600_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/57906/revisions/1/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_2600_full:
### IGT changes ###
#### Warnings ####
* igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> FAIL
New tests
---------
New tests have been introduced between CI_DRM_5737_full and IGTPW_2600_full:
### New IGT tests (8) ###
* igt@gem_mmap@bad-offset:
- Statuses : 5 pass(s)
- Exec time: [0.0] s
* igt@gem_mmap@bad-size:
- Statuses : 4 pass(s)
- Exec time: [0.0] s
* igt@gem_mmap_gtt@bad-object:
- Statuses : 5 pass(s)
- Exec time: [0.0] s
* igt@gem_mmap_wc@bad-object:
- Statuses : 5 pass(s)
- Exec time: [0.0] s
* igt@gem_mmap_wc@bad-offset:
- Statuses : 4 pass(s)
- Exec time: [0.0] s
* igt@gem_mmap_wc@bad-size:
- Statuses : 5 pass(s)
- Exec time: [0.0] s
* igt@prime_mmap@test_correct_gtt:
- Statuses : 5 pass(s)
- Exec time: [0.00, 0.01] s
* igt@prime_mmap@test_correct_wc:
- Statuses : 5 pass(s)
- Exec time: [0.00, 0.01] s
Known issues
------------
Here are the changes found in IGTPW_2600_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_param@invalid-param-set:
- shard-snb: NOTRUN -> FAIL [fdo#109674]
* igt@gem_eio@unwedge-stress:
- shard-snb: PASS -> FAIL [fdo#109661]
* igt@gem_exec_schedule@preempt-other-chain-blt:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +106
* igt@gem_softpin@noreloc-s3:
- shard-hsw: PASS -> INCOMPLETE [fdo#103540]
* igt@i915_pm_rpm@dpms-lpsp:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +31
* igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
- shard-kbl: PASS -> FAIL [fdo#109660]
* igt@kms_atomic_transition@3x-modeset-transitions:
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-kbl: PASS -> DMESG-WARN [fdo#107956] +1
- shard-snb: PASS -> DMESG-WARN [fdo#107956]
- shard-hsw: PASS -> DMESG-WARN [fdo#107956]
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-glk: PASS -> FAIL [fdo#108145]
* igt@kms_color@pipe-a-degamma:
- shard-glk: NOTRUN -> FAIL [fdo#104782] / [fdo#108145]
* igt@kms_color@pipe-b-ctm-max:
- shard-kbl: PASS -> FAIL [fdo#108147]
* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-glk: NOTRUN -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-glk: NOTRUN -> INCOMPLETE [fdo#103359] / [k.org#198133]
* igt@kms_cursor_crc@cursor-256x85-offscreen:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] +1
* igt@kms_cursor_crc@cursor-256x85-onscreen:
- shard-apl: PASS -> FAIL [fdo#103232]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-kbl: PASS -> FAIL [fdo#103167]
- shard-apl: PASS -> FAIL [fdo#103167] +1
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move:
- shard-glk: PASS -> FAIL [fdo#103167] +4
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-render:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +9
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-f:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2
* igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
- shard-kbl: NOTRUN -> FAIL [fdo#108145] / [fdo#108590]
* igt@kms_psr@basic:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +3
* igt@kms_setmode@basic:
- shard-apl: PASS -> FAIL [fdo#99912]
* igt@kms_universal_plane@cursor-fb-leak-pipe-d:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +9
* igt@runner@aborted:
- shard-apl: NOTRUN -> ( 7 FAIL ) [fdo#109373]
* igt@testdisplay:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
#### Possible fixes ####
* igt@kms_busy@extended-modeset-hang-newfb-render-b:
- shard-hsw: DMESG-WARN [fdo#107956] -> PASS
- shard-kbl: DMESG-WARN [fdo#107956] -> PASS
- shard-snb: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_color@pipe-c-legacy-gamma:
- shard-apl: FAIL [fdo#104782] -> PASS
* igt@kms_cursor_crc@cursor-256x256-sliding:
- shard-kbl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_crc@cursor-64x21-onscreen:
- shard-apl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS
- shard-kbl: FAIL [fdo#103191] / [fdo#103232] -> PASS
* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: FAIL [fdo#105767] -> PASS
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-apl: DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +2
- shard-glk: FAIL [fdo#102887] / [fdo#105363] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
- shard-glk: FAIL [fdo#103167] -> PASS +1
* {igt@kms_plane@plane-position-covered-pipe-a-planes}:
- shard-glk: FAIL [fdo#110038] -> PASS
* {igt@kms_plane@plane-position-covered-pipe-b-planes}:
- shard-apl: FAIL [fdo#110038] -> PASS
* {igt@kms_plane_multiple@atomic-pipe-a-tiling-none}:
- shard-apl: FAIL [fdo#110037] -> PASS
* {igt@kms_plane_multiple@atomic-pipe-a-tiling-y}:
- shard-glk: FAIL [fdo#110037] -> PASS
* igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> PASS
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: FAIL [fdo#109016] -> PASS
* igt@kms_setmode@basic:
- shard-hsw: FAIL [fdo#99912] -> PASS
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS +1
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-apl: FAIL [fdo#104894] -> PASS +1
- shard-kbl: FAIL [fdo#104894] -> PASS
* igt@perf@rc6-disable:
- shard-kbl: FAIL [fdo#103179] -> PASS
#### Warnings ####
* igt@kms_cursor_crc@cursor-size-change:
- shard-apl: FAIL [fdo#103232] -> DMESG-WARN [fdo#103558] / [fdo#105602]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103179]: https://bugs.freedesktop.org/show_bug.cgi?id=103179
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108590]: https://bugs.freedesktop.org/show_bug.cgi?id=108590
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109373]: https://bugs.freedesktop.org/show_bug.cgi?id=109373
[fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#109674]: https://bugs.freedesktop.org/show_bug.cgi?id=109674
[fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037
[fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (10 -> 5)
------------------------------
Missing (5): shard-skl pig-hsw-4770r pig-glk-j5005 shard-iclb pig-skl-6260u
Build changes
-------------
* IGT: IGT_4883 -> IGTPW_2600
* Piglit: piglit_4509 -> None
CI_DRM_5737: d5bb7d77aa77996702426496078a597f30bead58 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2600: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2600/
IGT_4883: b25e06d6ddf2e42044cd9c93b613cbc7339a8c33 @ 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_2600/
_______________________________________________
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] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
2019-03-12 22:02 ` Chris Wilson
2019-03-12 22:13 ` Antonio Argenziano
@ 2019-03-13 22:18 ` Antonio Argenziano
2019-03-13 22:52 ` Chris Wilson
1 sibling, 1 reply; 15+ messages in thread
From: Antonio Argenziano @ 2019-03-13 22:18 UTC (permalink / raw)
To: Chris Wilson, igt-dev
On 12/03/19 15:02, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-03-12 21:57:36)
>> Add a couple of tests that supply invalid parameters to the mmap IOCTL.
>>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> ---
>> tests/i915/gem_mmap.c | 18 ++++++++++++++++++
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
>> index 0ed15878..2a676b9a 100644
>> --- a/tests/i915/gem_mmap.c
>> +++ b/tests/i915/gem_mmap.c
>> @@ -136,6 +136,24 @@ igt_main
>> igt_assert(ret == -1 && errno == ENOENT);
>> }
>>
>> + igt_subtest("bad-offset") {
>> + memset(&arg, 0, sizeof(arg));
>> + arg.handle = gem_create(fd, 4096);
>> + arg.offset = 4096 + 1;
>> + arg.size = 4096;
>> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> + igt_assert(ret == -1 && errno == EINVAL);
>
> Also arg.offset = -size is a good one.
>
> Then size=8192 and arg.offset=-4096;
>
>> + }
>> +
>> + igt_subtest("bad-size") {
>> + memset(&arg, 0, sizeof(arg));
>> + arg.handle = gem_create(fd, 4096);
>> + arg.offset = 4096;
>> + arg.size = 0;
>> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> + igt_assert(ret == -1 && errno == EINVAL);
>
> Also >4096, -4096
Hmmm, >4096 seems not to be returning an error. Where should it be
checked against the size of the object?
Antonio
> -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: [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
2019-03-13 22:18 ` Antonio Argenziano
@ 2019-03-13 22:52 ` Chris Wilson
0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2019-03-13 22:52 UTC (permalink / raw)
To: Antonio Argenziano, igt-dev
Quoting Antonio Argenziano (2019-03-13 22:18:15)
>
>
> On 12/03/19 15:02, Chris Wilson wrote:
> > Quoting Antonio Argenziano (2019-03-12 21:57:36)
> >> + igt_subtest("bad-size") {
> >> + memset(&arg, 0, sizeof(arg));
> >> + arg.handle = gem_create(fd, 4096);
> >> + arg.offset = 4096;
> >> + arg.size = 0;
> >> + ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
> >> + igt_assert(ret == -1 && errno == EINVAL);
> >
> > Also >4096, -4096
>
> Hmmm, >4096 seems not to be returning an error. Where should it be
> checked against the size of the object?
vm_mmap() should be reporting an error if args->offset + arg->size
overflow. Or at least that is what we assumed.
-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:[~2019-03-13 22:53 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
2019-03-12 22:04 ` Chris Wilson
2019-03-12 22:11 ` Antonio Argenziano
2019-03-12 22:18 ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
2019-03-12 22:02 ` Chris Wilson
2019-03-12 22:13 ` Antonio Argenziano
2019-03-13 22:18 ` Antonio Argenziano
2019-03-13 22:52 ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
2019-03-12 22:07 ` Chris Wilson
2019-03-13 13:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage Patchwork
2019-03-13 16:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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.