All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests
@ 2022-09-01 11:44 Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
                   ` (13 more replies)
  0 siblings, 14 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

Fix + increase tests coverage.

Chris Wilson (12):
  lib: Fix off-by-one-page in 48b obj.flags
  lib/i915: Mark gem_create as handling const memory regions
  lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  i915/gem_create: Verify all regions return cleared objects
  i915/gem_create: Stress creation with busy engines
  i915/gem_mmap_offset: Verify all regions return clear mmaps on cration
  i915/gem_mmap_offset: Verify all regions with ptrace
  i915/gem_mmap_offset: Verify all regions remain in isolation
  i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults
  i915/gem_mmap_offset: Check all mmap types reject invalid objects
  i915/gem_mmap_offset: Exercise close race against all types/regions
  i915/gem_mmap_offset: Crudely measure read/write to different mmaps

 lib/i915/gem_mman.c            |   2 +-
 lib/i915/intel_memory_region.c |   4 +-
 lib/i915/intel_memory_region.h |   4 +-
 lib/igt_dummyload.c            |  63 +++--
 tests/i915/gem_create.c        | 144 ++++++++---
 tests/i915/gem_mmap_offset.c   | 454 ++++++++++++++++++++++-----------
 6 files changed, 452 insertions(+), 219 deletions(-)

-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  7:20   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions Zbigniew Kempczyński
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@linux.intel.com>

The kernel checks that the last byte of the object will fit inside the
32b GTT window unless the object is marked as being suitable for use
with 48b addressing. However, the spinner only checked the start of the
object which depending on the mix of size/alignment, could allow the
object to straddle the 32b boundary and not be marked as 48b capable.

Always set 48b for all the objects where ppGTT merites.

In the process, there was one location where we failed to write the
upper 32b of the address into the instruction.

Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
---
 lib/igt_dummyload.c | 63 ++++++++++++++++++++++-----------------------
 1 file changed, 31 insertions(+), 32 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index dc1bd51e08..17ae21f567 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -100,12 +100,21 @@ emit_recursive_batch(igt_spin_t *spin,
 	struct drm_i915_gem_execbuffer2 *execbuf;
 	struct drm_i915_gem_exec_object2 *obj;
 	unsigned int flags[GEM_MAX_ENGINES];
+	unsigned int objflags = 0;
 	unsigned int nengine;
 	int fence_fd = -1;
-	uint64_t addr, addr_scratch, ahnd = opts->ahnd, objflags = 0;
+	uint64_t addr, addr_scratch, ahnd = opts->ahnd;
 	uint32_t *cs;
 	int i;
 
+	igt_assert(!(opts->ctx && opts->ctx_id));
+
+	r = memset(relocs, 0, sizeof(relocs));
+	execbuf = memset(&spin->execbuf, 0, sizeof(spin->execbuf));
+	execbuf->rsvd1 = opts->ctx ? opts->ctx->id : opts->ctx_id;
+	execbuf->flags = I915_EXEC_NO_RELOC;
+	obj = memset(spin->obj, 0, sizeof(spin->obj));
+
 	/*
 	 * Pick a random location for our spinner et al.
 	 *
@@ -121,8 +130,12 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * that wrap.
 	 */
 
+	addr = gem_aperture_size(fd) / 2;
+	if (addr >> 32)
+		objflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+
 	if (!ahnd) {
-		addr = gem_aperture_size(fd) / 2;
+		addr /= 2;
 		if (addr >> 31)
 			addr = 1u << 31;
 		addr += random() % addr / 2;
@@ -131,8 +144,6 @@ emit_recursive_batch(igt_spin_t *spin,
 		objflags |= EXEC_OBJECT_PINNED;
 	}
 
-	igt_assert(!(opts->ctx && opts->ctx_id));
-
 	nengine = 0;
 	if (opts->engine == ALL_ENGINES) {
 		struct intel_execution_engine2 *engine;
@@ -150,11 +161,6 @@ emit_recursive_batch(igt_spin_t *spin,
 	}
 	igt_require(nengine);
 
-	memset(relocs, 0, sizeof(relocs));
-	execbuf = memset(&spin->execbuf, 0, sizeof(spin->execbuf));
-	execbuf->flags = I915_EXEC_NO_RELOC;
-	obj = memset(spin->obj, 0, sizeof(spin->obj));
-
 	obj[BATCH].handle =
 		handle_create(fd, BATCH_SIZE, opts->flags, &spin->batch);
 	if (!spin->batch) {
@@ -175,9 +181,7 @@ emit_recursive_batch(igt_spin_t *spin,
 							   BATCH_SIZE, 0,
 							   ALLOC_STRATEGY_LOW_TO_HIGH);
 	obj[BATCH].offset = CANONICAL(addr);
-	obj[BATCH].flags |= objflags;
-	if (obj[BATCH].offset >= (1ull << 32))
-		obj[BATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+	obj[BATCH].flags = objflags;
 
 	addr += BATCH_SIZE;
 
@@ -192,27 +196,23 @@ emit_recursive_batch(igt_spin_t *spin,
 
 		obj[SCRATCH].handle = opts->dependency;
 		obj[SCRATCH].offset = CANONICAL(addr_scratch);
-		obj[SCRATCH].flags |= objflags;
-		if (obj[SCRATCH].offset >= (1ull << 32))
-			obj[SCRATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+		obj[SCRATCH].flags = objflags;
 
 		if (!(opts->flags & IGT_SPIN_SOFTDEP)) {
 			obj[SCRATCH].flags |= EXEC_OBJECT_WRITE;
 
 			/* dummy write to dependency */
-			r = &relocs[obj[BATCH].relocation_count++];
 			r->presumed_offset = obj[SCRATCH].offset;
 			r->target_handle = obj[SCRATCH].handle;
 			r->offset = sizeof(uint32_t) * 1020;
 			r->delta = 0;
 			r->read_domains = I915_GEM_DOMAIN_RENDER;
 			r->write_domain = I915_GEM_DOMAIN_RENDER;
+			r++;
 		}
 
 		execbuf->buffer_count++;
 	} else if (opts->flags & IGT_SPIN_POLL_RUN) {
-		r = &relocs[obj[BATCH].relocation_count++];
-
 		igt_assert(!opts->dependency);
 
 		if (gen == 4 || gen == 5) {
@@ -244,6 +244,7 @@ emit_recursive_batch(igt_spin_t *spin,
 								   ALLOC_STRATEGY_LOW_TO_HIGH);
 		addr += 4096; /* guard page */
 		obj[SCRATCH].offset = CANONICAL(addr);
+		obj[SCRATCH].flags = objflags;
 		addr += 4096;
 
 		igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);
@@ -253,10 +254,6 @@ emit_recursive_batch(igt_spin_t *spin,
 		r->offset = sizeof(uint32_t) * 1;
 		r->delta = sizeof(uint32_t) * SPIN_POLL_START_IDX;
 
-		obj[SCRATCH].flags |= objflags;
-		if (obj[SCRATCH].offset >= (1ull << 32))
-			obj[SCRATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
-
 		*cs++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
 
 		if (gen >= 8) {
@@ -274,6 +271,7 @@ emit_recursive_batch(igt_spin_t *spin,
 		*cs++ = 1;
 
 		execbuf->buffer_count++;
+		r++;
 	}
 
 	spin->handle = obj[BATCH].handle;
@@ -314,8 +312,6 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * no matter how they modify it (from either the GPU or CPU).
 	 */
 	if (gen >= 8) { /* arbitrary cutoff between ring/execlists submission */
-		r = &relocs[obj[BATCH].relocation_count++];
-
 		/*
 		 * On Sandybridge+ the comparison is a strict greater-than:
 		 * if the value at spin->condition is greater than BB_END,
@@ -334,15 +330,17 @@ emit_recursive_batch(igt_spin_t *spin,
 		r->offset = (cs + 2 - spin->batch) * sizeof(*cs);
 		r->read_domains = I915_GEM_DOMAIN_COMMAND;
 		r->delta = (spin->condition - spin->batch) * sizeof(*cs);
+		igt_assert(r->delta < 4096);
 
 		*cs++ = MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 2;
 		*cs++ = MI_BATCH_BUFFER_END;
 		*cs++ = r->presumed_offset + r->delta;
-		*cs++ = 0;
+		*cs++ = r->presumed_offset >> 32;
+
+		r++;
 	}
 
 	/* recurse */
-	r = &relocs[obj[BATCH].relocation_count++];
 	r->target_handle = obj[BATCH].handle;
 	r->presumed_offset = obj[BATCH].offset;
 	r->offset = (cs + 1 - spin->batch) * sizeof(*cs);
@@ -363,11 +361,10 @@ emit_recursive_batch(igt_spin_t *spin,
 		*cs = r->presumed_offset + r->delta;
 		cs++;
 	}
-	obj[BATCH].relocs_ptr = to_user_pointer(relocs);
+	r++;
 
 	execbuf->buffers_ptr =
 	       	to_user_pointer(obj + (2 - execbuf->buffer_count));
-	execbuf->rsvd1 = opts->ctx ? opts->ctx->id : opts->ctx_id;
 
 	if (opts->flags & IGT_SPIN_FENCE_OUT)
 		execbuf->flags |= I915_EXEC_FENCE_OUT;
@@ -382,14 +379,16 @@ emit_recursive_batch(igt_spin_t *spin,
 		execbuf->rsvd2 = opts->fence;
 	}
 
+	/* For allocator we have to rid of relocation_count */
+	if (!ahnd) {
+		obj[BATCH].relocs_ptr = to_user_pointer(relocs);
+		obj[BATCH].relocation_count = r - relocs;
+	}
+
 	for (i = 0; i < nengine; i++) {
 		execbuf->flags &= ~ENGINE_MASK;
 		execbuf->flags |= flags[i];
 
-		/* For allocator we have to rid of relocation_count */
-		for (int j = 0; j < ARRAY_SIZE(spin->obj) && ahnd; j++)
-			spin->obj[j].relocation_count = 0;
-
 		gem_execbuf_wr(fd, execbuf);
 
 		if (opts->flags & IGT_SPIN_FENCE_OUT) {
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-01 17:53   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain Zbigniew Kempczyński
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@linux.intel.com>

Make the memory regions passed to gem_crate_in_memory_region_list() as
being const.

Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
---
 lib/i915/intel_memory_region.c | 4 ++--
 lib/i915/intel_memory_region.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 93a18982c1..568bace949 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -198,7 +198,7 @@ bool gem_has_lmem(int fd)
 /* A version of gem_create_in_memory_region_list which can be allowed to
    fail so that the object creation can be retried */
 int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size, uint32_t flags,
-				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       const struct drm_i915_gem_memory_class_instance *mem_regions,
 				       int num_regions)
 {
 	struct drm_i915_gem_create_ext_memory_regions ext_regions = {
@@ -234,7 +234,7 @@ int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size,
  * @num_regions: @mem_regions length
  */
 uint32_t gem_create_in_memory_region_list(int fd, uint64_t size, uint32_t flags,
-					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  const struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions)
 {
 	uint32_t handle;
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
index e1bfe0ca65..fd04df83b5 100644
--- a/lib/i915/intel_memory_region.h
+++ b/lib/i915/intel_memory_region.h
@@ -65,11 +65,11 @@ unsigned int gem_get_lmem_region_count(int fd);
 bool gem_has_lmem(int fd);
 
 int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size, uint32_t flags,
-				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       const struct drm_i915_gem_memory_class_instance *mem_regions,
 				       int num_regions);
 
 uint32_t gem_create_in_memory_region_list(int fd, uint64_t size, uint32_t flags,
-					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  const struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions);
 
 /*
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-01 17:58   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects Zbigniew Kempczyński
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@linux.intel.com>

Don't treat OFFSET_FIXED as using DOMAIN_CPU [0], but give it an invalid
domain so we can avoid using in tests.

Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
---
 lib/i915/gem_mman.c          |  2 +-
 tests/i915/gem_mmap_offset.c | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index aa9ac6f3d7..48e3f8c991 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -678,7 +678,7 @@ const struct mmap_offset mmap_offset_types[] = {
 	{ "wb", I915_MMAP_OFFSET_WB, I915_GEM_DOMAIN_CPU },
 	{ "wc", I915_MMAP_OFFSET_WC, I915_GEM_DOMAIN_WC },
 	{ "uc", I915_MMAP_OFFSET_UC, I915_GEM_DOMAIN_WC },
-	{ "fixed", I915_MMAP_OFFSET_FIXED, 0},
+	{ "fixed", I915_MMAP_OFFSET_FIXED, -1 },
 	{},
 };
 
diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 5e6b19eb34..d1075c32eb 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -148,7 +148,8 @@ static void basic_uaf(int i915)
 		}
 
 		expected = calloc(obj_size, sizeof(*expected));
-		gem_set_domain(i915, handle, t->domain, 0);
+		if (t->domain != -1)
+			gem_set_domain(i915, handle, t->domain, 0);
 		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
 			     "mmap(%s) not clear on gem_create()\n",
 			     t->name);
@@ -157,15 +158,18 @@ static void basic_uaf(int i915)
 		buf = calloc(obj_size, sizeof(*buf));
 		memset(buf + 1024, 0x01, 1024);
 		gem_write(i915, handle, 0, buf, obj_size);
-		gem_set_domain(i915, handle, t->domain, 0);
+		if (t->domain != -1)
+			gem_set_domain(i915, handle, t->domain, 0);
 		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
 			     "mmap(%s) not coherent with gem_write()\n",
 			     t->name);
 
-		gem_set_domain(i915, handle, t->domain, t->domain);
+		if (t->domain != -1)
+			gem_set_domain(i915, handle, t->domain, t->domain);
 		memset(addr + 2048, 0xff, 1024);
 		gem_read(i915, handle, 0, buf, obj_size);
-		gem_set_domain(i915, handle, t->domain, 0);
+		if (t->domain != -1)
+			gem_set_domain(i915, handle, t->domain, 0);
 		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
 			     "mmap(%s) not coherent with gem_read()\n",
 			     t->name);
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (2 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-01 18:36   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines Zbigniew Kempczyński
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

We do not tolerate leaking stale information in newly created objects, so
make sure the test covers all memory regions.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_create.c | 100 +++++++++++++++++++++++++++++++---------
 1 file changed, 77 insertions(+), 23 deletions(-)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index d7d2a01722..06a9498e0d 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -59,6 +59,7 @@
 #include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
+#include "i915/intel_memory_region.h"
 #include "i915_drm.h"
 
 IGT_TEST_DESCRIPTION("Ensure that basic gem_create and gem_create_ext works"
@@ -145,45 +146,88 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
 
 struct thread_clear {
 	_Atomic(uint64_t) max;
+	struct drm_i915_gem_memory_class_instance region;
 	int timeout;
 	int i915;
 };
 
+static uint32_t batch_create(int i915)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	uint32_t handle = gem_create(i915, sizeof(bbe));
+
+	gem_write(i915, handle, 0, &bbe, sizeof(bbe));
+	return handle;
+}
+
+static void make_resident(int i915, uint32_t batch, uint32_t handle)
+{
+	struct drm_i915_gem_exec_object2 obj[2] = {
+		[0] = {
+			.handle = handle,
+			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
+
+		},
+		[1] = {
+			.handle = batch ?: batch_create(i915),
+			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
+		},
+	};
+	struct drm_i915_gem_execbuffer2 eb = {
+		.buffers_ptr = to_user_pointer(obj),
+		.buffer_count = ARRAY_SIZE(obj),
+	};
+	int err;
+
+	err = __gem_execbuf(i915, &eb);
+	if (obj[1].handle != batch)
+		gem_close(i915, obj[1].handle);
+
+	igt_assert(err == 0 || err == -E2BIG || err == -ENOSPC);
+}
+
 static void *thread_clear(void *data)
 {
 	struct thread_clear *arg = data;
 	unsigned long checked = 0, total = 0;
-	enum { PRW, GTT, WC, WB, __LAST__ } mode = PRW;
+	enum { PRW, GTT, WC, WB, __LAST__, FIXED } mode = PRW;
 	int i915 = arg->i915;
+	uint32_t batch = batch_create(i915);
+
+	if (__gem_write(i915, 0, 0, 0, 0) == -EOPNOTSUPP)
+		mode = FIXED;
 
 	igt_until_timeout(arg->timeout) {
-		struct drm_i915_gem_create create = {};
-		uint64_t npages;
+		uint64_t npages, size;
+		uint32_t handle;
 		void *ptr;
 
 		npages = random();
 		npages <<= 32;
 		npages |= random();
 		npages = get_npages(&arg->max, npages);
-		create.size = npages << 12;
+		size = npages << 12;
+
+		igt_assert_eq(__gem_create_in_memory_region_list(i915, &handle, &size, 0, &arg->region, 1), 0);
+		if (random() & 1)
+			make_resident(i915, batch, handle);
 
-		create_ioctl(i915, &create);
 		switch (mode) {
+		case FIXED:
+			ptr = __gem_mmap_offset__fixed(i915, handle, 0, size, PROT_READ);
+			break;
 		case __LAST__:
 		case PRW:
 			ptr = NULL;
 			break;
 		case WB:
-			ptr = __gem_mmap__cpu(i915, create.handle,
-					      0, create.size, PROT_READ);
+			ptr = __gem_mmap__cpu(i915, handle, 0, size, PROT_READ);
 			break;
 		case WC:
-			ptr = __gem_mmap__wc(i915, create.handle,
-					     0, create.size, PROT_READ);
+			ptr = __gem_mmap__wc(i915, handle, 0, size, PROT_READ);
 			break;
 		case GTT:
-			ptr = __gem_mmap__gtt(i915, create.handle,
-					      create.size, PROT_READ);
+			ptr = __gem_mmap__gtt(i915, handle, size, PROT_READ);
 			break;
 		}
 		/* No set-domains as we are being as naughty as possible */
@@ -195,7 +239,7 @@ static void *thread_clear(void *data)
 			};
 
 			if (!ptr)
-				gem_read(i915, create.handle, x[0], x, sizeof(x));
+				gem_read(i915, handle, x[0], x, sizeof(x));
 			else if (page & 1)
 				igt_memcpy_from_wc(x, ptr + x[0], sizeof(x));
 			else
@@ -207,26 +251,28 @@ static void *thread_clear(void *data)
 			checked++;
 		}
 		if (ptr)
-			munmap(ptr, create.size);
-		gem_close(i915, create.handle);
+			munmap(ptr, size);
+		gem_close(i915, handle);
 
 		total += npages;
 		atomic_fetch_add(&arg->max, npages);
 
-		if (++mode == __LAST__)
+		if (mode < __LAST__ && ++mode == __LAST__)
 			mode = PRW;
 	}
+	gem_close(i915, batch);
 
 	igt_info("Checked %'lu / %'lu pages\n", checked, total);
 	return (void *)(uintptr_t)checked;
 }
 
-static void always_clear(int i915, int timeout)
+static void always_clear(int i915, const struct gem_memory_region *r, int timeout)
 {
 	struct thread_clear arg = {
 		.i915 = i915,
+		.region = r->ci,
+		.max = r->size / 2 >> 12, /* in pages */
 		.timeout = timeout,
-		.max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
 	};
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
 	unsigned long checked;
@@ -244,7 +290,7 @@ static void always_clear(int i915, int timeout)
 	igt_info("Checked %'lu page allocations\n", checked);
 }
 
-static void busy_create(int i915, int timeout)
+static void busy_create(int i915, const struct gem_memory_region *r, int timeout)
 {
 	struct intel_execution_engine2 *e;
 	const intel_ctx_t *ctx;
@@ -267,7 +313,7 @@ static void busy_create(int i915, int timeout)
 			uint32_t handle;
 			igt_spin_t *next;
 
-			handle = gem_create(i915, 4096);
+			handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
 			next = igt_spin_new(i915,
 					    .ahnd = ahnd,
 					    .ctx = ctx,
@@ -808,12 +854,20 @@ igt_main
 		size_update(fd);
 
 	igt_describe("Verify that all new objects are clear.");
-	igt_subtest("create-clear")
-		always_clear(fd, 30);
+	igt_subtest_with_dynamic("create-clear") {
+		for_each_memory_region(r, fd) {
+			igt_dynamic_f("%s", r->name)
+				always_clear(fd, r, 30);
+		}
+	}
 
 	igt_describe("Create buffer objects while GPU is busy.");
-	igt_subtest("busy-create")
-		busy_create(fd, 30);
+	igt_subtest_with_dynamic("busy-create") {
+		for_each_memory_region(r, fd) {
+			igt_dynamic_f("%s", r->name)
+				busy_create(fd, r, 30);
+		}
+	}
 
 	igt_describe("Exercise create_ext placements extension.");
 	igt_subtest("create-ext-placement-sanity-check")
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (3 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  3:36   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration Zbigniew Kempczyński
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

Use shortlived non-preemptible batches to demonstrate an issue with
waiting on user controlled resources.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_create.c | 54 +++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 18 deletions(-)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 06a9498e0d..c4c40e85c0 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -290,7 +290,8 @@ static void always_clear(int i915, const struct gem_memory_region *r, int timeou
 	igt_info("Checked %'lu page allocations\n", checked);
 }
 
-static void busy_create(int i915, const struct gem_memory_region *r, int timeout)
+static void busy_create(int i915, const struct gem_memory_region *r, int timeout, unsigned int flags)
+#define BUSY_HOG 0x1
 {
 	struct intel_execution_engine2 *e;
 	const intel_ctx_t *ctx;
@@ -301,12 +302,14 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
 	ctx = intel_ctx_create_all_physical(i915);
 	ahnd = get_reloc_ahnd(i915, ctx->id);
 
-	igt_fork_hang_detector(i915);
-	for_each_ctx_engine(i915, ctx, e)
-		spin[e->flags] = igt_spin_new(i915,
-					      .ahnd = ahnd,
-					      .ctx = ctx,
-					      .engine = e->flags);
+	for_each_ctx_engine(i915, ctx, e) {
+		spin[e->flags] =
+			igt_spin_new(i915,
+				     .ahnd = ahnd,
+				     .ctx = ctx,
+				     .engine = e->flags,
+				     .flags = flags & BUSY_HOG ? IGT_SPIN_NO_PREEMPTION : 0);
+	}
 
 	igt_until_timeout(timeout) {
 		for_each_ctx_engine(i915, ctx, e) {
@@ -314,12 +317,13 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
 			igt_spin_t *next;
 
 			handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
-			next = igt_spin_new(i915,
-					    .ahnd = ahnd,
-					    .ctx = ctx,
-					    .engine = e->flags,
-					    .dependency = handle,
-					    .flags = IGT_SPIN_SOFTDEP);
+			next = __igt_spin_new(i915,
+					      .ahnd = ahnd,
+					      .ctx = ctx,
+					      .engine = e->flags,
+					      .dependency = handle,
+					      .flags = ((flags & BUSY_HOG ? IGT_SPIN_NO_PREEMPTION : 0) |
+							IGT_SPIN_SOFTDEP));
 			gem_close(i915, handle);
 
 			igt_spin_free(i915, spin[e->flags]);
@@ -335,7 +339,6 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
 	igt_info("Created %ld objects while busy\n", count);
 
 	gem_quiescent_gpu(i915);
-	igt_stop_hang_detector();
 }
 
 static void size_update(int fd)
@@ -862,11 +865,26 @@ igt_main
 	}
 
 	igt_describe("Create buffer objects while GPU is busy.");
-	igt_subtest_with_dynamic("busy-create") {
-		for_each_memory_region(r, fd) {
-			igt_dynamic_f("%s", r->name)
-				busy_create(fd, r, 30);
+	igt_subtest_group {
+		igt_fixture
+			igt_fork_hang_detector(fd);
+
+		igt_subtest_with_dynamic("busy-create") {
+			for_each_memory_region(r, fd) {
+				igt_dynamic_f("%s", r->name)
+					busy_create(fd, r, 30, 0);
+			}
 		}
+
+		igt_subtest_with_dynamic("hog-create") {
+			for_each_memory_region(r, fd) {
+				igt_dynamic_f("%s", r->name)
+					busy_create(fd, r, 30, BUSY_HOG);
+			}
+		}
+
+		igt_fixture
+			igt_stop_hang_detector();
 	}
 
 	igt_describe("Exercise create_ext placements extension.");
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (4 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  3:42   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace Zbigniew Kempczyński
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

We do not tolerate leaking stale information in newly created objects, so
make sure the test covers all memory regions.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_mmap_offset.c | 87 +++++++++++++++++++++++++-----------
 1 file changed, 60 insertions(+), 27 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index d1075c32eb..faadbd4ee6 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -35,6 +35,7 @@
 
 #include "i915/gem.h"
 #include "i915/gem_create.h"
+#include "i915/intel_memory_region.h"
 #include "igt.h"
 #include "igt_x86.h"
 
@@ -75,6 +76,37 @@ __mmap_offset(int i915, uint32_t handle, uint64_t offset, uint64_t size,
 	return ptr;
 }
 
+static uint32_t batch_create(int i915)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	uint32_t handle = gem_create(i915, sizeof(bbe));
+
+	gem_write(i915, handle, 0, &bbe, sizeof(bbe));
+	return handle;
+}
+
+static void make_resident(int i915, uint32_t batch, uint32_t handle)
+{
+	struct drm_i915_gem_exec_object2 obj[2] = {
+		[0] = {
+			.handle = handle,
+			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
+		},
+		[1] = {
+			.handle = batch ?: batch_create(i915),
+			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
+		},
+	};
+	struct drm_i915_gem_execbuffer2 eb = {
+		.buffers_ptr = to_user_pointer(obj),
+		.buffer_count = ARRAY_SIZE(obj),
+	};
+
+	gem_execbuf(i915, &eb);
+	if (obj[1].handle != batch)
+		gem_close(i915, obj[1].handle);
+}
+
 static void bad_object(int i915)
 {
 	uint32_t real_handle;
@@ -529,44 +561,35 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
 
 struct thread_clear {
 	_Atomic(uint64_t) max;
+	struct drm_i915_gem_memory_class_instance region;
 	int timeout;
 	int i915;
 };
 
-static int create_ioctl(int i915, struct drm_i915_gem_create *create)
-{
-	int err = 0;
-
-	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CREATE, create)) {
-		err = -errno;
-		igt_assume(err != 0);
-	}
-
-	errno = 0;
-	return err;
-}
-
 static void *thread_clear(void *data)
 {
 	struct thread_clear *arg = data;
 	const struct mmap_offset *t;
-	unsigned long checked = 0;
+	unsigned long checked = 0, total = 0;
 	int i915 = arg->i915;
+	uint32_t batch = batch_create(i915);
 
 	t = mmap_offset_types;
 	igt_until_timeout(arg->timeout) {
-		struct drm_i915_gem_create create = {};
-		uint64_t npages;
+		uint64_t npages, size;
+		uint32_t handle;
 		void *ptr;
 
 		npages = random();
 		npages <<= 32;
 		npages |= random();
 		npages = get_npages(&arg->max, npages);
-		create.size = npages << 12;
+		size = npages << 12;
 
-		create_ioctl(i915, &create);
-		ptr = __mmap_offset(i915, create.handle, 0, create.size,
+		igt_assert_eq(__gem_create_in_memory_region_list(i915, &handle, &size, 0, &arg->region, 1), 0);
+		make_resident(i915, batch, handle);
+
+		ptr = __mmap_offset(i915, handle, 0, size,
 				    PROT_READ | PROT_WRITE,
 				    t->type);
 		/* No set-domains as we are being as naughty as possible */
@@ -584,26 +607,32 @@ static void *thread_clear(void *data)
 			for (int i = 0; i < ARRAY_SIZE(x); i++)
 				igt_assert_eq_u64(x[i], 0);
 		}
-		if (ptr)
-			munmap(ptr, create.size);
-		gem_close(i915, create.handle);
-		checked += npages;
+		if (ptr) {
+			munmap(ptr, size);
+			checked += npages;
+		}
+		gem_close(i915, handle);
 
+		total += npages;
 		atomic_fetch_add(&arg->max, npages);
 
 		if (!(++t)->name)
 			t = mmap_offset_types;
 	}
 
+	gem_close(i915, batch);
+
+	igt_info("Checked %'lu / %'lu pages\n", checked, total);
 	return (void *)(uintptr_t)checked;
 }
 
-static void always_clear(int i915, int timeout)
+static void always_clear(int i915, const struct gem_memory_region *r, int timeout)
 {
 	struct thread_clear arg = {
 		.i915 = i915,
+		.region = r->ci,
+		.max = r->size / 2 >> 12, /* in pages */
 		.timeout = timeout,
-		.max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
 	};
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
 	unsigned long checked;
@@ -750,8 +779,12 @@ igt_main
 	igt_subtest_f("open-flood")
 		open_flood(i915, 20);
 
-	igt_subtest_f("clear")
-		always_clear(i915, 20);
+	igt_subtest_with_dynamic("clear") {
+		for_each_memory_region(r, i915) {
+			igt_dynamic_f("%s", r->name)
+				always_clear(i915, r, 20);
+		}
+	}
 
 	igt_subtest_f("blt-coherency")
 		blt_coherency(i915);
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (5 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  3:46   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation Zbigniew Kempczyński
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

Check we can use ptrace to query *ptr of each mmap for each region.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_mmap_offset.c | 84 ++++++++++++++++++++----------------
 1 file changed, 46 insertions(+), 38 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index faadbd4ee6..806a9d68f4 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -370,64 +370,72 @@ static void test_ptrace(int i915)
 	const unsigned int SZ = 3 * 4096;
 	unsigned long *ptr, *cpy;
 	unsigned long AA, CC;
-	uint32_t bo;
 
 	memset(&AA, 0xaa, sizeof(AA));
 	memset(&CC, 0x55, sizeof(CC));
 
 	cpy = malloc(SZ);
-	bo = gem_create(i915, SZ);
+	igt_assert(cpy);
 
-	for_each_mmap_offset_type(i915, t) {
-		ptr = __mmap_offset(i915, bo, 0, SZ,
-				    PROT_READ | PROT_WRITE,
-				    t->type);
-		if (!ptr)
-			continue;
+	for_each_memory_region(r, i915) {
+		uint64_t size = SZ;
+		uint32_t bo;
 
-		igt_dynamic_f("%s", t->name) {
-			pid_t pid;
+		igt_assert_eq(__gem_create_in_memory_region_list(i915, &bo, &size, 0, &r->ci, 1), 0);
+		make_resident(i915, 0, bo);
 
-			memset(cpy, AA, SZ);
-			memset(ptr, CC, SZ);
+		for_each_mmap_offset_type(i915, t) {
+			ptr = __mmap_offset(i915, bo, 0, size,
+					    PROT_READ | PROT_WRITE,
+					    t->type);
+			if (!ptr)
+				continue;
 
-			igt_assert(!memchr_inv(ptr, CC, SZ));
-			igt_assert(!memchr_inv(cpy, AA, SZ));
+			igt_dynamic_f("%s-%s", r->name, t->name) {
+				pid_t pid;
 
-			igt_fork(child, 1) {
-				ptrace(PTRACE_TRACEME, 0, NULL, NULL);
-				raise(SIGSTOP);
-			}
+				memset(cpy, AA, SZ);
+				memset(ptr, CC, SZ);
 
-			/* Wait for the child to ready themselves [SIGSTOP] */
-			pid = wait(NULL);
+				igt_assert(!memchr_inv(ptr, CC, SZ));
+				igt_assert(!memchr_inv(cpy, AA, SZ));
 
-			ptrace(PTRACE_ATTACH, pid, NULL, NULL);
-			for (int i = 0; i < SZ / sizeof(long); i++) {
-				long ret;
+				igt_fork(child, 1) {
+					ptrace(PTRACE_TRACEME, 0, NULL, NULL);
+					raise(SIGSTOP);
+				}
 
-				ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
-				igt_assert_eq_u64(ret, CC);
-				cpy[i] = ret;
+				/* Wait for the child to ready themselves [SIGSTOP] */
+				pid = wait(NULL);
 
-				ret = ptrace(PTRACE_POKEDATA, pid, ptr + i, AA);
-				igt_assert_eq(ret, 0l);
-			}
-			ptrace(PTRACE_DETACH, pid, NULL, NULL);
+				ptrace(PTRACE_ATTACH, pid, NULL, NULL);
+				for (int i = 0; i < SZ / sizeof(long); i++) {
+					long ret;
+
+					ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
+					igt_assert_eq_u64(ret, CC);
+					cpy[i] = ret;
+
+					ret = ptrace(PTRACE_POKEDATA, pid, ptr + i, AA);
+					igt_assert_eq(ret, 0l);
+				}
+				ptrace(PTRACE_DETACH, pid, NULL, NULL);
 
-			/* Wakeup the child for it to exit */
-			kill(SIGCONT, pid);
-			igt_waitchildren();
+				/* Wakeup the child for it to exit */
+				kill(SIGCONT, pid);
+				igt_waitchildren();
 
-			/* The two buffers should now be swapped */
-			igt_assert(!memchr_inv(ptr, AA, SZ));
-			igt_assert(!memchr_inv(cpy, CC, SZ));
+				/* The two buffers should now be swapped */
+				igt_assert(!memchr_inv(ptr, AA, SZ));
+				igt_assert(!memchr_inv(cpy, CC, SZ));
+			}
+
+			munmap(ptr, size);
 		}
 
-		munmap(ptr, SZ);
+		gem_close(i915, bo);
 	}
 
-	gem_close(i915, bo);
 	free(cpy);
 }
 
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (6 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  6:25   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 09/12] i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults Zbigniew Kempczyński
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

Check that we don't leak mmap pointers to different regions.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_mmap_offset.c | 99 +++++++++++++++++++-----------------
 1 file changed, 51 insertions(+), 48 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 806a9d68f4..c392dc2092 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -219,68 +219,71 @@ static void basic_uaf(int i915)
 
 static void isolation(int i915)
 {
-	for_each_mmap_offset_type(i915, t) {
-		struct drm_i915_gem_mmap_offset mmap_arg = {
-			.flags = t->type
-		};
-		int A = gem_reopen_driver(i915);
-		int B = gem_reopen_driver(i915);
-		uint64_t offset_a, offset_b;
-		uint32_t a, b;
-		void *ptr;
-
-		a = gem_create(A, 4096);
-		b = gem_open(B, gem_flink(A, a));
-
-		mmap_arg.handle = a;
-		if (mmap_offset_ioctl(A, &mmap_arg)) {
-			close(A);
-			close(B);
-			continue;
-		}
-		offset_a = mmap_arg.offset;
-
-		mmap_arg.handle = b;
-		igt_assert_eq(mmap_offset_ioctl(B, &mmap_arg), 0);
-		offset_b = mmap_arg.offset;
-
-		igt_info("A[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
-			 t->name, A, a, offset_a);
-		igt_info("B[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
-			 t->name, B, b, offset_b);
+	for_each_memory_region(r, i915) {
+		igt_info("%s\n", r->name);
+		for_each_mmap_offset_type(i915, t) {
+			struct drm_i915_gem_mmap_offset mmap_arg = {
+				.flags = t->type
+			};
+			int A = gem_reopen_driver(i915);
+			int B = gem_reopen_driver(i915);
+			uint64_t offset_a, offset_b;
+			uint32_t a, b;
+			void *ptr;
+
+			a = gem_create_in_memory_region_list(A, 4096, 0, &r->ci, 1);
+			b = gem_open(B, gem_flink(A, a));
+
+			mmap_arg.handle = a;
+			if (mmap_offset_ioctl(A, &mmap_arg)) {
+				close(A);
+				close(B);
+				continue;
+			}
+			offset_a = mmap_arg.offset;
 
-		errno = 0;
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_a);
-		igt_assert(ptr == MAP_FAILED);
-		igt_assert_eq(errno, EACCES);
+			mmap_arg.handle = b;
+			igt_assert_eq(mmap_offset_ioctl(B, &mmap_arg), 0);
+			offset_b = mmap_arg.offset;
 
-		errno = 0;
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_b);
-		igt_assert(ptr == MAP_FAILED);
-		igt_assert_eq(errno, EACCES);
+			igt_info("\tA[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
+				 t->name, A, a, offset_a);
+			igt_info("\tB[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
+				 t->name, B, b, offset_b);
 
-		if (offset_a != offset_b) {
 			errno = 0;
-			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
+			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_a);
 			igt_assert(ptr == MAP_FAILED);
 			igt_assert_eq(errno, EACCES);
 
 			errno = 0;
-			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
+			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_b);
 			igt_assert(ptr == MAP_FAILED);
 			igt_assert_eq(errno, EACCES);
-		}
 
-		close(B);
+			if (offset_a != offset_b) {
+				errno = 0;
+				ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
+				igt_assert(ptr == MAP_FAILED);
+				igt_assert_eq(errno, EACCES);
 
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
-		igt_assert(ptr != MAP_FAILED);
-		munmap(ptr, 4096);
+				errno = 0;
+				ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
+				igt_assert(ptr == MAP_FAILED);
+				igt_assert_eq(errno, EACCES);
+			}
 
-		close(A);
+			close(B);
+
+			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
+			igt_assert(ptr != MAP_FAILED);
+			munmap(ptr, 4096);
+
+			close(A);
 
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
-		igt_assert(ptr == MAP_FAILED);
+			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
+			igt_assert(ptr == MAP_FAILED);
+		}
 	}
 }
 
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 09/12] i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (7 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects Zbigniew Kempczyński
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

Check that if we fault in a page that is active on the gpu, it doesn't
wait for completion.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_mmap_offset.c | 38 +++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index c392dc2092..40daa53061 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -287,7 +287,7 @@ static void isolation(int i915)
 	}
 }
 
-static void pf_nonblock(int i915)
+static void pf_nonblock_batch(int i915)
 {
 	uint64_t ahnd = get_reloc_ahnd(i915, 0);
 	igt_spin_t *spin = igt_spin_new(i915, .ahnd = ahnd);
@@ -313,6 +313,42 @@ static void pf_nonblock(int i915)
 	put_ahnd(ahnd);
 }
 
+static void pf_nonblock(int i915)
+{
+	uint64_t ahnd = get_reloc_ahnd(i915, 0);
+
+	pf_nonblock_batch(i915);
+
+	for_each_memory_region(r, i915) {
+		igt_spin_t *spin;
+		uint32_t handle;
+
+		handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
+		spin = igt_spin_new(i915, .ahnd = ahnd, .dependency = handle);
+
+		for_each_mmap_offset_type(i915, t) {
+			uint32_t *ptr;
+
+			ptr = __mmap_offset(i915, handle, 0, 4096,
+					    PROT_READ | PROT_WRITE,
+					    t->type);
+			if (!ptr)
+				continue;
+
+			igt_set_timeout(1, t->name);
+			/* no set-domain as we want to verify the pagefault is async */
+			ptr[256] = 0;
+			igt_reset_timeout();
+
+			munmap(ptr, 4096);
+		}
+
+		igt_spin_free(i915, spin);
+		gem_close(i915, handle);
+	}
+	put_ahnd(ahnd);
+}
+
 static void *memchr_inv(const void *s, int c, size_t n)
 {
 	const uint8_t *us = s;
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (8 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 09/12] i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  3:50   ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 11/12] i915/gem_mmap_offset: Exercise close race against all types/regions Zbigniew Kempczyński
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@linux.intel.com>

Extend the bad_object negative subtest to cover all mmap types.

Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
---
 tests/i915/gem_mmap_offset.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 40daa53061..7c663f1074 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -121,15 +121,17 @@ static void bad_object(int i915)
 	handles[i] = real_handle + 1;
 
 	for (; i >= 0; i--) {
-		struct drm_i915_gem_mmap_offset arg = {
-			.handle = handles[i],
-			.flags = I915_MMAP_OFFSET_WB,
-		};
+		for_each_mmap_offset_type(i915, t) {
+			struct drm_i915_gem_mmap_offset arg = {
+				.handle = handles[i],
+				.flags = t->type,
+			};
 
-		igt_debug("Trying MMAP IOCTL with handle %x\n",
-			  handles[i]);
-		igt_assert_eq(mmap_offset_ioctl(i915, &arg),
-			      -ENOENT);
+			igt_debug("Trying MMAP IOCTL[%s] with handle %x\n",
+				  t->name, handles[i]);
+			igt_assert_eq(mmap_offset_ioctl(i915, &arg),
+				      -ENOENT);
+		}
 	}
 
 	gem_close(i915, real_handle);
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 11/12] i915/gem_mmap_offset: Exercise close race against all types/regions
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (9 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps Zbigniew Kempczyński
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@linux.intel.com>

Iterate over all mmmap types and memory regions looking for races
against closing the object.

Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
---
 tests/i915/gem_mmap_offset.c | 42 +++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 7c663f1074..5c3ed3d29f 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -491,29 +491,31 @@ static void close_race(int i915, int timeout)
 
 	igt_fork(child, ncpus + 1) {
 		do {
-			struct drm_i915_gem_mmap_offset mmap_arg = {};
-			const int i = 1 + random() % ncpus;
-			uint32_t old;
-
-			mmap_arg.handle = gem_create(i915, 4096);
-			mmap_arg.flags = I915_MMAP_OFFSET_WB;
-			old = atomic_exchange(&handles[i], mmap_arg.handle);
-			ioctl(i915, DRM_IOCTL_GEM_CLOSE, &old);
-
-			if (ioctl(i915,
-				  DRM_IOCTL_I915_GEM_MMAP_OFFSET,
-				  &mmap_arg) != -1) {
-				void *ptr;
-
-				ptr = mmap64(0, 4096,
-					     PROT_WRITE, MAP_SHARED, i915,
-					     mmap_arg.offset);
-				if (ptr != MAP_FAILED) {
+			for_each_memory_region(r, i915) {
+				const int i = 1 + random() % ncpus;
+				uint64_t size = 4096;
+				uint32_t bo, old;
+
+				igt_assert_eq(__gem_create_in_memory_region_list(i915, &bo, &size, 0, &r->ci, 1), 0);
+				make_resident(i915, 0, bo);
+
+				old = atomic_exchange(&handles[i], bo);
+				ioctl(i915, DRM_IOCTL_GEM_CLOSE, &old);
+
+				for_each_mmap_offset_type(i915, t) {
+					void *ptr;
+
+					ptr = __mmap_offset(i915, bo, 0, size,
+							    PROT_READ | PROT_WRITE,
+							    t->type);
+					if (!ptr)
+						continue;
+
+
 					*(volatile uint32_t *)ptr = 0;
-					munmap(ptr, 4096);
+					munmap(ptr, size);
 				}
 			}
-
 		} while (!READ_ONCE(handles[0]));
 	}
 
-- 
2.34.1

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

* [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (10 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 11/12] i915/gem_mmap_offset: Exercise close race against all types/regions Zbigniew Kempczyński
@ 2022-09-01 11:44 ` Zbigniew Kempczyński
  2022-09-02  3:59   ` Zbigniew Kempczyński
  2022-09-01 13:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Patchwork
  2022-09-02 10:16 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  13 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 11:44 UTC (permalink / raw)
  To: igt-dev

From: Chris Wilson <chris.p.wilson@intel.com>

Compare the read/write performance of different mmap types to different
memory regions.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
---
 tests/i915/gem_mmap_offset.c | 74 ++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 5c3ed3d29f..1f14265094 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -107,6 +107,73 @@ static void make_resident(int i915, uint32_t batch, uint32_t handle)
 		gem_close(i915, obj[1].handle);
 }
 
+static void perf(int i915, const struct gem_memory_region *r)
+{
+#define MiB (1024 * 1024)
+	const unsigned int rep = 1024;
+	const uint64_t sz = 4096;
+	struct timespec tv;
+	uint32_t handle;
+	char buf[4096];
+
+	/*
+	 * Time reading/writing through each mmap type into each
+	 * memory region to have a rough estimate of the memory
+	 * bandwidth exposed to userspace across each link.
+	 *
+	 * For example, we would expect that reading and writing to
+	 * lmem would utilise the full PCIe bandwidth (>3.2GiB/s),
+	 * and notably be symmetric, the same in both directions.
+	 */
+
+	handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
+	make_resident(i915, 0, handle);
+
+	for_each_mmap_offset_type(i915, t) {
+		double ns;
+		void *ptr;
+
+		ptr = __mmap_offset(i915, handle, 0, sz,
+				    PROT_READ | PROT_WRITE,
+				    t->type);
+		if (!ptr)
+			continue;
+
+		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
+		for (int i = 0; i < rep; i++)
+			memset(ptr, 0, sz);
+		ns = igt_nsec_elapsed(&tv);
+		igt_info("%s: Clear    %12.2fMiB/s\n",
+			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
+
+		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
+		for (int i = 0; i < rep; i++)
+			memcpy(ptr, buf, sz);
+		ns = igt_nsec_elapsed(&tv);
+		igt_info("%s: Write    %12.2fMiB/s\n",
+			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
+
+		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
+		for (int i = 0; i < rep; i++)
+			memcpy(buf, ptr, sz);
+		ns = igt_nsec_elapsed(&tv);
+		igt_info("%s: Read     %12.2fMiB/s\n",
+			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
+
+		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
+		for (int i = 0; i < rep; i++)
+			igt_memcpy_from_wc(buf, ptr, sz);
+		ns = igt_nsec_elapsed(&tv);
+		igt_info("%s: movntqda %12.2fMiB/s\n",
+			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
+
+		munmap(ptr, sz);
+	}
+
+	gem_close(i915, handle);
+#undef MiB
+}
+
 static void bad_object(int i915)
 {
 	uint32_t real_handle;
@@ -837,6 +904,13 @@ igt_main
 		}
 	}
 
+	igt_subtest_with_dynamic("perf") {
+		for_each_memory_region(r, i915) {
+			igt_dynamic_f("%s", r->name)
+				perf(i915, r);
+		}
+	}
+
 	igt_subtest_f("blt-coherency")
 		blt_coherency(i915);
 
-- 
2.34.1

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

* [igt-dev] ✓ Fi.CI.BAT: success for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (11 preceding siblings ...)
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps Zbigniew Kempczyński
@ 2022-09-01 13:16 ` Patchwork
  2022-09-02 10:16 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  13 siblings, 0 replies; 29+ messages in thread
From: Patchwork @ 2022-09-01 13:16 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 4960 bytes --]

== Series Details ==

Series: Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests
URL   : https://patchwork.freedesktop.org/series/108022/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12061 -> IGTPW_7720
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (35 -> 35)
------------------------------

  Additional (1): bat-dg2-8 
  Missing    (1): fi-bdw-samus 

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_suspend@basic-s3-without-i915:
    - fi-bdw-5557u:       [PASS][1] -> [INCOMPLETE][2] ([i915#146] / [i915#6598])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/fi-bdw-5557u/igt@i915_suspend@basic-s3-without-i915.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/fi-bdw-5557u/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-pnv-d510:        NOTRUN -> [SKIP][3] ([fdo#109271])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/fi-pnv-d510/igt@kms_chamelium@common-hpd-after-suspend.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@requests:
    - fi-pnv-d510:        [DMESG-FAIL][4] ([i915#4528]) -> [PASS][5]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/fi-pnv-d510/igt@i915_selftest@live@requests.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/fi-pnv-d510/igt@i915_selftest@live@requests.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
    - fi-bsw-kefka:       [FAIL][6] ([i915#6298]) -> [PASS][7]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
  [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
  [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
  [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257
  [i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
  [i915#6380]: https://gitlab.freedesktop.org/drm/intel/issues/6380
  [i915#6598]: https://gitlab.freedesktop.org/drm/intel/issues/6598
  [i915#6599]: https://gitlab.freedesktop.org/drm/intel/issues/6599
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6670]: https://gitlab.freedesktop.org/drm/intel/issues/6670


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6639 -> IGTPW_7720

  CI-20190529: 20190529
  CI_DRM_12061: d25f068998ce803ef0a05883616344c0afcbc55a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7720: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/index.html
  IGT_6639: ba61c48dba71d5597d7297a07dc3e307665f961b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

+igt@gem_create@hog-create
+igt@gem_mmap_offset@perf

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/index.html

[-- Attachment #2: Type: text/html, Size: 3894 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions Zbigniew Kempczyński
@ 2022-09-01 17:53   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 17:53 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:32PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@linux.intel.com>
> 
> Make the memory regions passed to gem_crate_in_memory_region_list() as
> being const.

Ok, no doubts it is better.

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

> 
> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> ---
>  lib/i915/intel_memory_region.c | 4 ++--
>  lib/i915/intel_memory_region.h | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
> index 93a18982c1..568bace949 100644
> --- a/lib/i915/intel_memory_region.c
> +++ b/lib/i915/intel_memory_region.c
> @@ -198,7 +198,7 @@ bool gem_has_lmem(int fd)
>  /* A version of gem_create_in_memory_region_list which can be allowed to
>     fail so that the object creation can be retried */
>  int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size, uint32_t flags,
> -				       struct drm_i915_gem_memory_class_instance *mem_regions,
> +				       const struct drm_i915_gem_memory_class_instance *mem_regions,
>  				       int num_regions)
>  {
>  	struct drm_i915_gem_create_ext_memory_regions ext_regions = {
> @@ -234,7 +234,7 @@ int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size,
>   * @num_regions: @mem_regions length
>   */
>  uint32_t gem_create_in_memory_region_list(int fd, uint64_t size, uint32_t flags,
> -					  struct drm_i915_gem_memory_class_instance *mem_regions,
> +					  const struct drm_i915_gem_memory_class_instance *mem_regions,
>  					  int num_regions)
>  {
>  	uint32_t handle;
> diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
> index e1bfe0ca65..fd04df83b5 100644
> --- a/lib/i915/intel_memory_region.h
> +++ b/lib/i915/intel_memory_region.h
> @@ -65,11 +65,11 @@ unsigned int gem_get_lmem_region_count(int fd);
>  bool gem_has_lmem(int fd);
>  
>  int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t *size, uint32_t flags,
> -				       struct drm_i915_gem_memory_class_instance *mem_regions,
> +				       const struct drm_i915_gem_memory_class_instance *mem_regions,
>  				       int num_regions);
>  
>  uint32_t gem_create_in_memory_region_list(int fd, uint64_t size, uint32_t flags,
> -					  struct drm_i915_gem_memory_class_instance *mem_regions,
> +					  const struct drm_i915_gem_memory_class_instance *mem_regions,
>  					  int num_regions);
>  
>  /*
> -- 
> 2.34.1
>

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

* Re: [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain Zbigniew Kempczyński
@ 2022-09-01 17:58   ` Zbigniew Kempczyński
  2022-09-02  8:41     ` Petri Latvala
  0 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 17:58 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:33PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@linux.intel.com>
> 
> Don't treat OFFSET_FIXED as using DOMAIN_CPU [0], but give it an invalid
> domain so we can avoid using in tests.

I915_GEM_DOMAIN_CPU == 1, so 
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> ---
>  lib/i915/gem_mman.c          |  2 +-
>  tests/i915/gem_mmap_offset.c | 12 ++++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index aa9ac6f3d7..48e3f8c991 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -678,7 +678,7 @@ const struct mmap_offset mmap_offset_types[] = {
>  	{ "wb", I915_MMAP_OFFSET_WB, I915_GEM_DOMAIN_CPU },
>  	{ "wc", I915_MMAP_OFFSET_WC, I915_GEM_DOMAIN_WC },
>  	{ "uc", I915_MMAP_OFFSET_UC, I915_GEM_DOMAIN_WC },
> -	{ "fixed", I915_MMAP_OFFSET_FIXED, 0},
> +	{ "fixed", I915_MMAP_OFFSET_FIXED, -1 },

this is not needed.

>  	{},
>  };
>  
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 5e6b19eb34..d1075c32eb 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -148,7 +148,8 @@ static void basic_uaf(int i915)
>  		}
>  
>  		expected = calloc(obj_size, sizeof(*expected));
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain != -1)

Just if (t->domain) is enough here.

--
Zbigniew

> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
>  			     "mmap(%s) not clear on gem_create()\n",
>  			     t->name);
> @@ -157,15 +158,18 @@ static void basic_uaf(int i915)
>  		buf = calloc(obj_size, sizeof(*buf));
>  		memset(buf + 1024, 0x01, 1024);
>  		gem_write(i915, handle, 0, buf, obj_size);
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain != -1)
> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
>  			     "mmap(%s) not coherent with gem_write()\n",
>  			     t->name);
>  
> -		gem_set_domain(i915, handle, t->domain, t->domain);
> +		if (t->domain != -1)
> +			gem_set_domain(i915, handle, t->domain, t->domain);
>  		memset(addr + 2048, 0xff, 1024);
>  		gem_read(i915, handle, 0, buf, obj_size);
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain != -1)
> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
>  			     "mmap(%s) not coherent with gem_read()\n",
>  			     t->name);
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects Zbigniew Kempczyński
@ 2022-09-01 18:36   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-01 18:36 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:34PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> We do not tolerate leaking stale information in newly created objects, so
> make sure the test covers all memory regions.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_create.c | 100 +++++++++++++++++++++++++++++++---------
>  1 file changed, 77 insertions(+), 23 deletions(-)
> 
> diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> index d7d2a01722..06a9498e0d 100644
> --- a/tests/i915/gem_create.c
> +++ b/tests/i915/gem_create.c
> @@ -59,6 +59,7 @@
>  #include "i915/gem_create.h"
>  #include "i915/gem_engine_topology.h"
>  #include "i915/gem_mman.h"
> +#include "i915/intel_memory_region.h"
>  #include "i915_drm.h"
>  
>  IGT_TEST_DESCRIPTION("Ensure that basic gem_create and gem_create_ext works"
> @@ -145,45 +146,88 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
>  
>  struct thread_clear {
>  	_Atomic(uint64_t) max;
> +	struct drm_i915_gem_memory_class_instance region;
>  	int timeout;
>  	int i915;
>  };
>  
> +static uint32_t batch_create(int i915)
> +{
> +	const uint32_t bbe = MI_BATCH_BUFFER_END;
> +	uint32_t handle = gem_create(i915, sizeof(bbe));
> +
> +	gem_write(i915, handle, 0, &bbe, sizeof(bbe));
> +	return handle;
> +}
> +
> +static void make_resident(int i915, uint32_t batch, uint32_t handle)
> +{
> +	struct drm_i915_gem_exec_object2 obj[2] = {
> +		[0] = {
> +			.handle = handle,
> +			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
> +

Extra line.

> +		},
> +		[1] = {
> +			.handle = batch ?: batch_create(i915),
> +			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
> +		},
> +	};
> +	struct drm_i915_gem_execbuffer2 eb = {
> +		.buffers_ptr = to_user_pointer(obj),
> +		.buffer_count = ARRAY_SIZE(obj),
> +	};
> +	int err;
> +
> +	err = __gem_execbuf(i915, &eb);
> +	if (obj[1].handle != batch)
> +		gem_close(i915, obj[1].handle);
> +
> +	igt_assert(err == 0 || err == -E2BIG || err == -ENOSPC);
> +}
> +
>  static void *thread_clear(void *data)
>  {
>  	struct thread_clear *arg = data;
>  	unsigned long checked = 0, total = 0;
> -	enum { PRW, GTT, WC, WB, __LAST__ } mode = PRW;
> +	enum { PRW, GTT, WC, WB, __LAST__, FIXED } mode = PRW;
>  	int i915 = arg->i915;
> +	uint32_t batch = batch_create(i915);
> +
> +	if (__gem_write(i915, 0, 0, 0, 0) == -EOPNOTSUPP)
> +		mode = FIXED;
>  
>  	igt_until_timeout(arg->timeout) {
> -		struct drm_i915_gem_create create = {};
> -		uint64_t npages;
> +		uint64_t npages, size;
> +		uint32_t handle;
>  		void *ptr;
>  
>  		npages = random();
>  		npages <<= 32;
>  		npages |= random();
>  		npages = get_npages(&arg->max, npages);
> -		create.size = npages << 12;
> +		size = npages << 12;
> +
> +		igt_assert_eq(__gem_create_in_memory_region_list(i915, &handle, &size, 0, &arg->region, 1), 0);
> +		if (random() & 1)
> +			make_resident(i915, batch, handle);
>  
> -		create_ioctl(i915, &create);
>  		switch (mode) {
> +		case FIXED:
> +			ptr = __gem_mmap_offset__fixed(i915, handle, 0, size, PROT_READ);
> +			break;
>  		case __LAST__:
>  		case PRW:
>  			ptr = NULL;
>  			break;
>  		case WB:
> -			ptr = __gem_mmap__cpu(i915, create.handle,
> -					      0, create.size, PROT_READ);
> +			ptr = __gem_mmap__cpu(i915, handle, 0, size, PROT_READ);
>  			break;
>  		case WC:
> -			ptr = __gem_mmap__wc(i915, create.handle,
> -					     0, create.size, PROT_READ);
> +			ptr = __gem_mmap__wc(i915, handle, 0, size, PROT_READ);
>  			break;
>  		case GTT:
> -			ptr = __gem_mmap__gtt(i915, create.handle,
> -					      create.size, PROT_READ);
> +			ptr = __gem_mmap__gtt(i915, handle, size, PROT_READ);
>  			break;
>  		}
>  		/* No set-domains as we are being as naughty as possible */
> @@ -195,7 +239,7 @@ static void *thread_clear(void *data)
>  			};
>  
>  			if (!ptr)
> -				gem_read(i915, create.handle, x[0], x, sizeof(x));
> +				gem_read(i915, handle, x[0], x, sizeof(x));
>  			else if (page & 1)
>  				igt_memcpy_from_wc(x, ptr + x[0], sizeof(x));
>  			else
> @@ -207,26 +251,28 @@ static void *thread_clear(void *data)
>  			checked++;
>  		}
>  		if (ptr)
> -			munmap(ptr, create.size);
> -		gem_close(i915, create.handle);
> +			munmap(ptr, size);
> +		gem_close(i915, handle);
>  
>  		total += npages;
>  		atomic_fetch_add(&arg->max, npages);
>  
> -		if (++mode == __LAST__)
> +		if (mode < __LAST__ && ++mode == __LAST__)
>  			mode = PRW;
>  	}
> +	gem_close(i915, batch);
>  
>  	igt_info("Checked %'lu / %'lu pages\n", checked, total);
>  	return (void *)(uintptr_t)checked;
>  }
>  
> -static void always_clear(int i915, int timeout)
> +static void always_clear(int i915, const struct gem_memory_region *r, int timeout)
>  {
>  	struct thread_clear arg = {
>  		.i915 = i915,
> +		.region = r->ci,
> +		.max = r->size / 2 >> 12, /* in pages */
>  		.timeout = timeout,
> -		.max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
>  	};
>  	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
>  	unsigned long checked;
> @@ -244,7 +290,7 @@ static void always_clear(int i915, int timeout)
>  	igt_info("Checked %'lu page allocations\n", checked);
>  }
>  
> -static void busy_create(int i915, int timeout)
> +static void busy_create(int i915, const struct gem_memory_region *r, int timeout)
>  {
>  	struct intel_execution_engine2 *e;
>  	const intel_ctx_t *ctx;
> @@ -267,7 +313,7 @@ static void busy_create(int i915, int timeout)
>  			uint32_t handle;
>  			igt_spin_t *next;
>  
> -			handle = gem_create(i915, 4096);
> +			handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
>  			next = igt_spin_new(i915,
>  					    .ahnd = ahnd,
>  					    .ctx = ctx,
> @@ -808,12 +854,20 @@ igt_main
>  		size_update(fd);
>  
>  	igt_describe("Verify that all new objects are clear.");
> -	igt_subtest("create-clear")
> -		always_clear(fd, 30);
> +	igt_subtest_with_dynamic("create-clear") {
> +		for_each_memory_region(r, fd) {
> +			igt_dynamic_f("%s", r->name)
> +				always_clear(fd, r, 30);
> +		}
> +	}

Currently with smem / lmem0 we won't hit igt_runner timeout, but we need to 
address this in the future for gpus with more regions.

With above nit fixed:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

>  
>  	igt_describe("Create buffer objects while GPU is busy.");
> -	igt_subtest("busy-create")
> -		busy_create(fd, 30);
> +	igt_subtest_with_dynamic("busy-create") {
> +		for_each_memory_region(r, fd) {
> +			igt_dynamic_f("%s", r->name)
> +				busy_create(fd, r, 30);
> +		}
> +	}
>  
>  	igt_describe("Exercise create_ext placements extension.");
>  	igt_subtest("create-ext-placement-sanity-check")
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines Zbigniew Kempczyński
@ 2022-09-02  3:36   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  3:36 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:35PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> Use shortlived non-preemptible batches to demonstrate an issue with
> waiting on user controlled resources.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_create.c | 54 +++++++++++++++++++++++++++--------------
>  1 file changed, 36 insertions(+), 18 deletions(-)
> 
> diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> index 06a9498e0d..c4c40e85c0 100644
> --- a/tests/i915/gem_create.c
> +++ b/tests/i915/gem_create.c
> @@ -290,7 +290,8 @@ static void always_clear(int i915, const struct gem_memory_region *r, int timeou
>  	igt_info("Checked %'lu page allocations\n", checked);
>  }
>  
> -static void busy_create(int i915, const struct gem_memory_region *r, int timeout)
> +static void busy_create(int i915, const struct gem_memory_region *r, int timeout, unsigned int flags)
> +#define BUSY_HOG 0x1
>  {
>  	struct intel_execution_engine2 *e;
>  	const intel_ctx_t *ctx;
> @@ -301,12 +302,14 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
>  	ctx = intel_ctx_create_all_physical(i915);
>  	ahnd = get_reloc_ahnd(i915, ctx->id);
>  
> -	igt_fork_hang_detector(i915);
> -	for_each_ctx_engine(i915, ctx, e)
> -		spin[e->flags] = igt_spin_new(i915,
> -					      .ahnd = ahnd,
> -					      .ctx = ctx,
> -					      .engine = e->flags);
> +	for_each_ctx_engine(i915, ctx, e) {
> +		spin[e->flags] =
> +			igt_spin_new(i915,
> +				     .ahnd = ahnd,
> +				     .ctx = ctx,
> +				     .engine = e->flags,
> +				     .flags = flags & BUSY_HOG ? IGT_SPIN_NO_PREEMPTION : 0);
> +	}
>  
>  	igt_until_timeout(timeout) {
>  		for_each_ctx_engine(i915, ctx, e) {
> @@ -314,12 +317,13 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
>  			igt_spin_t *next;
>  
>  			handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
> -			next = igt_spin_new(i915,
> -					    .ahnd = ahnd,
> -					    .ctx = ctx,
> -					    .engine = e->flags,
> -					    .dependency = handle,
> -					    .flags = IGT_SPIN_SOFTDEP);
> +			next = __igt_spin_new(i915,
> +					      .ahnd = ahnd,
> +					      .ctx = ctx,
> +					      .engine = e->flags,
> +					      .dependency = handle,
> +					      .flags = ((flags & BUSY_HOG ? IGT_SPIN_NO_PREEMPTION : 0) |
> +							IGT_SPIN_SOFTDEP));
>  			gem_close(i915, handle);
>  
>  			igt_spin_free(i915, spin[e->flags]);
> @@ -335,7 +339,6 @@ static void busy_create(int i915, const struct gem_memory_region *r, int timeout
>  	igt_info("Created %ld objects while busy\n", count);
>  
>  	gem_quiescent_gpu(i915);
> -	igt_stop_hang_detector();
>  }
>  
>  static void size_update(int fd)
> @@ -862,11 +865,26 @@ igt_main
>  	}
>  
>  	igt_describe("Create buffer objects while GPU is busy.");
> -	igt_subtest_with_dynamic("busy-create") {
> -		for_each_memory_region(r, fd) {
> -			igt_dynamic_f("%s", r->name)
> -				busy_create(fd, r, 30);
> +	igt_subtest_group {
> +		igt_fixture
> +			igt_fork_hang_detector(fd);
> +
> +		igt_subtest_with_dynamic("busy-create") {
> +			for_each_memory_region(r, fd) {
> +				igt_dynamic_f("%s", r->name)
> +					busy_create(fd, r, 30, 0);
> +			}
>  		}
> +
> +		igt_subtest_with_dynamic("hog-create") {
> +			for_each_memory_region(r, fd) {
> +				igt_dynamic_f("%s", r->name)
> +					busy_create(fd, r, 30, BUSY_HOG);
> +			}
> +		}
> +
> +		igt_fixture
> +			igt_stop_hang_detector();
>  	}
>  
>  	igt_describe("Exercise create_ext placements extension.");
> -- 
> 2.34.1
> 

Looks good for me.

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

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

* Re: [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration Zbigniew Kempczyński
@ 2022-09-02  3:42   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  3:42 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:36PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> We do not tolerate leaking stale information in newly created objects, so
> make sure the test covers all memory regions.

Typo in email subject s/cration/creation/.

With this small nit fixed:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

> 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 87 +++++++++++++++++++++++++-----------
>  1 file changed, 60 insertions(+), 27 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index d1075c32eb..faadbd4ee6 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -35,6 +35,7 @@
>  
>  #include "i915/gem.h"
>  #include "i915/gem_create.h"
> +#include "i915/intel_memory_region.h"
>  #include "igt.h"
>  #include "igt_x86.h"
>  
> @@ -75,6 +76,37 @@ __mmap_offset(int i915, uint32_t handle, uint64_t offset, uint64_t size,
>  	return ptr;
>  }
>  
> +static uint32_t batch_create(int i915)
> +{
> +	const uint32_t bbe = MI_BATCH_BUFFER_END;
> +	uint32_t handle = gem_create(i915, sizeof(bbe));
> +
> +	gem_write(i915, handle, 0, &bbe, sizeof(bbe));
> +	return handle;
> +}
> +
> +static void make_resident(int i915, uint32_t batch, uint32_t handle)
> +{
> +	struct drm_i915_gem_exec_object2 obj[2] = {
> +		[0] = {
> +			.handle = handle,
> +			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
> +		},
> +		[1] = {
> +			.handle = batch ?: batch_create(i915),
> +			.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
> +		},
> +	};
> +	struct drm_i915_gem_execbuffer2 eb = {
> +		.buffers_ptr = to_user_pointer(obj),
> +		.buffer_count = ARRAY_SIZE(obj),
> +	};
> +
> +	gem_execbuf(i915, &eb);
> +	if (obj[1].handle != batch)
> +		gem_close(i915, obj[1].handle);
> +}
> +
>  static void bad_object(int i915)
>  {
>  	uint32_t real_handle;
> @@ -529,44 +561,35 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
>  
>  struct thread_clear {
>  	_Atomic(uint64_t) max;
> +	struct drm_i915_gem_memory_class_instance region;
>  	int timeout;
>  	int i915;
>  };
>  
> -static int create_ioctl(int i915, struct drm_i915_gem_create *create)
> -{
> -	int err = 0;
> -
> -	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CREATE, create)) {
> -		err = -errno;
> -		igt_assume(err != 0);
> -	}
> -
> -	errno = 0;
> -	return err;
> -}
> -
>  static void *thread_clear(void *data)
>  {
>  	struct thread_clear *arg = data;
>  	const struct mmap_offset *t;
> -	unsigned long checked = 0;
> +	unsigned long checked = 0, total = 0;
>  	int i915 = arg->i915;
> +	uint32_t batch = batch_create(i915);
>  
>  	t = mmap_offset_types;
>  	igt_until_timeout(arg->timeout) {
> -		struct drm_i915_gem_create create = {};
> -		uint64_t npages;
> +		uint64_t npages, size;
> +		uint32_t handle;
>  		void *ptr;
>  
>  		npages = random();
>  		npages <<= 32;
>  		npages |= random();
>  		npages = get_npages(&arg->max, npages);
> -		create.size = npages << 12;
> +		size = npages << 12;
>  
> -		create_ioctl(i915, &create);
> -		ptr = __mmap_offset(i915, create.handle, 0, create.size,
> +		igt_assert_eq(__gem_create_in_memory_region_list(i915, &handle, &size, 0, &arg->region, 1), 0);
> +		make_resident(i915, batch, handle);
> +
> +		ptr = __mmap_offset(i915, handle, 0, size,
>  				    PROT_READ | PROT_WRITE,
>  				    t->type);
>  		/* No set-domains as we are being as naughty as possible */
> @@ -584,26 +607,32 @@ static void *thread_clear(void *data)
>  			for (int i = 0; i < ARRAY_SIZE(x); i++)
>  				igt_assert_eq_u64(x[i], 0);
>  		}
> -		if (ptr)
> -			munmap(ptr, create.size);
> -		gem_close(i915, create.handle);
> -		checked += npages;
> +		if (ptr) {
> +			munmap(ptr, size);
> +			checked += npages;
> +		}
> +		gem_close(i915, handle);
>  
> +		total += npages;
>  		atomic_fetch_add(&arg->max, npages);
>  
>  		if (!(++t)->name)
>  			t = mmap_offset_types;
>  	}
>  
> +	gem_close(i915, batch);
> +
> +	igt_info("Checked %'lu / %'lu pages\n", checked, total);
>  	return (void *)(uintptr_t)checked;
>  }
>  
> -static void always_clear(int i915, int timeout)
> +static void always_clear(int i915, const struct gem_memory_region *r, int timeout)
>  {
>  	struct thread_clear arg = {
>  		.i915 = i915,
> +		.region = r->ci,
> +		.max = r->size / 2 >> 12, /* in pages */
>  		.timeout = timeout,
> -		.max = igt_get_avail_ram_mb() << (20 - 12), /* in pages */
>  	};
>  	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
>  	unsigned long checked;
> @@ -750,8 +779,12 @@ igt_main
>  	igt_subtest_f("open-flood")
>  		open_flood(i915, 20);
>  
> -	igt_subtest_f("clear")
> -		always_clear(i915, 20);
> +	igt_subtest_with_dynamic("clear") {
> +		for_each_memory_region(r, i915) {
> +			igt_dynamic_f("%s", r->name)
> +				always_clear(i915, r, 20);
> +		}
> +	}
>  
>  	igt_subtest_f("blt-coherency")
>  		blt_coherency(i915);
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace Zbigniew Kempczyński
@ 2022-09-02  3:46   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  3:46 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:37PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> Check we can use ptrace to query *ptr of each mmap for each region.

Looks we haven't checked local memory before, so:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

> 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 84 ++++++++++++++++++++----------------
>  1 file changed, 46 insertions(+), 38 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index faadbd4ee6..806a9d68f4 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -370,64 +370,72 @@ static void test_ptrace(int i915)
>  	const unsigned int SZ = 3 * 4096;
>  	unsigned long *ptr, *cpy;
>  	unsigned long AA, CC;
> -	uint32_t bo;
>  
>  	memset(&AA, 0xaa, sizeof(AA));
>  	memset(&CC, 0x55, sizeof(CC));
>  
>  	cpy = malloc(SZ);
> -	bo = gem_create(i915, SZ);
> +	igt_assert(cpy);
>  
> -	for_each_mmap_offset_type(i915, t) {
> -		ptr = __mmap_offset(i915, bo, 0, SZ,
> -				    PROT_READ | PROT_WRITE,
> -				    t->type);
> -		if (!ptr)
> -			continue;
> +	for_each_memory_region(r, i915) {
> +		uint64_t size = SZ;
> +		uint32_t bo;
>  
> -		igt_dynamic_f("%s", t->name) {
> -			pid_t pid;
> +		igt_assert_eq(__gem_create_in_memory_region_list(i915, &bo, &size, 0, &r->ci, 1), 0);
> +		make_resident(i915, 0, bo);
>  
> -			memset(cpy, AA, SZ);
> -			memset(ptr, CC, SZ);
> +		for_each_mmap_offset_type(i915, t) {
> +			ptr = __mmap_offset(i915, bo, 0, size,
> +					    PROT_READ | PROT_WRITE,
> +					    t->type);
> +			if (!ptr)
> +				continue;
>  
> -			igt_assert(!memchr_inv(ptr, CC, SZ));
> -			igt_assert(!memchr_inv(cpy, AA, SZ));
> +			igt_dynamic_f("%s-%s", r->name, t->name) {
> +				pid_t pid;
>  
> -			igt_fork(child, 1) {
> -				ptrace(PTRACE_TRACEME, 0, NULL, NULL);
> -				raise(SIGSTOP);
> -			}
> +				memset(cpy, AA, SZ);
> +				memset(ptr, CC, SZ);
>  
> -			/* Wait for the child to ready themselves [SIGSTOP] */
> -			pid = wait(NULL);
> +				igt_assert(!memchr_inv(ptr, CC, SZ));
> +				igt_assert(!memchr_inv(cpy, AA, SZ));
>  
> -			ptrace(PTRACE_ATTACH, pid, NULL, NULL);
> -			for (int i = 0; i < SZ / sizeof(long); i++) {
> -				long ret;
> +				igt_fork(child, 1) {
> +					ptrace(PTRACE_TRACEME, 0, NULL, NULL);
> +					raise(SIGSTOP);
> +				}
>  
> -				ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
> -				igt_assert_eq_u64(ret, CC);
> -				cpy[i] = ret;
> +				/* Wait for the child to ready themselves [SIGSTOP] */
> +				pid = wait(NULL);
>  
> -				ret = ptrace(PTRACE_POKEDATA, pid, ptr + i, AA);
> -				igt_assert_eq(ret, 0l);
> -			}
> -			ptrace(PTRACE_DETACH, pid, NULL, NULL);
> +				ptrace(PTRACE_ATTACH, pid, NULL, NULL);
> +				for (int i = 0; i < SZ / sizeof(long); i++) {
> +					long ret;
> +
> +					ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
> +					igt_assert_eq_u64(ret, CC);
> +					cpy[i] = ret;
> +
> +					ret = ptrace(PTRACE_POKEDATA, pid, ptr + i, AA);
> +					igt_assert_eq(ret, 0l);
> +				}
> +				ptrace(PTRACE_DETACH, pid, NULL, NULL);
>  
> -			/* Wakeup the child for it to exit */
> -			kill(SIGCONT, pid);
> -			igt_waitchildren();
> +				/* Wakeup the child for it to exit */
> +				kill(SIGCONT, pid);
> +				igt_waitchildren();
>  
> -			/* The two buffers should now be swapped */
> -			igt_assert(!memchr_inv(ptr, AA, SZ));
> -			igt_assert(!memchr_inv(cpy, CC, SZ));
> +				/* The two buffers should now be swapped */
> +				igt_assert(!memchr_inv(ptr, AA, SZ));
> +				igt_assert(!memchr_inv(cpy, CC, SZ));
> +			}
> +
> +			munmap(ptr, size);
>  		}
>  
> -		munmap(ptr, SZ);
> +		gem_close(i915, bo);
>  	}
>  
> -	gem_close(i915, bo);
>  	free(cpy);
>  }
>  
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects Zbigniew Kempczyński
@ 2022-09-02  3:50   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  3:50 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:40PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@linux.intel.com>
> 
> Extend the bad_object negative subtest to cover all mmap types.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 40daa53061..7c663f1074 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -121,15 +121,17 @@ static void bad_object(int i915)
>  	handles[i] = real_handle + 1;
>  
>  	for (; i >= 0; i--) {
> -		struct drm_i915_gem_mmap_offset arg = {
> -			.handle = handles[i],
> -			.flags = I915_MMAP_OFFSET_WB,
> -		};
> +		for_each_mmap_offset_type(i915, t) {
> +			struct drm_i915_gem_mmap_offset arg = {
> +				.handle = handles[i],
> +				.flags = t->type,
> +			};
>  
> -		igt_debug("Trying MMAP IOCTL with handle %x\n",
> -			  handles[i]);
> -		igt_assert_eq(mmap_offset_ioctl(i915, &arg),
> -			      -ENOENT);
> +			igt_debug("Trying MMAP IOCTL[%s] with handle %x\n",
> +				  t->name, handles[i]);
> +			igt_assert_eq(mmap_offset_ioctl(i915, &arg),
> +				      -ENOENT);
> +		}
>  	}
>  
>  	gem_close(i915, real_handle);
> -- 
> 2.34.1
>

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew 

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

* Re: [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps Zbigniew Kempczyński
@ 2022-09-02  3:59   ` Zbigniew Kempczyński
  2022-09-20 12:49     ` Petri Latvala
  0 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  3:59 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

On Thu, Sep 01, 2022 at 01:44:42PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> Compare the read/write performance of different mmap types to different
> memory regions.
>

+Petri - please decide can we merge this.

This tests performance only but execution time < 1s so I got no problem
with this (it may be handy in the future for debugging purposes).

Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
 
--
Zbigniew
 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 74 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 5c3ed3d29f..1f14265094 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -107,6 +107,73 @@ static void make_resident(int i915, uint32_t batch, uint32_t handle)
>  		gem_close(i915, obj[1].handle);
>  }
>  
> +static void perf(int i915, const struct gem_memory_region *r)
> +{
> +#define MiB (1024 * 1024)
> +	const unsigned int rep = 1024;
> +	const uint64_t sz = 4096;
> +	struct timespec tv;
> +	uint32_t handle;
> +	char buf[4096];
> +
> +	/*
> +	 * Time reading/writing through each mmap type into each
> +	 * memory region to have a rough estimate of the memory
> +	 * bandwidth exposed to userspace across each link.
> +	 *
> +	 * For example, we would expect that reading and writing to
> +	 * lmem would utilise the full PCIe bandwidth (>3.2GiB/s),
> +	 * and notably be symmetric, the same in both directions.
> +	 */
> +
> +	handle = gem_create_in_memory_region_list(i915, 4096, 0, &r->ci, 1);
> +	make_resident(i915, 0, handle);
> +
> +	for_each_mmap_offset_type(i915, t) {
> +		double ns;
> +		void *ptr;
> +
> +		ptr = __mmap_offset(i915, handle, 0, sz,
> +				    PROT_READ | PROT_WRITE,
> +				    t->type);
> +		if (!ptr)
> +			continue;
> +
> +		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
> +		for (int i = 0; i < rep; i++)
> +			memset(ptr, 0, sz);
> +		ns = igt_nsec_elapsed(&tv);
> +		igt_info("%s: Clear    %12.2fMiB/s\n",
> +			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
> +
> +		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
> +		for (int i = 0; i < rep; i++)
> +			memcpy(ptr, buf, sz);
> +		ns = igt_nsec_elapsed(&tv);
> +		igt_info("%s: Write    %12.2fMiB/s\n",
> +			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
> +
> +		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
> +		for (int i = 0; i < rep; i++)
> +			memcpy(buf, ptr, sz);
> +		ns = igt_nsec_elapsed(&tv);
> +		igt_info("%s: Read     %12.2fMiB/s\n",
> +			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
> +
> +		igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
> +		for (int i = 0; i < rep; i++)
> +			igt_memcpy_from_wc(buf, ptr, sz);
> +		ns = igt_nsec_elapsed(&tv);
> +		igt_info("%s: movntqda %12.2fMiB/s\n",
> +			 t->name, sz * rep * NSEC_PER_SEC / ns / MiB);
> +
> +		munmap(ptr, sz);
> +	}
> +
> +	gem_close(i915, handle);
> +#undef MiB
> +}
> +
>  static void bad_object(int i915)
>  {
>  	uint32_t real_handle;
> @@ -837,6 +904,13 @@ igt_main
>  		}
>  	}
>  
> +	igt_subtest_with_dynamic("perf") {
> +		for_each_memory_region(r, i915) {
> +			igt_dynamic_f("%s", r->name)
> +				perf(i915, r);
> +		}
> +	}
> +
>  	igt_subtest_f("blt-coherency")
>  		blt_coherency(i915);
>  
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation Zbigniew Kempczyński
@ 2022-09-02  6:25   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  6:25 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:38PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@intel.com>
> 
> Check that we don't leak mmap pointers to different regions.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 99 +++++++++++++++++++-----------------
>  1 file changed, 51 insertions(+), 48 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 806a9d68f4..c392dc2092 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -219,68 +219,71 @@ static void basic_uaf(int i915)
>  
>  static void isolation(int i915)
>  {
> -	for_each_mmap_offset_type(i915, t) {
> -		struct drm_i915_gem_mmap_offset mmap_arg = {
> -			.flags = t->type
> -		};
> -		int A = gem_reopen_driver(i915);
> -		int B = gem_reopen_driver(i915);
> -		uint64_t offset_a, offset_b;
> -		uint32_t a, b;
> -		void *ptr;
> -
> -		a = gem_create(A, 4096);
> -		b = gem_open(B, gem_flink(A, a));
> -
> -		mmap_arg.handle = a;
> -		if (mmap_offset_ioctl(A, &mmap_arg)) {
> -			close(A);
> -			close(B);
> -			continue;
> -		}
> -		offset_a = mmap_arg.offset;
> -
> -		mmap_arg.handle = b;
> -		igt_assert_eq(mmap_offset_ioctl(B, &mmap_arg), 0);
> -		offset_b = mmap_arg.offset;
> -
> -		igt_info("A[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
> -			 t->name, A, a, offset_a);
> -		igt_info("B[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
> -			 t->name, B, b, offset_b);
> +	for_each_memory_region(r, i915) {
> +		igt_info("%s\n", r->name);
> +		for_each_mmap_offset_type(i915, t) {
> +			struct drm_i915_gem_mmap_offset mmap_arg = {
> +				.flags = t->type
> +			};
> +			int A = gem_reopen_driver(i915);
> +			int B = gem_reopen_driver(i915);
> +			uint64_t offset_a, offset_b;
> +			uint32_t a, b;
> +			void *ptr;
> +
> +			a = gem_create_in_memory_region_list(A, 4096, 0, &r->ci, 1);
> +			b = gem_open(B, gem_flink(A, a));
> +
> +			mmap_arg.handle = a;
> +			if (mmap_offset_ioctl(A, &mmap_arg)) {
> +				close(A);
> +				close(B);
> +				continue;
> +			}
> +			offset_a = mmap_arg.offset;
>  
> -		errno = 0;
> -		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_a);
> -		igt_assert(ptr == MAP_FAILED);
> -		igt_assert_eq(errno, EACCES);
> +			mmap_arg.handle = b;
> +			igt_assert_eq(mmap_offset_ioctl(B, &mmap_arg), 0);
> +			offset_b = mmap_arg.offset;
>  
> -		errno = 0;
> -		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_b);
> -		igt_assert(ptr == MAP_FAILED);
> -		igt_assert_eq(errno, EACCES);
> +			igt_info("\tA[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
> +				 t->name, A, a, offset_a);
> +			igt_info("\tB[%s]: {fd:%d, handle:%d, offset:%"PRIx64"}\n",
> +				 t->name, B, b, offset_b);
>  
> -		if (offset_a != offset_b) {
>  			errno = 0;
> -			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
> +			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_a);
>  			igt_assert(ptr == MAP_FAILED);
>  			igt_assert_eq(errno, EACCES);
>  
>  			errno = 0;
> -			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
> +			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, i915, offset_b);
>  			igt_assert(ptr == MAP_FAILED);
>  			igt_assert_eq(errno, EACCES);
> -		}
>  
> -		close(B);
> +			if (offset_a != offset_b) {
> +				errno = 0;
> +				ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
> +				igt_assert(ptr == MAP_FAILED);
> +				igt_assert_eq(errno, EACCES);
>  
> -		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
> -		igt_assert(ptr != MAP_FAILED);
> -		munmap(ptr, 4096);
> +				errno = 0;
> +				ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
> +				igt_assert(ptr == MAP_FAILED);
> +				igt_assert_eq(errno, EACCES);
> +			}
>  
> -		close(A);
> +			close(B);
> +
> +			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
> +			igt_assert(ptr != MAP_FAILED);
> +			munmap(ptr, 4096);
> +
> +			close(A);
>  
> -		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
> -		igt_assert(ptr == MAP_FAILED);
> +			ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_a);
> +			igt_assert(ptr == MAP_FAILED);
> +		}
>  	}
>  }
>  
> -- 
> 2.34.1
>

Looks good.

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew 

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

* Re: [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags
  2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
@ 2022-09-02  7:20   ` Zbigniew Kempczyński
  0 siblings, 0 replies; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02  7:20 UTC (permalink / raw)
  To: igt-dev

On Thu, Sep 01, 2022 at 01:44:31PM +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@linux.intel.com>
> 
> The kernel checks that the last byte of the object will fit inside the
> 32b GTT window unless the object is marked as being suitable for use
> with 48b addressing. However, the spinner only checked the start of the
> object which depending on the mix of size/alignment, could allow the
> object to straddle the 32b boundary and not be marked as 48b capable.
> 
> Always set 48b for all the objects where ppGTT merites.
> 
> In the process, there was one location where we failed to write the
> upper 32b of the address into the instruction.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> ---
>  lib/igt_dummyload.c | 63 ++++++++++++++++++++++-----------------------
>  1 file changed, 31 insertions(+), 32 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index dc1bd51e08..17ae21f567 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -100,12 +100,21 @@ emit_recursive_batch(igt_spin_t *spin,
>  	struct drm_i915_gem_execbuffer2 *execbuf;
>  	struct drm_i915_gem_exec_object2 *obj;
>  	unsigned int flags[GEM_MAX_ENGINES];
> +	unsigned int objflags = 0;
>  	unsigned int nengine;
>  	int fence_fd = -1;
> -	uint64_t addr, addr_scratch, ahnd = opts->ahnd, objflags = 0;
> +	uint64_t addr, addr_scratch, ahnd = opts->ahnd;
>  	uint32_t *cs;
>  	int i;
>  
> +	igt_assert(!(opts->ctx && opts->ctx_id));
> +
> +	r = memset(relocs, 0, sizeof(relocs));
> +	execbuf = memset(&spin->execbuf, 0, sizeof(spin->execbuf));
> +	execbuf->rsvd1 = opts->ctx ? opts->ctx->id : opts->ctx_id;
> +	execbuf->flags = I915_EXEC_NO_RELOC;
> +	obj = memset(spin->obj, 0, sizeof(spin->obj));
> +
>  	/*
>  	 * Pick a random location for our spinner et al.
>  	 *
> @@ -121,8 +130,12 @@ emit_recursive_batch(igt_spin_t *spin,
>  	 * that wrap.
>  	 */
>  
> +	addr = gem_aperture_size(fd) / 2;
> +	if (addr >> 32)
> +		objflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> +
>  	if (!ahnd) {
> -		addr = gem_aperture_size(fd) / 2;
> +		addr /= 2;

Generally patch looks fine, with the exception above. I don't
understand why we're limiting offset to 1/4 of gtt. This mostly
affects old gens without ppgtt. For ppgtt with 48b it doesn't
care as we truncate to 1/2 of its size.

--
Zbigniew

>  		if (addr >> 31)
>  			addr = 1u << 31;
>  		addr += random() % addr / 2;
> @@ -131,8 +144,6 @@ emit_recursive_batch(igt_spin_t *spin,
>  		objflags |= EXEC_OBJECT_PINNED;
>  	}
>  
> -	igt_assert(!(opts->ctx && opts->ctx_id));
> -
>  	nengine = 0;
>  	if (opts->engine == ALL_ENGINES) {
>  		struct intel_execution_engine2 *engine;
> @@ -150,11 +161,6 @@ emit_recursive_batch(igt_spin_t *spin,
>  	}
>  	igt_require(nengine);
>  
> -	memset(relocs, 0, sizeof(relocs));
> -	execbuf = memset(&spin->execbuf, 0, sizeof(spin->execbuf));
> -	execbuf->flags = I915_EXEC_NO_RELOC;
> -	obj = memset(spin->obj, 0, sizeof(spin->obj));
> -
>  	obj[BATCH].handle =
>  		handle_create(fd, BATCH_SIZE, opts->flags, &spin->batch);
>  	if (!spin->batch) {
> @@ -175,9 +181,7 @@ emit_recursive_batch(igt_spin_t *spin,
>  							   BATCH_SIZE, 0,
>  							   ALLOC_STRATEGY_LOW_TO_HIGH);
>  	obj[BATCH].offset = CANONICAL(addr);
> -	obj[BATCH].flags |= objflags;
> -	if (obj[BATCH].offset >= (1ull << 32))
> -		obj[BATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> +	obj[BATCH].flags = objflags;
>  
>  	addr += BATCH_SIZE;
>  
> @@ -192,27 +196,23 @@ emit_recursive_batch(igt_spin_t *spin,
>  
>  		obj[SCRATCH].handle = opts->dependency;
>  		obj[SCRATCH].offset = CANONICAL(addr_scratch);
> -		obj[SCRATCH].flags |= objflags;
> -		if (obj[SCRATCH].offset >= (1ull << 32))
> -			obj[SCRATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> +		obj[SCRATCH].flags = objflags;
>  
>  		if (!(opts->flags & IGT_SPIN_SOFTDEP)) {
>  			obj[SCRATCH].flags |= EXEC_OBJECT_WRITE;
>  
>  			/* dummy write to dependency */
> -			r = &relocs[obj[BATCH].relocation_count++];
>  			r->presumed_offset = obj[SCRATCH].offset;
>  			r->target_handle = obj[SCRATCH].handle;
>  			r->offset = sizeof(uint32_t) * 1020;
>  			r->delta = 0;
>  			r->read_domains = I915_GEM_DOMAIN_RENDER;
>  			r->write_domain = I915_GEM_DOMAIN_RENDER;
> +			r++;
>  		}
>  
>  		execbuf->buffer_count++;
>  	} else if (opts->flags & IGT_SPIN_POLL_RUN) {
> -		r = &relocs[obj[BATCH].relocation_count++];
> -
>  		igt_assert(!opts->dependency);
>  
>  		if (gen == 4 || gen == 5) {
> @@ -244,6 +244,7 @@ emit_recursive_batch(igt_spin_t *spin,
>  								   ALLOC_STRATEGY_LOW_TO_HIGH);
>  		addr += 4096; /* guard page */
>  		obj[SCRATCH].offset = CANONICAL(addr);
> +		obj[SCRATCH].flags = objflags;
>  		addr += 4096;
>  
>  		igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);
> @@ -253,10 +254,6 @@ emit_recursive_batch(igt_spin_t *spin,
>  		r->offset = sizeof(uint32_t) * 1;
>  		r->delta = sizeof(uint32_t) * SPIN_POLL_START_IDX;
>  
> -		obj[SCRATCH].flags |= objflags;
> -		if (obj[SCRATCH].offset >= (1ull << 32))
> -			obj[SCRATCH].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> -
>  		*cs++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
>  
>  		if (gen >= 8) {
> @@ -274,6 +271,7 @@ emit_recursive_batch(igt_spin_t *spin,
>  		*cs++ = 1;
>  
>  		execbuf->buffer_count++;
> +		r++;
>  	}
>  
>  	spin->handle = obj[BATCH].handle;
> @@ -314,8 +312,6 @@ emit_recursive_batch(igt_spin_t *spin,
>  	 * no matter how they modify it (from either the GPU or CPU).
>  	 */
>  	if (gen >= 8) { /* arbitrary cutoff between ring/execlists submission */
> -		r = &relocs[obj[BATCH].relocation_count++];
> -
>  		/*
>  		 * On Sandybridge+ the comparison is a strict greater-than:
>  		 * if the value at spin->condition is greater than BB_END,
> @@ -334,15 +330,17 @@ emit_recursive_batch(igt_spin_t *spin,
>  		r->offset = (cs + 2 - spin->batch) * sizeof(*cs);
>  		r->read_domains = I915_GEM_DOMAIN_COMMAND;
>  		r->delta = (spin->condition - spin->batch) * sizeof(*cs);
> +		igt_assert(r->delta < 4096);
>  
>  		*cs++ = MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 2;
>  		*cs++ = MI_BATCH_BUFFER_END;
>  		*cs++ = r->presumed_offset + r->delta;
> -		*cs++ = 0;
> +		*cs++ = r->presumed_offset >> 32;
> +
> +		r++;
>  	}
>  
>  	/* recurse */
> -	r = &relocs[obj[BATCH].relocation_count++];
>  	r->target_handle = obj[BATCH].handle;
>  	r->presumed_offset = obj[BATCH].offset;
>  	r->offset = (cs + 1 - spin->batch) * sizeof(*cs);
> @@ -363,11 +361,10 @@ emit_recursive_batch(igt_spin_t *spin,
>  		*cs = r->presumed_offset + r->delta;
>  		cs++;
>  	}
> -	obj[BATCH].relocs_ptr = to_user_pointer(relocs);
> +	r++;
>  
>  	execbuf->buffers_ptr =
>  	       	to_user_pointer(obj + (2 - execbuf->buffer_count));
> -	execbuf->rsvd1 = opts->ctx ? opts->ctx->id : opts->ctx_id;
>  
>  	if (opts->flags & IGT_SPIN_FENCE_OUT)
>  		execbuf->flags |= I915_EXEC_FENCE_OUT;
> @@ -382,14 +379,16 @@ emit_recursive_batch(igt_spin_t *spin,
>  		execbuf->rsvd2 = opts->fence;
>  	}
>  
> +	/* For allocator we have to rid of relocation_count */
> +	if (!ahnd) {
> +		obj[BATCH].relocs_ptr = to_user_pointer(relocs);
> +		obj[BATCH].relocation_count = r - relocs;
> +	}
> +
>  	for (i = 0; i < nengine; i++) {
>  		execbuf->flags &= ~ENGINE_MASK;
>  		execbuf->flags |= flags[i];
>  
> -		/* For allocator we have to rid of relocation_count */
> -		for (int j = 0; j < ARRAY_SIZE(spin->obj) && ahnd; j++)
> -			spin->obj[j].relocation_count = 0;
> -
>  		gem_execbuf_wr(fd, execbuf);
>  
>  		if (opts->flags & IGT_SPIN_FENCE_OUT) {
> -- 
> 2.34.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  2022-09-01 17:58   ` Zbigniew Kempczyński
@ 2022-09-02  8:41     ` Petri Latvala
  2022-09-02 10:08       ` Zbigniew Kempczyński
  0 siblings, 1 reply; 29+ messages in thread
From: Petri Latvala @ 2022-09-02  8:41 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

On Thu, Sep 01, 2022 at 07:58:13PM +0200, Zbigniew Kempczyński wrote:
> On Thu, Sep 01, 2022 at 01:44:33PM +0200, Zbigniew Kempczyński wrote:
> > From: Chris Wilson <chris.p.wilson@linux.intel.com>
> > 
> > Don't treat OFFSET_FIXED as using DOMAIN_CPU [0], but give it an invalid
> > domain so we can avoid using in tests.
> 
> I915_GEM_DOMAIN_CPU == 1, so 
> > 
> > Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> > ---
> >  lib/i915/gem_mman.c          |  2 +-
> >  tests/i915/gem_mmap_offset.c | 12 ++++++++----
> >  2 files changed, 9 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > index aa9ac6f3d7..48e3f8c991 100644
> > --- a/lib/i915/gem_mman.c
> > +++ b/lib/i915/gem_mman.c
> > @@ -678,7 +678,7 @@ const struct mmap_offset mmap_offset_types[] = {
> >  	{ "wb", I915_MMAP_OFFSET_WB, I915_GEM_DOMAIN_CPU },
> >  	{ "wc", I915_MMAP_OFFSET_WC, I915_GEM_DOMAIN_WC },
> >  	{ "uc", I915_MMAP_OFFSET_UC, I915_GEM_DOMAIN_WC },
> > -	{ "fixed", I915_MMAP_OFFSET_FIXED, 0},
> > +	{ "fixed", I915_MMAP_OFFSET_FIXED, -1 },
> 
> this is not needed.
> 
> >  	{},
> >  };
> >  
> > diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> > index 5e6b19eb34..d1075c32eb 100644
> > --- a/tests/i915/gem_mmap_offset.c
> > +++ b/tests/i915/gem_mmap_offset.c
> > @@ -148,7 +148,8 @@ static void basic_uaf(int i915)
> >  		}
> >  
> >  		expected = calloc(obj_size, sizeof(*expected));
> > -		gem_set_domain(i915, handle, t->domain, 0);
> > +		if (t->domain != -1)
> 
> Just if (t->domain) is enough here.

But that does different things, doesn't it?


-- 
Petri Latvala


> 
> --
> Zbigniew
> 
> > +			gem_set_domain(i915, handle, t->domain, 0);
> >  		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
> >  			     "mmap(%s) not clear on gem_create()\n",
> >  			     t->name);
> > @@ -157,15 +158,18 @@ static void basic_uaf(int i915)
> >  		buf = calloc(obj_size, sizeof(*buf));
> >  		memset(buf + 1024, 0x01, 1024);
> >  		gem_write(i915, handle, 0, buf, obj_size);
> > -		gem_set_domain(i915, handle, t->domain, 0);
> > +		if (t->domain != -1)
> > +			gem_set_domain(i915, handle, t->domain, 0);
> >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> >  			     "mmap(%s) not coherent with gem_write()\n",
> >  			     t->name);
> >  
> > -		gem_set_domain(i915, handle, t->domain, t->domain);
> > +		if (t->domain != -1)
> > +			gem_set_domain(i915, handle, t->domain, t->domain);
> >  		memset(addr + 2048, 0xff, 1024);
> >  		gem_read(i915, handle, 0, buf, obj_size);
> > -		gem_set_domain(i915, handle, t->domain, 0);
> > +		if (t->domain != -1)
> > +			gem_set_domain(i915, handle, t->domain, 0);
> >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> >  			     "mmap(%s) not coherent with gem_read()\n",
> >  			     t->name);
> > -- 
> > 2.34.1
> > 

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

* Re: [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  2022-09-02  8:41     ` Petri Latvala
@ 2022-09-02 10:08       ` Zbigniew Kempczyński
  2022-09-02 11:46         ` Petri Latvala
  0 siblings, 1 reply; 29+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-02 10:08 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Fri, Sep 02, 2022 at 11:41:54AM +0300, Petri Latvala wrote:
> On Thu, Sep 01, 2022 at 07:58:13PM +0200, Zbigniew Kempczyński wrote:
> > On Thu, Sep 01, 2022 at 01:44:33PM +0200, Zbigniew Kempczyński wrote:
> > > From: Chris Wilson <chris.p.wilson@linux.intel.com>
> > > 
> > > Don't treat OFFSET_FIXED as using DOMAIN_CPU [0], but give it an invalid
> > > domain so we can avoid using in tests.
> > 
> > I915_GEM_DOMAIN_CPU == 1, so 
> > > 
> > > Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> > > ---
> > >  lib/i915/gem_mman.c          |  2 +-
> > >  tests/i915/gem_mmap_offset.c | 12 ++++++++----
> > >  2 files changed, 9 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > > index aa9ac6f3d7..48e3f8c991 100644
> > > --- a/lib/i915/gem_mman.c
> > > +++ b/lib/i915/gem_mman.c
> > > @@ -678,7 +678,7 @@ const struct mmap_offset mmap_offset_types[] = {
> > >  	{ "wb", I915_MMAP_OFFSET_WB, I915_GEM_DOMAIN_CPU },
> > >  	{ "wc", I915_MMAP_OFFSET_WC, I915_GEM_DOMAIN_WC },
> > >  	{ "uc", I915_MMAP_OFFSET_UC, I915_GEM_DOMAIN_WC },
> > > -	{ "fixed", I915_MMAP_OFFSET_FIXED, 0},
> > > +	{ "fixed", I915_MMAP_OFFSET_FIXED, -1 },
> > 
> > this is not needed.
> > 
> > >  	{},
> > >  };
> > >  
> > > diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> > > index 5e6b19eb34..d1075c32eb 100644
> > > --- a/tests/i915/gem_mmap_offset.c
> > > +++ b/tests/i915/gem_mmap_offset.c
> > > @@ -148,7 +148,8 @@ static void basic_uaf(int i915)
> > >  		}
> > >  
> > >  		expected = calloc(obj_size, sizeof(*expected));
> > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > +		if (t->domain != -1)
> > 
> > Just if (t->domain) is enough here.
> 
> But that does different things, doesn't it?

Each I915_GEM_DOMAIN_* > 0 so change to put -1 is not necessary
and zero is enough for 'fixed'.

I've dropped change in gem_mman.c adding conditional to gem_mmap_offset
only:

https://patchwork.freedesktop.org/patch/500885/?series=108022&rev=2

--
Zbigniew

> 
> 
> -- 
> Petri Latvala
> 
> 
> > 
> > --
> > Zbigniew
> > 
> > > +			gem_set_domain(i915, handle, t->domain, 0);
> > >  		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
> > >  			     "mmap(%s) not clear on gem_create()\n",
> > >  			     t->name);
> > > @@ -157,15 +158,18 @@ static void basic_uaf(int i915)
> > >  		buf = calloc(obj_size, sizeof(*buf));
> > >  		memset(buf + 1024, 0x01, 1024);
> > >  		gem_write(i915, handle, 0, buf, obj_size);
> > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > +		if (t->domain != -1)
> > > +			gem_set_domain(i915, handle, t->domain, 0);
> > >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> > >  			     "mmap(%s) not coherent with gem_write()\n",
> > >  			     t->name);
> > >  
> > > -		gem_set_domain(i915, handle, t->domain, t->domain);
> > > +		if (t->domain != -1)
> > > +			gem_set_domain(i915, handle, t->domain, t->domain);
> > >  		memset(addr + 2048, 0xff, 1024);
> > >  		gem_read(i915, handle, 0, buf, obj_size);
> > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > +		if (t->domain != -1)
> > > +			gem_set_domain(i915, handle, t->domain, 0);
> > >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> > >  			     "mmap(%s) not coherent with gem_read()\n",
> > >  			     t->name);
> > > -- 
> > > 2.34.1
> > > 

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

* [igt-dev] ✗ Fi.CI.IGT: failure for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests
  2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
                   ` (12 preceding siblings ...)
  2022-09-01 13:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Patchwork
@ 2022-09-02 10:16 ` Patchwork
  13 siblings, 0 replies; 29+ messages in thread
From: Patchwork @ 2022-09-02 10:16 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 45154 bytes --]

== Series Details ==

Series: Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests
URL   : https://patchwork.freedesktop.org/series/108022/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12061_full -> IGTPW_7720_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_7720_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_7720_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/index.html

Participating hosts (13 -> 10)
------------------------------

  Missing    (3): pig-skl-6260u pig-kbl-iris pig-glk-j5005 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@api_intel_allocator@fork-simple-stress-signal:
    - shard-tglb:         [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb6/igt@api_intel_allocator@fork-simple-stress-signal.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@api_intel_allocator@fork-simple-stress-signal.html

  * igt@gem_mmap_offset@close-race:
    - shard-glk:          [PASS][3] -> [FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk3/igt@gem_mmap_offset@close-race.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk5/igt@gem_mmap_offset@close-race.html

  * {igt@gem_mmap_offset@ptrace@lmem0-fixed} (NEW):
    - {shard-dg1}:        NOTRUN -> [FAIL][5]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-dg1-13/igt@gem_mmap_offset@ptrace@lmem0-fixed.html

  * igt@i915_pm_rpm@fences-dpms:
    - shard-iclb:         [PASS][6] -> [INCOMPLETE][7] +1 similar issue
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb1/igt@i915_pm_rpm@fences-dpms.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb7/igt@i915_pm_rpm@fences-dpms.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@kms_flip@flip-vs-suspend-interruptible@b-hdmi-a1:
    - {shard-tglu}:       NOTRUN -> [DMESG-WARN][8]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglu-6/igt@kms_flip@flip-vs-suspend-interruptible@b-hdmi-a1.html

  
New tests
---------

  New tests have been introduced between CI_DRM_12061_full and IGTPW_7720_full:

### New IGT tests (21) ###

  * igt@gem_create@busy-create@lmem0:
    - Statuses : 1 pass(s)
    - Exec time: [32.27] s

  * igt@gem_create@busy-create@smem0:
    - Statuses : 8 pass(s)
    - Exec time: [32.24, 32.27] s

  * igt@gem_create@create-clear@smem0:
    - Statuses : 5 pass(s)
    - Exec time: [32.55, 34.73] s

  * igt@gem_create@hog-create:
    - Statuses :
    - Exec time: [None] s

  * igt@gem_create@hog-create@lmem0:
    - Statuses : 1 pass(s)
    - Exec time: [32.27] s

  * igt@gem_create@hog-create@smem0:
    - Statuses : 8 pass(s)
    - Exec time: [32.24, 32.28] s

  * igt@gem_mmap_offset@clear@lmem0:
    - Statuses : 1 pass(s)
    - Exec time: [21.86] s

  * igt@gem_mmap_offset@clear@smem0:
    - Statuses : 7 pass(s)
    - Exec time: [22.16, 23.37] s

  * igt@gem_mmap_offset@perf:
    - Statuses :
    - Exec time: [None] s

  * igt@gem_mmap_offset@ptrace@lmem0-fixed:
    - Statuses : 1 fail(s)
    - Exec time: [0.09] s

  * igt@gem_mmap_offset@ptrace@smem0-fixed:
    - Statuses : 1 pass(s)
    - Exec time: [0.03] s

  * igt@gem_mmap_offset@ptrace@smem0-gtt:
    - Statuses : 6 pass(s)
    - Exec time: [0.02, 0.08] s

  * igt@gem_mmap_offset@ptrace@smem0-uc:
    - Statuses : 6 pass(s)
    - Exec time: [0.02, 0.07] s

  * igt@gem_mmap_offset@ptrace@smem0-wb:
    - Statuses : 6 pass(s)
    - Exec time: [0.02, 0.07] s

  * igt@gem_mmap_offset@ptrace@smem0-wc:
    - Statuses : 6 pass(s)
    - Exec time: [0.02, 0.07] s

  * igt@gem_softpin@allocator-evict:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@gem_softpin@allocator-evict@bcs0:
    - Statuses : 6 pass(s)
    - Exec time: [22.97, 43.04] s

  * igt@gem_softpin@allocator-evict@rcs0:
    - Statuses : 6 pass(s)
    - Exec time: [23.12, 36.29] s

  * igt@gem_softpin@allocator-evict@vcs0:
    - Statuses : 6 pass(s)
    - Exec time: [22.81, 37.27] s

  * igt@gem_softpin@allocator-evict@vcs1:
    - Statuses : 2 pass(s)
    - Exec time: [23.12, 23.90] s

  * igt@gem_softpin@allocator-evict@vecs0:
    - Statuses : 6 pass(s)
    - Exec time: [23.09, 37.99] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_persistence@engines-hostile:
    - shard-snb:          NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#1099])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-snb5/igt@gem_ctx_persistence@engines-hostile.html

  * igt@gem_eio@kms:
    - shard-tglb:         [PASS][10] -> [FAIL][11] ([i915#5784])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb7/igt@gem_eio@kms.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb2/igt@gem_eio@kms.html

  * igt@gem_exec_balancer@parallel:
    - shard-iclb:         [PASS][12] -> [SKIP][13] ([i915#4525]) +1 similar issue
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb2/igt@gem_exec_balancer@parallel.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb3/igt@gem_exec_balancer@parallel.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-glk:          [PASS][14] -> [FAIL][15] ([i915#2842])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk9/igt@gem_exec_fair@basic-none-share@rcs0.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk2/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [PASS][16] -> [FAIL][17] ([i915#2842])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_params@rsvd2-dirt:
    - shard-iclb:         NOTRUN -> [SKIP][18] ([fdo#109283])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb7/igt@gem_exec_params@rsvd2-dirt.html
    - shard-tglb:         NOTRUN -> [SKIP][19] ([fdo#109283])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb2/igt@gem_exec_params@rsvd2-dirt.html

  * igt@gem_exec_suspend@basic-s3@smem:
    - shard-apl:          [PASS][20] -> [DMESG-WARN][21] ([i915#180]) +3 similar issues
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl3/igt@gem_exec_suspend@basic-s3@smem.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@gem_lmem_swapping@parallel-random-verify-ccs:
    - shard-apl:          NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#4613]) +3 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl3/igt@gem_lmem_swapping@parallel-random-verify-ccs.html

  * igt@gem_lmem_swapping@verify:
    - shard-iclb:         NOTRUN -> [SKIP][23] ([i915#4613])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@gem_lmem_swapping@verify.html
    - shard-tglb:         NOTRUN -> [SKIP][24] ([i915#4613])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@gem_lmem_swapping@verify.html
    - shard-glk:          NOTRUN -> [SKIP][25] ([fdo#109271] / [i915#4613])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk3/igt@gem_lmem_swapping@verify.html

  * igt@gem_pxp@reject-modify-context-protection-off-2:
    - shard-iclb:         NOTRUN -> [SKIP][26] ([i915#4270])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@gem_pxp@reject-modify-context-protection-off-2.html
    - shard-tglb:         NOTRUN -> [SKIP][27] ([i915#4270])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@gem_pxp@reject-modify-context-protection-off-2.html

  * igt@gem_render_copy@yf-tiled-to-vebox-x-tiled:
    - shard-iclb:         NOTRUN -> [SKIP][28] ([i915#768])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb2/igt@gem_render_copy@yf-tiled-to-vebox-x-tiled.html

  * igt@gem_userptr_blits@access-control:
    - shard-glk:          NOTRUN -> [SKIP][29] ([fdo#109271]) +47 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk9/igt@gem_userptr_blits@access-control.html
    - shard-iclb:         NOTRUN -> [SKIP][30] ([i915#3297])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@gem_userptr_blits@access-control.html
    - shard-tglb:         NOTRUN -> [SKIP][31] ([i915#3297])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@gem_userptr_blits@access-control.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-apl:          NOTRUN -> [SKIP][32] ([fdo#109271] / [i915#3323])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl8/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][33] -> [FAIL][34] ([i915#454])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb5/igt@i915_pm_dc@dc6-psr.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb7/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_dc@dc9-dpms:
    - shard-apl:          [PASS][35] -> [SKIP][36] ([fdo#109271])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl3/igt@i915_pm_dc@dc9-dpms.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl6/igt@i915_pm_dc@dc9-dpms.html

  * igt@kms_addfb_basic@invalid-smem-bo-on-discrete:
    - shard-tglb:         NOTRUN -> [SKIP][37] ([i915#3826])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@kms_addfb_basic@invalid-smem-bo-on-discrete.html
    - shard-iclb:         NOTRUN -> [SKIP][38] ([i915#3826])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb7/igt@kms_addfb_basic@invalid-smem-bo-on-discrete.html

  * igt@kms_big_fb@4-tiled-32bpp-rotate-180:
    - shard-iclb:         NOTRUN -> [SKIP][39] ([i915#5286]) +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_big_fb@4-tiled-32bpp-rotate-180.html

  * igt@kms_big_fb@4-tiled-8bpp-rotate-180:
    - shard-tglb:         NOTRUN -> [SKIP][40] ([i915#5286]) +2 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@kms_big_fb@4-tiled-8bpp-rotate-180.html

  * igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-180-async-flip:
    - shard-apl:          NOTRUN -> [SKIP][41] ([fdo#109271]) +146 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl7/igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html

  * igt@kms_big_fb@x-tiled-16bpp-rotate-90:
    - shard-tglb:         NOTRUN -> [SKIP][42] ([fdo#111614])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@kms_big_fb@x-tiled-16bpp-rotate-90.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0:
    - shard-tglb:         NOTRUN -> [SKIP][43] ([fdo#111615]) +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip:
    - shard-iclb:         NOTRUN -> [SKIP][44] ([fdo#110723])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip.html

  * igt@kms_big_joiner@basic:
    - shard-iclb:         NOTRUN -> [SKIP][45] ([i915#2705])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_big_joiner@basic.html
    - shard-tglb:         NOTRUN -> [SKIP][46] ([i915#2705])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@kms_big_joiner@basic.html

  * igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - shard-glk:          NOTRUN -> [SKIP][47] ([fdo#109271] / [i915#3886])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk1/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-bad-rotation-90-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][48] ([i915#6095]) +2 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@kms_ccs@pipe-b-bad-rotation-90-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - shard-apl:          NOTRUN -> [SKIP][49] ([fdo#109271] / [i915#3886]) +5 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl6/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-crc-sprite-planes-basic-yf_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][50] ([fdo#111615] / [i915#3689]) +1 similar issue
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-yf_tiled_ccs.html

  * igt@kms_ccs@pipe-c-bad-pixel-format-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][51] ([i915#3689] / [i915#6095]) +1 similar issue
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@kms_ccs@pipe-c-bad-pixel-format-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-bad-rotation-90-4_tiled_dg2_mc_ccs:
    - shard-iclb:         NOTRUN -> [SKIP][52] ([fdo#109278]) +6 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_ccs@pipe-c-bad-rotation-90-4_tiled_dg2_mc_ccs.html

  * igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][53] ([i915#3689]) +2 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_ccs.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - shard-apl:          NOTRUN -> [SKIP][54] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl6/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_chamelium@hdmi-cmp-planar-formats:
    - shard-iclb:         NOTRUN -> [SKIP][55] ([fdo#109284] / [fdo#111827]) +1 similar issue
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_chamelium@hdmi-cmp-planar-formats.html
    - shard-tglb:         NOTRUN -> [SKIP][56] ([fdo#109284] / [fdo#111827]) +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@kms_chamelium@hdmi-cmp-planar-formats.html
    - shard-glk:          NOTRUN -> [SKIP][57] ([fdo#109271] / [fdo#111827]) +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk3/igt@kms_chamelium@hdmi-cmp-planar-formats.html

  * igt@kms_chamelium@hdmi-crc-nonplanar-formats:
    - shard-snb:          NOTRUN -> [SKIP][58] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-snb6/igt@kms_chamelium@hdmi-crc-nonplanar-formats.html

  * igt@kms_content_protection@dp-mst-type-1:
    - shard-tglb:         NOTRUN -> [SKIP][59] ([i915#3116] / [i915#3299])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@kms_content_protection@dp-mst-type-1.html
    - shard-iclb:         NOTRUN -> [SKIP][60] ([i915#3116])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_content_protection@dp-mst-type-1.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
    - shard-glk:          [PASS][61] -> [FAIL][62] ([i915#2346])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk7/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk5/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html

  * igt@kms_draw_crc@draw-method-rgb565-blt-4tiled:
    - shard-tglb:         NOTRUN -> [SKIP][63] ([i915#5287])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@kms_draw_crc@draw-method-rgb565-blt-4tiled.html
    - shard-iclb:         NOTRUN -> [SKIP][64] ([i915#5287])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_draw_crc@draw-method-rgb565-blt-4tiled.html

  * igt@kms_flip@2x-flip-vs-panning-vs-hang:
    - shard-tglb:         NOTRUN -> [SKIP][65] ([fdo#109274] / [fdo#111825] / [i915#3637]) +2 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb3/igt@kms_flip@2x-flip-vs-panning-vs-hang.html

  * igt@kms_flip@2x-flip-vs-rmfb-interruptible:
    - shard-iclb:         NOTRUN -> [SKIP][66] ([fdo#109274]) +2 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_flip@2x-flip-vs-rmfb-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-dp1:
    - shard-apl:          [PASS][67] -> [FAIL][68] ([i915#79])
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl8/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-dp1.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl1/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-dp1.html

  * igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a2:
    - shard-glk:          [PASS][69] -> [FAIL][70] ([i915#79])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk3/igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a2.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk5/igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a2.html

  * igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode:
    - shard-iclb:         NOTRUN -> [SKIP][71] ([i915#2672]) +6 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode.html
    - shard-tglb:         NOTRUN -> [SKIP][72] ([i915#2672])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-pwrite:
    - shard-iclb:         NOTRUN -> [SKIP][73] ([fdo#109280]) +9 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb6/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-tglb:         NOTRUN -> [SKIP][74] ([i915#6497]) +3 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-cpu.html

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-shrfb-draw-blt:
    - shard-tglb:         NOTRUN -> [SKIP][75] ([fdo#109280] / [fdo#111825]) +10 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-shrfb-draw-blt.html

  * igt@kms_pipe_b_c_ivb@pipe-b-double-modeset-then-modeset-pipe-c:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([fdo#109289])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_pipe_b_c_ivb@pipe-b-double-modeset-then-modeset-pipe-c.html
    - shard-tglb:         NOTRUN -> [SKIP][77] ([fdo#109289])
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@kms_pipe_b_c_ivb@pipe-b-double-modeset-then-modeset-pipe-c.html

  * igt@kms_plane_lowres@tiling-yf:
    - shard-tglb:         NOTRUN -> [SKIP][78] ([fdo#112054])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@kms_plane_lowres@tiling-yf.html

  * igt@kms_plane_lowres@tiling-yf@pipe-b-edp-1:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([i915#3536]) +2 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb1/igt@kms_plane_lowres@tiling-yf@pipe-b-edp-1.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area:
    - shard-apl:          NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#658]) +1 similar issue
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl7/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html
    - shard-tglb:         NOTRUN -> [SKIP][81] ([i915#2920])
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html
    - shard-glk:          NOTRUN -> [SKIP][82] ([fdo#109271] / [i915#658]) +2 similar issues
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk3/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html
    - shard-iclb:         NOTRUN -> [SKIP][83] ([fdo#111068] / [i915#658])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb8/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html

  * igt@kms_psr2_su@page_flip-p010:
    - shard-tglb:         NOTRUN -> [SKIP][84] ([i915#1911]) +1 similar issue
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb2/igt@kms_psr2_su@page_flip-p010.html

  * igt@kms_psr2_su@page_flip-xrgb8888:
    - shard-iclb:         NOTRUN -> [SKIP][85] ([fdo#109642] / [fdo#111068] / [i915#658]) +1 similar issue
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb3/igt@kms_psr2_su@page_flip-xrgb8888.html

  * igt@kms_psr@psr2_cursor_blt:
    - shard-iclb:         [PASS][86] -> [SKIP][87] ([fdo#109441]) +3 similar issues
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb6/igt@kms_psr@psr2_cursor_blt.html

  * igt@kms_setmode@clone-exclusive-crtc:
    - shard-tglb:         NOTRUN -> [SKIP][88] ([i915#3555])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb2/igt@kms_setmode@clone-exclusive-crtc.html
    - shard-iclb:         NOTRUN -> [SKIP][89] ([i915#3555]) +1 similar issue
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_setmode@clone-exclusive-crtc.html

  * igt@kms_vblank@pipe-c-query-busy-hang:
    - shard-snb:          NOTRUN -> [SKIP][90] ([fdo#109271]) +160 similar issues
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-snb5/igt@kms_vblank@pipe-c-query-busy-hang.html

  * igt@nouveau_crc@pipe-d-ctx-flip-skip-current-frame:
    - shard-iclb:         NOTRUN -> [SKIP][91] ([fdo#109278] / [i915#2530])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@nouveau_crc@pipe-d-ctx-flip-skip-current-frame.html
    - shard-tglb:         NOTRUN -> [SKIP][92] ([i915#2530])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb6/igt@nouveau_crc@pipe-d-ctx-flip-skip-current-frame.html

  * igt@prime_nv_test@nv_i915_sharing:
    - shard-tglb:         NOTRUN -> [SKIP][93] ([fdo#109291])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb7/igt@prime_nv_test@nv_i915_sharing.html
    - shard-iclb:         NOTRUN -> [SKIP][94] ([fdo#109291])
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb1/igt@prime_nv_test@nv_i915_sharing.html

  * igt@sysfs_clients@split-50:
    - shard-apl:          NOTRUN -> [SKIP][95] ([fdo#109271] / [i915#2994]) +1 similar issue
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl1/igt@sysfs_clients@split-50.html

  
#### Possible fixes ####

  * igt@gem_ctx_exec@basic-nohangcheck:
    - shard-tglb:         [FAIL][96] ([i915#6268]) -> [PASS][97]
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb3/igt@gem_ctx_exec@basic-nohangcheck.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb2/igt@gem_ctx_exec@basic-nohangcheck.html

  * igt@gem_ctx_persistence@engines-hang@vcs1:
    - {shard-dg1}:        [FAIL][98] ([i915#4883]) -> [PASS][99]
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-dg1-13/igt@gem_ctx_persistence@engines-hang@vcs1.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-dg1-13/igt@gem_ctx_persistence@engines-hang@vcs1.html

  * igt@gem_eio@unwedge-stress:
    - {shard-dg1}:        [FAIL][100] ([i915#5784]) -> [PASS][101] +1 similar issue
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-dg1-18/igt@gem_eio@unwedge-stress.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-dg1-13/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_balancer@parallel-keep-in-fence:
    - shard-iclb:         [SKIP][102] ([i915#4525]) -> [PASS][103]
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb8/igt@gem_exec_balancer@parallel-keep-in-fence.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb2/igt@gem_exec_balancer@parallel-keep-in-fence.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-glk:          [FAIL][104] ([i915#2842]) -> [PASS][105] +1 similar issue
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk9/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_reloc@basic-cpu-gtt:
    - {shard-rkl}:        [SKIP][106] ([i915#3281]) -> [PASS][107] +2 similar issues
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-rkl-1/igt@gem_exec_reloc@basic-cpu-gtt.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-rkl-5/igt@gem_exec_reloc@basic-cpu-gtt.html

  * igt@gem_huc_copy@huc-copy:
    - shard-tglb:         [SKIP][108] ([i915#2190]) -> [PASS][109]
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb6/igt@gem_huc_copy@huc-copy.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb5/igt@gem_huc_copy@huc-copy.html

  * igt@gem_madvise@dontneed-before-pwrite:
    - {shard-rkl}:        [SKIP][110] ([i915#3282]) -> [PASS][111] +2 similar issues
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-rkl-2/igt@gem_madvise@dontneed-before-pwrite.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-rkl-5/igt@gem_madvise@dontneed-before-pwrite.html

  * igt@gem_userptr_blits@sync-unmap-cycles:
    - shard-snb:          [INCOMPLETE][112] ([i915#3297]) -> [PASS][113]
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-snb5/igt@gem_userptr_blits@sync-unmap-cycles.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-snb4/igt@gem_userptr_blits@sync-unmap-cycles.html

  * igt@gen9_exec_parse@basic-rejected:
    - {shard-rkl}:        [SKIP][114] ([i915#2527]) -> [PASS][115] +2 similar issues
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-rkl-2/igt@gen9_exec_parse@basic-rejected.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-rkl-5/igt@gen9_exec_parse@basic-rejected.html

  * igt@i915_pm_dc@dc5-psr:
    - shard-tglb:         [FAIL][116] ([i915#3989]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-tglb6/igt@i915_pm_dc@dc5-psr.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-tglb1/igt@i915_pm_dc@dc5-psr.html

  * igt@i915_selftest@live@gt_heartbeat:
    - shard-apl:          [DMESG-FAIL][118] ([i915#5334]) -> [PASS][119]
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl8/igt@i915_selftest@live@gt_heartbeat.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl2/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1:
    - shard-glk:          [FAIL][120] ([i915#2521]) -> [PASS][121]
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk1/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk9/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1.html

  * igt@kms_big_fb@linear-16bpp-rotate-0:
    - shard-glk:          [FAIL][122] ([i915#1888]) -> [PASS][123]
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk7/igt@kms_big_fb@linear-16bpp-rotate-0.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk2/igt@kms_big_fb@linear-16bpp-rotate-0.html

  * igt@kms_flip@flip-vs-suspend@c-dp1:
    - shard-apl:          [DMESG-WARN][124] ([i915#180]) -> [PASS][125] +2 similar issues
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl2/igt@kms_flip@flip-vs-suspend@c-dp1.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl7/igt@kms_flip@flip-vs-suspend@c-dp1.html

  * igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1:
    - shard-apl:          [FAIL][126] ([i915#1188]) -> [PASS][127]
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-apl8/igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-apl1/igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1.html

  * igt@kms_psr@psr2_primary_blt:
    - shard-iclb:         [SKIP][128] ([fdo#109441]) -> [PASS][129] +3 similar issues
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb5/igt@kms_psr@psr2_primary_blt.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb2/igt@kms_psr@psr2_primary_blt.html

  * igt@kms_rotation_crc@sprite-rotation-180:
    - shard-glk:          [FAIL][130] ([i915#1888] / [i915#5852]) -> [PASS][131]
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-glk5/igt@kms_rotation_crc@sprite-rotation-180.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-glk7/igt@kms_rotation_crc@sprite-rotation-180.html

  * igt@perf_pmu@busy-double-start@vcs0:
    - {shard-dg1}:        [FAIL][132] ([i915#4349]) -> [PASS][133] +1 similar issue
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-dg1-15/igt@perf_pmu@busy-double-start@vcs0.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-dg1-19/igt@perf_pmu@busy-double-start@vcs0.html

  * igt@prime_vgem@coherency-gtt:
    - {shard-rkl}:        [SKIP][134] ([fdo#109295] / [fdo#111656] / [i915#3708]) -> [PASS][135]
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-rkl-1/igt@prime_vgem@coherency-gtt.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-rkl-5/igt@prime_vgem@coherency-gtt.html

  
#### Warnings ####

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf:
    - shard-iclb:         [SKIP][136] ([i915#658]) -> [SKIP][137] ([i915#2920]) +1 similar issue
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb5/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb2/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
    - shard-iclb:         [SKIP][138] ([i915#2920]) -> [SKIP][139] ([fdo#111068] / [i915#658])
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb5/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area:
    - shard-iclb:         [SKIP][140] ([fdo#111068] / [i915#658]) -> [SKIP][141] ([i915#2920])
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12061/shard-iclb6/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/shard-iclb2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [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#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
  [fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
  [fdo#109314]: https://bugs.freedesktop.org/show_bug.cgi?id=109314
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111314]: https://bugs.freedesktop.org/show_bug.cgi?id=111314
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
  [i915#1063]: https://gitlab.freedesktop.org/drm/intel/issues/1063
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1722]: https://gitlab.freedesktop.org/drm/intel/issues/1722
  [i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
  [i915#1911]: https://gitlab.freedesktop.org/drm/intel/issues/1911
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2410]: https://gitlab.freedesktop.org/drm/intel/issues/2410
  [i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
  [i915#2435]: https://gitlab.freedesktop.org/drm/intel/issues/2435
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2530]: https://gitlab.freedesktop.org/drm/intel/issues/2530
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3376]: https://gitlab.freedesktop.org/drm/intel/issues/3376
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
  [i915#3536]: https://gitlab.freedesktop.org/drm/intel/issues/3536
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3692]: https://gitlab.freedesktop.org/drm/intel/issues/3692
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
  [i915#3826]: https://gitlab.freedesktop.org/drm/intel/issues/3826
  [i915#3828]: https://gitlab.freedesktop.org/drm/intel/issues/3828
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3938]: https://gitlab.freedesktop.org/drm/intel/issues/3938
  [i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
  [i915#4016]: https://gitlab.freedesktop.org/drm/intel/issues/4016
  [i915#4036]: https://gitlab.freedesktop.org/drm/intel/issues/4036
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4171]: https://gitlab.freedesktop.org/drm/intel/issues/4171
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#433]: https://gitlab.freedesktop.org/drm/intel/issues/433
  [i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
  [i915#4369]: https://gitlab.freedesktop.org/drm/intel/issues/4369
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4494]: https://gitlab.freedesktop.org/drm/intel/issues/4494
  [i915#4521]: https://gitlab.freedesktop.org/drm/intel/issues/4521
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4853]: https://gitlab.freedesktop.org/drm/intel/issues/4853
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4877]: https://gitlab.freedesktop.org/drm/intel/issues/4877
  [i915#4883]: https://gitlab.freedesktop.org/drm/intel/issues/4883
  [i915#4893]: https://gitlab.freedesktop.org/drm/intel/issues/4893
  [i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5182]: https://gitlab.freedesktop.org/drm/intel/issues/5182
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5287]: https://gitlab.freedesktop.org/drm/intel/issues/5287
  [i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
  [i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#5852]: https://gitlab.freedesktop.org/drm/intel/issues/5852
  [i915#5982]: https://gitlab.freedesktop.org/drm/intel/issues/5982
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6117]: https://gitlab.freedesktop.org/drm/intel/issues/6117
  [i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
  [i915#6247]: https://gitlab.freedesktop.org/drm/intel/issues/6247
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
  [i915#6259]: https://gitlab.freedesktop.org/drm/intel/issues/6259
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6331]: https://gitlab.freedesktop.org/drm/intel/issues/6331
  [i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
  [i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
  [i915#6412]: https://gitlab.freedesktop.org/drm/intel/issues/6412
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#6448]: https://gitlab.freedesktop.org/drm/intel/issues/6448
  [i915#6463]: https://gitlab.freedesktop.org/drm/intel/issues/6463
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
  [i915#6599]: https://gitlab.freedesktop.org/drm/intel/issues/6599
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#768]: https://gitlab.freedesktop.org/drm/intel/issues/768
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6639 -> IGTPW_7720
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_12061: d25f068998ce803ef0a05883616344c0afcbc55a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7720: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/index.html
  IGT_6639: ba61c48dba71d5597d7297a07dc3e307665f961b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7720/index.html

[-- Attachment #2: Type: text/html, Size: 45601 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain
  2022-09-02 10:08       ` Zbigniew Kempczyński
@ 2022-09-02 11:46         ` Petri Latvala
  0 siblings, 0 replies; 29+ messages in thread
From: Petri Latvala @ 2022-09-02 11:46 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

On Fri, Sep 02, 2022 at 12:08:16PM +0200, Zbigniew Kempczyński wrote:
> On Fri, Sep 02, 2022 at 11:41:54AM +0300, Petri Latvala wrote:
> > On Thu, Sep 01, 2022 at 07:58:13PM +0200, Zbigniew Kempczyński wrote:
> > > On Thu, Sep 01, 2022 at 01:44:33PM +0200, Zbigniew Kempczyński wrote:
> > > > From: Chris Wilson <chris.p.wilson@linux.intel.com>
> > > > 
> > > > Don't treat OFFSET_FIXED as using DOMAIN_CPU [0], but give it an invalid
> > > > domain so we can avoid using in tests.
> > > 
> > > I915_GEM_DOMAIN_CPU == 1, so 
> > > > 
> > > > Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> > > > ---
> > > >  lib/i915/gem_mman.c          |  2 +-
> > > >  tests/i915/gem_mmap_offset.c | 12 ++++++++----
> > > >  2 files changed, 9 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > > > index aa9ac6f3d7..48e3f8c991 100644
> > > > --- a/lib/i915/gem_mman.c
> > > > +++ b/lib/i915/gem_mman.c
> > > > @@ -678,7 +678,7 @@ const struct mmap_offset mmap_offset_types[] = {
> > > >  	{ "wb", I915_MMAP_OFFSET_WB, I915_GEM_DOMAIN_CPU },
> > > >  	{ "wc", I915_MMAP_OFFSET_WC, I915_GEM_DOMAIN_WC },
> > > >  	{ "uc", I915_MMAP_OFFSET_UC, I915_GEM_DOMAIN_WC },
> > > > -	{ "fixed", I915_MMAP_OFFSET_FIXED, 0},
> > > > +	{ "fixed", I915_MMAP_OFFSET_FIXED, -1 },
> > > 
> > > this is not needed.
> > > 
> > > >  	{},
> > > >  };
> > > >  
> > > > diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> > > > index 5e6b19eb34..d1075c32eb 100644
> > > > --- a/tests/i915/gem_mmap_offset.c
> > > > +++ b/tests/i915/gem_mmap_offset.c
> > > > @@ -148,7 +148,8 @@ static void basic_uaf(int i915)
> > > >  		}
> > > >  
> > > >  		expected = calloc(obj_size, sizeof(*expected));
> > > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > > +		if (t->domain != -1)
> > > 
> > > Just if (t->domain) is enough here.
> > 
> > But that does different things, doesn't it?
> 
> Each I915_GEM_DOMAIN_* > 0 so change to put -1 is not necessary
> and zero is enough for 'fixed'.

Ah, so t->domain can never be -1?


-- 
Petri Latvala





> 
> I've dropped change in gem_mman.c adding conditional to gem_mmap_offset
> only:
> 
> https://patchwork.freedesktop.org/patch/500885/?series=108022&rev=2
> 
> --
> Zbigniew
> 
> > 
> > 
> > -- 
> > Petri Latvala
> > 
> > 
> > > 
> > > --
> > > Zbigniew
> > > 
> > > > +			gem_set_domain(i915, handle, t->domain, 0);
> > > >  		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
> > > >  			     "mmap(%s) not clear on gem_create()\n",
> > > >  			     t->name);
> > > > @@ -157,15 +158,18 @@ static void basic_uaf(int i915)
> > > >  		buf = calloc(obj_size, sizeof(*buf));
> > > >  		memset(buf + 1024, 0x01, 1024);
> > > >  		gem_write(i915, handle, 0, buf, obj_size);
> > > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > > +		if (t->domain != -1)
> > > > +			gem_set_domain(i915, handle, t->domain, 0);
> > > >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> > > >  			     "mmap(%s) not coherent with gem_write()\n",
> > > >  			     t->name);
> > > >  
> > > > -		gem_set_domain(i915, handle, t->domain, t->domain);
> > > > +		if (t->domain != -1)
> > > > +			gem_set_domain(i915, handle, t->domain, t->domain);
> > > >  		memset(addr + 2048, 0xff, 1024);
> > > >  		gem_read(i915, handle, 0, buf, obj_size);
> > > > -		gem_set_domain(i915, handle, t->domain, 0);
> > > > +		if (t->domain != -1)
> > > > +			gem_set_domain(i915, handle, t->domain, 0);
> > > >  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
> > > >  			     "mmap(%s) not coherent with gem_read()\n",
> > > >  			     t->name);
> > > > -- 
> > > > 2.34.1
> > > > 

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

* Re: [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps
  2022-09-02  3:59   ` Zbigniew Kempczyński
@ 2022-09-20 12:49     ` Petri Latvala
  0 siblings, 0 replies; 29+ messages in thread
From: Petri Latvala @ 2022-09-20 12:49 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

On Fri, Sep 02, 2022 at 05:59:47AM +0200, Zbigniew Kempczyński wrote:
> On Thu, Sep 01, 2022 at 01:44:42PM +0200, Zbigniew Kempczyński wrote:
> > From: Chris Wilson <chris.p.wilson@intel.com>
> > 
> > Compare the read/write performance of different mmap types to different
> > memory regions.
> >
> 
> +Petri - please decide can we merge this.
> 
> This tests performance only but execution time < 1s so I got no problem
> with this (it may be handy in the future for debugging purposes).
> 
> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Ideally tests that don't test should be in benchmarks/ instead. Having
this immediately in benchmarks looks ideal but surely we could use
some numbers from all platforms, and currently that only happens if
this is in tests/.

For merging this:
Acked-by: Petri Latvala <petri.latvala@intel.com>

In the future this should be moved to benchmarks but CI changes are
needed to actually start running them on the regular. I spoke with
Kamil to get that road planned out.


-- 
Petri Latvala

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

end of thread, other threads:[~2022-09-20 12:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 11:44 [igt-dev] [PATCH i-g-t 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
2022-09-02  7:20   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 02/12] lib/i915: Mark gem_create as handling const memory regions Zbigniew Kempczyński
2022-09-01 17:53   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 03/12] lib/i915: Distinguish I915_MMAP_OFFSET_FIXED with an invalid domain Zbigniew Kempczyński
2022-09-01 17:58   ` Zbigniew Kempczyński
2022-09-02  8:41     ` Petri Latvala
2022-09-02 10:08       ` Zbigniew Kempczyński
2022-09-02 11:46         ` Petri Latvala
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 04/12] i915/gem_create: Verify all regions return cleared objects Zbigniew Kempczyński
2022-09-01 18:36   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 05/12] i915/gem_create: Stress creation with busy engines Zbigniew Kempczyński
2022-09-02  3:36   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on cration Zbigniew Kempczyński
2022-09-02  3:42   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 07/12] i915/gem_mmap_offset: Verify all regions with ptrace Zbigniew Kempczyński
2022-09-02  3:46   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation Zbigniew Kempczyński
2022-09-02  6:25   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 09/12] i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects Zbigniew Kempczyński
2022-09-02  3:50   ` Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 11/12] i915/gem_mmap_offset: Exercise close race against all types/regions Zbigniew Kempczyński
2022-09-01 11:44 ` [igt-dev] [PATCH i-g-t 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps Zbigniew Kempczyński
2022-09-02  3:59   ` Zbigniew Kempczyński
2022-09-20 12:49     ` Petri Latvala
2022-09-01 13:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Patchwork
2022-09-02 10:16 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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.