All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
@ 2018-04-11  8:27 ` Ewelina Musial
  0 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11  8:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Test have similar functionality that gem_cs_prefetch IGT test
but gem_cs_prefetch is not up to date and there was an idea
to move this test to kselftests so this is respond for this
request.

There is another patch on igt_dev which is removing gem_cs_prefetch
test from IGT.
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 134 ++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 89b6ca9b14a7..42403da610c6 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1625,6 +1625,139 @@ static int igt_gtt_insert(void *arg)
 	return err;
 }
 
+#define COUNT 10
+static int igt_ggtt_scratch(void *arg)
+{
+	static struct insert_mode {
+		const char *name;
+		enum drm_mm_insert_mode mode;
+	}  modes[] = {
+		{ "bottom-up", DRM_MM_INSERT_LOW },
+		{ "top-down", DRM_MM_INSERT_HIGH },
+		{}
+	};
+
+	I915_RND_STATE(prng);
+
+	struct insert_mode *mode;
+	struct drm_i915_private *i915 = arg;
+	struct i915_ggtt *ggtt = &i915->ggtt;
+	struct drm_i915_gem_object *obj;
+	struct drm_mm_node *node;
+	struct drm_mm_node tmp[COUNT];
+	unsigned int *order;
+	int err = 0;
+	int n, m;
+	u64 hole_start, hole_end = 0;
+	u64 offset;
+	u32 __iomem *vaddr;
+	u32 val;
+
+  	mutex_lock(&i915->drm.struct_mutex);
+
+	for (mode = modes; mode->name; mode++) {
+		order = i915_random_order(COUNT, &prng);
+		if (!order) {
+			err = -ENOMEM;
+		}
+
+		obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
+		if (IS_ERR(obj)) {
+			err = PTR_ERR(obj);
+			goto out_unlock;
+		}
+
+		drm_mm_for_each_hole(node, &ggtt->base.mm, hole_start, hole_end) {
+
+			err = i915_gem_object_pin_pages(obj);
+			if (err)
+				goto out_free;
+
+			intel_runtime_pm_get(i915);
+			for (m = 0; m < COUNT; m++) {
+				memset(&tmp[order[m]], 0, sizeof(tmp[order[m]]));
+
+				err = drm_mm_insert_node_in_range(&ggtt->base.mm, &tmp[order[m]],
+								  3 * PAGE_SIZE, 0,
+								  I915_COLOR_UNEVICTABLE,
+								  0, ggtt->mappable_end,
+								  mode->mode);
+				if (err)
+					goto out_unpin;
+
+				offset = tmp[order[m]].start;
+				ggtt->base.insert_page(&ggtt->base,
+						       i915_gem_object_get_dma_address(obj, 0),
+						       offset + PAGE_SIZE, I915_CACHE_NONE, 0);
+			}
+
+			i915_random_reorder(order, COUNT, &prng);
+
+			for (m = 0; m < COUNT; m++) {
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					iowrite32(n, vaddr);
+					io_mapping_unmap_atomic(vaddr);
+				}
+
+				i915_gem_flush_ggtt_writes(i915);
+
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					val = ioread32(vaddr);
+					io_mapping_unmap_atomic(vaddr);
+
+					if ((n != 1) && (val != 2)) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, 2);
+						err = -EINVAL;
+						break;
+					} else if ((n == 1) && (val != n)) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, n);
+						err = -EINVAL;
+						break;
+					}
+				}
+
+				ggtt->base.clear_range(&ggtt->base, tmp[order[m]].start, tmp[order[m]].size);
+				ggtt->invalidate(i915);
+
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					val = ioread32(vaddr);
+					io_mapping_unmap_atomic(vaddr);
+
+					if (val != 2) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, 2);
+						err = -EINVAL;
+						break;
+					}
+				}
+			}
+			for (m = 0; m < COUNT; m++) {
+				drm_mm_remove_node(&tmp[m]);
+			}
+out_unpin:
+			intel_runtime_pm_put(i915);
+			i915_gem_object_unpin_pages(obj);
+		}
+out_free:
+		i915_gem_object_put(obj);
+		kfree(order);
+	}
+out_unlock:
+	   mutex_unlock(&i915->drm.struct_mutex);
+	   return err;
+}
+
 int i915_gem_gtt_mock_selftests(void)
 {
 	static const struct i915_subtest tests[] = {
@@ -1667,6 +1800,7 @@ int i915_gem_gtt_live_selftests(struct drm_i915_private *i915)
 		SUBTEST(igt_ggtt_pot),
 		SUBTEST(igt_ggtt_fill),
 		SUBTEST(igt_ggtt_page),
+		SUBTEST(igt_ggtt_scratch),
 	};
 
 	GEM_BUG_ON(offset_in_page(i915->ggtt.base.total));
-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
@ 2018-04-11  8:27 ` Ewelina Musial
  0 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11  8:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Test have similar functionality that gem_cs_prefetch IGT test
but gem_cs_prefetch is not up to date and there was an idea
to move this test to kselftests so this is respond for this
request.

There is another patch on igt_dev which is removing gem_cs_prefetch
test from IGT.
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 134 ++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 89b6ca9b14a7..42403da610c6 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1625,6 +1625,139 @@ static int igt_gtt_insert(void *arg)
 	return err;
 }
 
+#define COUNT 10
+static int igt_ggtt_scratch(void *arg)
+{
+	static struct insert_mode {
+		const char *name;
+		enum drm_mm_insert_mode mode;
+	}  modes[] = {
+		{ "bottom-up", DRM_MM_INSERT_LOW },
+		{ "top-down", DRM_MM_INSERT_HIGH },
+		{}
+	};
+
+	I915_RND_STATE(prng);
+
+	struct insert_mode *mode;
+	struct drm_i915_private *i915 = arg;
+	struct i915_ggtt *ggtt = &i915->ggtt;
+	struct drm_i915_gem_object *obj;
+	struct drm_mm_node *node;
+	struct drm_mm_node tmp[COUNT];
+	unsigned int *order;
+	int err = 0;
+	int n, m;
+	u64 hole_start, hole_end = 0;
+	u64 offset;
+	u32 __iomem *vaddr;
+	u32 val;
+
+  	mutex_lock(&i915->drm.struct_mutex);
+
+	for (mode = modes; mode->name; mode++) {
+		order = i915_random_order(COUNT, &prng);
+		if (!order) {
+			err = -ENOMEM;
+		}
+
+		obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
+		if (IS_ERR(obj)) {
+			err = PTR_ERR(obj);
+			goto out_unlock;
+		}
+
+		drm_mm_for_each_hole(node, &ggtt->base.mm, hole_start, hole_end) {
+
+			err = i915_gem_object_pin_pages(obj);
+			if (err)
+				goto out_free;
+
+			intel_runtime_pm_get(i915);
+			for (m = 0; m < COUNT; m++) {
+				memset(&tmp[order[m]], 0, sizeof(tmp[order[m]]));
+
+				err = drm_mm_insert_node_in_range(&ggtt->base.mm, &tmp[order[m]],
+								  3 * PAGE_SIZE, 0,
+								  I915_COLOR_UNEVICTABLE,
+								  0, ggtt->mappable_end,
+								  mode->mode);
+				if (err)
+					goto out_unpin;
+
+				offset = tmp[order[m]].start;
+				ggtt->base.insert_page(&ggtt->base,
+						       i915_gem_object_get_dma_address(obj, 0),
+						       offset + PAGE_SIZE, I915_CACHE_NONE, 0);
+			}
+
+			i915_random_reorder(order, COUNT, &prng);
+
+			for (m = 0; m < COUNT; m++) {
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					iowrite32(n, vaddr);
+					io_mapping_unmap_atomic(vaddr);
+				}
+
+				i915_gem_flush_ggtt_writes(i915);
+
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					val = ioread32(vaddr);
+					io_mapping_unmap_atomic(vaddr);
+
+					if ((n != 1) && (val != 2)) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, 2);
+						err = -EINVAL;
+						break;
+					} else if ((n == 1) && (val != n)) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, n);
+						err = -EINVAL;
+						break;
+					}
+				}
+
+				ggtt->base.clear_range(&ggtt->base, tmp[order[m]].start, tmp[order[m]].size);
+				ggtt->invalidate(i915);
+
+				for ( n = 0; n <= 2; n++)
+				{
+					offset = tmp[order[m]].start + n * PAGE_SIZE;
+					vaddr = io_mapping_map_atomic_wc(&ggtt->iomap, offset);
+					val = ioread32(vaddr);
+					io_mapping_unmap_atomic(vaddr);
+
+					if (val != 2) {
+						pr_err("insert page failed: found %d, expected %d\n",
+						       val, 2);
+						err = -EINVAL;
+						break;
+					}
+				}
+			}
+			for (m = 0; m < COUNT; m++) {
+				drm_mm_remove_node(&tmp[m]);
+			}
+out_unpin:
+			intel_runtime_pm_put(i915);
+			i915_gem_object_unpin_pages(obj);
+		}
+out_free:
+		i915_gem_object_put(obj);
+		kfree(order);
+	}
+out_unlock:
+	   mutex_unlock(&i915->drm.struct_mutex);
+	   return err;
+}
+
 int i915_gem_gtt_mock_selftests(void)
 {
 	static const struct i915_subtest tests[] = {
@@ -1667,6 +1800,7 @@ int i915_gem_gtt_live_selftests(struct drm_i915_private *i915)
 		SUBTEST(igt_ggtt_pot),
 		SUBTEST(igt_ggtt_fill),
 		SUBTEST(igt_ggtt_page),
+		SUBTEST(igt_ggtt_scratch),
 	};
 
 	GEM_BUG_ON(offset_in_page(i915->ggtt.base.total));
-- 
2.14.3

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

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

* [PATCH i-g-t] gem_cs_prefetch: Remove gem_cs_prefetch from IGT
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
@ 2018-04-11  8:27   ` Ewelina Musial
  -1 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11  8:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

gem_cs_prefetch is replaced by igt_ggtt_scratch subtest in i915_gem_gtt
kselftest
---
 tests/Makefile.sources       |   1 -
 tests/gem_cs_prefetch.c      | 149 -------------------------------------------
 tests/intel-ci/blacklist.txt |   1 -
 tests/meson.build            |   1 -
 4 files changed, 152 deletions(-)
 delete mode 100644 tests/gem_cs_prefetch.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 791e4f83..25afafeb 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -52,7 +52,6 @@ TESTS_progs = \
 	gem_concurrent_blit \
 	gem_cpu_reloc \
 	gem_create \
-	gem_cs_prefetch \
 	gem_cs_tlb \
 	gem_ctx_bad_destroy \
 	gem_ctx_bad_exec \
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
deleted file mode 100644
index 2b865368..00000000
--- a/tests/gem_cs_prefetch.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *    Daniel Vetter <daniel.vetter@ffwll.ch>
- *
- */
-
-/*
- * Testcase: Test the CS prefetch behaviour on batches
- *
- * Historically the batch prefetcher doesn't check whether it's crossing page
- * boundaries and likes to throw up when it gets a pagefault in return for his
- * over-eager behaviour. Check for this.
- *
- * This test for a bug where we've failed to plug a scratch pte entry into the
- * very last gtt pte.
- */
-#include "igt.h"
-
-IGT_TEST_DESCRIPTION("Test the CS prefetch behaviour on batches.");
-
-#define BATCH_SIZE 4096
-
-struct shadow {
-	uint32_t handle;
-	struct drm_i915_gem_relocation_entry reloc;
-};
-
-static void setup(int fd, int gen, struct shadow *shadow)
-{
-	uint32_t buf[16];
-	int i;
-
-	shadow->handle = gem_create(fd, 4096);
-
-	i = 0;
-	buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
-	if (gen >= 8) {
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-		buf[i++] = 0;
-	} else if (gen >= 4) {
-		buf[i++] = 0;
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-	} else {
-		buf[i-1]--;
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-	}
-	buf[i++] = MI_BATCH_BUFFER_END;
-	buf[i++] = MI_BATCH_BUFFER_END;
-	gem_write(fd, shadow->handle, 0, buf, sizeof(buf));
-
-	memset(&shadow->reloc, 0, sizeof(shadow->reloc));
-	if (gen >= 8 || gen < 4)
-		shadow->reloc.offset = sizeof(uint32_t);
-	else
-		shadow->reloc.offset = 2*sizeof(uint32_t);
-	shadow->reloc.delta = BATCH_SIZE - sizeof(uint32_t);
-	shadow->reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION;
-	shadow->reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION;
-}
-
-static void can_test_ring(unsigned ring)
-{
-	int master = drm_open_driver_master(DRIVER_INTEL);
-	int fd = drm_open_driver(DRIVER_INTEL);
-
-	/* Dance to avoid dying with master open */
-	close(master);
-	igt_require_gem(fd);
-	gem_require_ring(fd, ring);
-	igt_require(gem_can_store_dword(fd, ring));
-	close(fd);
-}
-
-static void test_ring(unsigned ring)
-{
-	struct drm_i915_gem_execbuffer2 execbuf;
-	struct drm_i915_gem_exec_object2 obj[2];
-	struct shadow shadow;
-	uint64_t i, count;
-	int fd, gen;
-
-	can_test_ring(ring);
-
-	fd = drm_open_driver_master(DRIVER_INTEL);
-	gen = intel_gen(intel_get_drm_devid(fd));
-	setup(fd, gen, &shadow);
-
-	count = gem_aperture_size(fd) / BATCH_SIZE;
-	intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
-	/* Fill the entire gart with batches and run them. */
-	memset(obj, 0, sizeof(obj));
-	obj[1].handle = shadow.handle;
-	obj[1].relocs_ptr = to_user_pointer(&shadow.reloc);
-	obj[1].relocation_count = 1;
-
-	memset(&execbuf, 0, sizeof(execbuf));
-	execbuf.buffers_ptr = to_user_pointer(obj);
-	execbuf.flags = ring;
-	if (gen < 6)
-		execbuf.flags |= I915_EXEC_SECURE;
-
-	for (i = 0; i < count; i++) {
-		/* Create the new batch using the GPU */
-		obj[0].handle = gem_create(fd, BATCH_SIZE);
-		shadow.reloc.target_handle = obj[0].handle;
-		execbuf.buffer_count = 2;
-		gem_execbuf(fd, &execbuf);
-
-		/* ...then execute the new batch */
-		execbuf.buffer_count = 1;
-		gem_execbuf(fd, &execbuf);
-
-		/* ...and leak the handle to consume the GTT */
-	}
-
-	close(fd);
-}
-
-igt_main
-{
-	const struct intel_execution_engine *e;
-
-	igt_skip_on_simulation();
-
-	for (e = intel_execution_engines; e->name; e++)
-		igt_subtest_f("%s", e->name)
-			test_ring(e->exec_id | e->flags);
-}
diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-ci/blacklist.txt
index d65d8ff3..4b16b155 100644
--- a/tests/intel-ci/blacklist.txt
+++ b/tests/intel-ci/blacklist.txt
@@ -7,7 +7,6 @@ igt@drm_mm(@.*)?
 igt@gem_busy@.*hang.*
 igt@gem_close_race@(?!.*basic).*
 igt@gem_concurrent_blit(@.*)?
-igt@gem_cs_prefetch(@.*)?
 igt@gem_ctx_create@(?!.*basic).*
 igt@gem_ctx_exec@(?!.*basic).*
 igt@gem_ctx_switch@(?!.*basic).*
diff --git a/tests/meson.build b/tests/meson.build
index 4720dfe2..058ed0f4 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -29,7 +29,6 @@ test_progs = [
 	'gem_concurrent_blit',
 	'gem_cpu_reloc',
 	'gem_create',
-	'gem_cs_prefetch',
 	'gem_cs_tlb',
 	'gem_ctx_bad_destroy',
 	'gem_ctx_bad_exec',
-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] [PATCH i-g-t] gem_cs_prefetch: Remove gem_cs_prefetch from IGT
@ 2018-04-11  8:27   ` Ewelina Musial
  0 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11  8:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

gem_cs_prefetch is replaced by igt_ggtt_scratch subtest in i915_gem_gtt
kselftest
---
 tests/Makefile.sources       |   1 -
 tests/gem_cs_prefetch.c      | 149 -------------------------------------------
 tests/intel-ci/blacklist.txt |   1 -
 tests/meson.build            |   1 -
 4 files changed, 152 deletions(-)
 delete mode 100644 tests/gem_cs_prefetch.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 791e4f83..25afafeb 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -52,7 +52,6 @@ TESTS_progs = \
 	gem_concurrent_blit \
 	gem_cpu_reloc \
 	gem_create \
-	gem_cs_prefetch \
 	gem_cs_tlb \
 	gem_ctx_bad_destroy \
 	gem_ctx_bad_exec \
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
deleted file mode 100644
index 2b865368..00000000
--- a/tests/gem_cs_prefetch.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *    Daniel Vetter <daniel.vetter@ffwll.ch>
- *
- */
-
-/*
- * Testcase: Test the CS prefetch behaviour on batches
- *
- * Historically the batch prefetcher doesn't check whether it's crossing page
- * boundaries and likes to throw up when it gets a pagefault in return for his
- * over-eager behaviour. Check for this.
- *
- * This test for a bug where we've failed to plug a scratch pte entry into the
- * very last gtt pte.
- */
-#include "igt.h"
-
-IGT_TEST_DESCRIPTION("Test the CS prefetch behaviour on batches.");
-
-#define BATCH_SIZE 4096
-
-struct shadow {
-	uint32_t handle;
-	struct drm_i915_gem_relocation_entry reloc;
-};
-
-static void setup(int fd, int gen, struct shadow *shadow)
-{
-	uint32_t buf[16];
-	int i;
-
-	shadow->handle = gem_create(fd, 4096);
-
-	i = 0;
-	buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
-	if (gen >= 8) {
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-		buf[i++] = 0;
-	} else if (gen >= 4) {
-		buf[i++] = 0;
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-	} else {
-		buf[i-1]--;
-		buf[i++] = BATCH_SIZE - sizeof(uint32_t);
-	}
-	buf[i++] = MI_BATCH_BUFFER_END;
-	buf[i++] = MI_BATCH_BUFFER_END;
-	gem_write(fd, shadow->handle, 0, buf, sizeof(buf));
-
-	memset(&shadow->reloc, 0, sizeof(shadow->reloc));
-	if (gen >= 8 || gen < 4)
-		shadow->reloc.offset = sizeof(uint32_t);
-	else
-		shadow->reloc.offset = 2*sizeof(uint32_t);
-	shadow->reloc.delta = BATCH_SIZE - sizeof(uint32_t);
-	shadow->reloc.read_domains = I915_GEM_DOMAIN_INSTRUCTION;
-	shadow->reloc.write_domain = I915_GEM_DOMAIN_INSTRUCTION;
-}
-
-static void can_test_ring(unsigned ring)
-{
-	int master = drm_open_driver_master(DRIVER_INTEL);
-	int fd = drm_open_driver(DRIVER_INTEL);
-
-	/* Dance to avoid dying with master open */
-	close(master);
-	igt_require_gem(fd);
-	gem_require_ring(fd, ring);
-	igt_require(gem_can_store_dword(fd, ring));
-	close(fd);
-}
-
-static void test_ring(unsigned ring)
-{
-	struct drm_i915_gem_execbuffer2 execbuf;
-	struct drm_i915_gem_exec_object2 obj[2];
-	struct shadow shadow;
-	uint64_t i, count;
-	int fd, gen;
-
-	can_test_ring(ring);
-
-	fd = drm_open_driver_master(DRIVER_INTEL);
-	gen = intel_gen(intel_get_drm_devid(fd));
-	setup(fd, gen, &shadow);
-
-	count = gem_aperture_size(fd) / BATCH_SIZE;
-	intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
-	/* Fill the entire gart with batches and run them. */
-	memset(obj, 0, sizeof(obj));
-	obj[1].handle = shadow.handle;
-	obj[1].relocs_ptr = to_user_pointer(&shadow.reloc);
-	obj[1].relocation_count = 1;
-
-	memset(&execbuf, 0, sizeof(execbuf));
-	execbuf.buffers_ptr = to_user_pointer(obj);
-	execbuf.flags = ring;
-	if (gen < 6)
-		execbuf.flags |= I915_EXEC_SECURE;
-
-	for (i = 0; i < count; i++) {
-		/* Create the new batch using the GPU */
-		obj[0].handle = gem_create(fd, BATCH_SIZE);
-		shadow.reloc.target_handle = obj[0].handle;
-		execbuf.buffer_count = 2;
-		gem_execbuf(fd, &execbuf);
-
-		/* ...then execute the new batch */
-		execbuf.buffer_count = 1;
-		gem_execbuf(fd, &execbuf);
-
-		/* ...and leak the handle to consume the GTT */
-	}
-
-	close(fd);
-}
-
-igt_main
-{
-	const struct intel_execution_engine *e;
-
-	igt_skip_on_simulation();
-
-	for (e = intel_execution_engines; e->name; e++)
-		igt_subtest_f("%s", e->name)
-			test_ring(e->exec_id | e->flags);
-}
diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-ci/blacklist.txt
index d65d8ff3..4b16b155 100644
--- a/tests/intel-ci/blacklist.txt
+++ b/tests/intel-ci/blacklist.txt
@@ -7,7 +7,6 @@ igt@drm_mm(@.*)?
 igt@gem_busy@.*hang.*
 igt@gem_close_race@(?!.*basic).*
 igt@gem_concurrent_blit(@.*)?
-igt@gem_cs_prefetch(@.*)?
 igt@gem_ctx_create@(?!.*basic).*
 igt@gem_ctx_exec@(?!.*basic).*
 igt@gem_ctx_switch@(?!.*basic).*
diff --git a/tests/meson.build b/tests/meson.build
index 4720dfe2..058ed0f4 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -29,7 +29,6 @@ test_progs = [
 	'gem_concurrent_blit',
 	'gem_cpu_reloc',
 	'gem_create',
-	'gem_cs_prefetch',
 	'gem_cs_tlb',
 	'gem_ctx_bad_destroy',
 	'gem_ctx_bad_exec',
-- 
2.14.3

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

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

* Re: [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
  (?)
  (?)
@ 2018-04-11  8:48 ` Chris Wilson
  2018-04-11 10:20   ` Ewelina Musial
  -1 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2018-04-11  8:48 UTC (permalink / raw)
  To: Ewelina Musial, intel-gfx; +Cc: igt-dev

Quoting Ewelina Musial (2018-04-11 09:27:12)
> Test have similar functionality that gem_cs_prefetch IGT test
> but gem_cs_prefetch is not up to date and there was an idea
> to move this test to kselftests so this is respond for this
> request.

gem_cs_prefetch itself does one thing: verify that we cannot cross the
page boundary beyond the last page of the GTT. It is about the Command
Streamer prefetch; there is no command streamer here.

gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
notes got muddled up.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-11  9:14 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-04-11  9:14 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: intel-gfx

== Series Details ==

Series: selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
URL   : https://patchwork.freedesktop.org/series/41529/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4042 -> Patchwork_8662 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8662/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-cnl-y3:          NOTRUN -> INCOMPLETE (fdo#105086)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       NOTRUN -> INCOMPLETE (fdo#103713)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         FAIL (fdo#102575) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
      fi-cfl-s3:          FAIL (fdo#103481) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086


== Participating hosts (35 -> 33) ==

  Additional (1): fi-cnl-y3 
  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4042 -> Patchwork_8662

  CI_DRM_4042: 98590826e4a407967faad1e021e3b38647a9e77f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4418: 7c474e011548d35df6b80ceed81d3e6ca560c71d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8662: e5d6592bb290572e7e1b0ba41d7d45e708cca2b0 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4418: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit


== Patchwork commits ==

e5d6592bb290 selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8662/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: failure for selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-11 10:12 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-04-11 10:12 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: intel-gfx

== Series Details ==

Series: selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
URL   : https://patchwork.freedesktop.org/series/41529/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4042_full -> Patchwork_8662_full =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_8662_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_8662_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce the CI noise.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8662/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@drv_selftest@live_gtt:
      shard-snb:          PASS -> DMESG-FAIL
      shard-kbl:          PASS -> DMESG-FAIL
      shard-hsw:          PASS -> DMESG-FAIL
      shard-apl:          PASS -> DMESG-FAIL

    
    ==== Warnings ====

    igt@kms_vblank@pipe-b-ts-continuation-idle-hang:
      shard-snb:          SKIP -> PASS +1

    igt@perf_pmu@rc6:
      shard-kbl:          SKIP -> PASS

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          PASS -> SKIP +1

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@kms_busy@extended-pageflip-hang-oldfb-render-b:
      shard-kbl:          DMESG-WARN (fdo#103313, fdo#103558) -> PASS +12

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          FAIL (fdo#105189) -> PASS

    igt@kms_flip@2x-plain-flip-fb-recreate:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@wf_vblank-ts-check:
      shard-hsw:          FAIL (fdo#103928) -> PASS

    igt@kms_sysfs_edid_timing:
      shard-apl:          WARN (fdo#100047) -> PASS

    igt@pm_rpm@legacy-planes-dpms:
      shard-kbl:          DMESG-WARN (fdo#103558) -> PASS +18

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

  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 4) ==

  Missing    (2): shard-glk shard-glkb 


== Build changes ==

    * Linux: CI_DRM_4042 -> Patchwork_8662

  CI_DRM_4042: 98590826e4a407967faad1e021e3b38647a9e77f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4418: 7c474e011548d35df6b80ceed81d3e6ca560c71d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8662: e5d6592bb290572e7e1b0ba41d7d45e708cca2b0 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4418: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8662/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11  8:48 ` [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest Chris Wilson
@ 2018-04-11 10:20   ` Ewelina Musial
  2018-04-11 10:43     ` [Intel-gfx] " Chris Wilson
  0 siblings, 1 reply; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11 10:20 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> Quoting Ewelina Musial (2018-04-11 09:27:12)
> > Test have similar functionality that gem_cs_prefetch IGT test
> > but gem_cs_prefetch is not up to date and there was an idea
> > to move this test to kselftests so this is respond for this
> > request.
> 
> gem_cs_prefetch itself does one thing: verify that we cannot cross the
> page boundary beyond the last page of the GTT. It is about the Command
> Streamer prefetch; there is no command streamer here.
> 
> gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> notes got muddled up.
> -Chris

Probably you are right. I focused on some other point of view. My test is checking
that if we cross the boundary beyond the last page values are stored in scratch.
Do you think that is totally unrelated to gem_cs_prefetch?
Thanks,
Ewelina
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [Intel-gfx] [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11 10:20   ` Ewelina Musial
@ 2018-04-11 10:43     ` Chris Wilson
  2018-04-11 10:57         ` Ewelina Musial
  0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2018-04-11 10:43 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: igt-dev, intel-gfx

Quoting Ewelina Musial (2018-04-11 11:20:56)
> On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> > Quoting Ewelina Musial (2018-04-11 09:27:12)
> > > Test have similar functionality that gem_cs_prefetch IGT test
> > > but gem_cs_prefetch is not up to date and there was an idea
> > > to move this test to kselftests so this is respond for this
> > > request.
> > 
> > gem_cs_prefetch itself does one thing: verify that we cannot cross the
> > page boundary beyond the last page of the GTT. It is about the Command
> > Streamer prefetch; there is no command streamer here.
> > 
> > gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> > notes got muddled up.
> > -Chris
> 
> Probably you are right. I focused on some other point of view. My test is checking
> that if we cross the boundary beyond the last page values are stored in scratch.

If we cross the boundary beyond the end of the last page of the GTT, there are no
more pages. Hitting scratch is not a sensible test; scratch is just a
figment of the imagination, the only reason it may exist in some
circumstances is to prevent page faults. And other than vtd w/a that
was a bad idea.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11 10:43     ` [Intel-gfx] " Chris Wilson
@ 2018-04-11 10:57         ` Ewelina Musial
  0 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11 10:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, Apr 11, 2018 at 11:43:34AM +0100, Chris Wilson wrote:
> Quoting Ewelina Musial (2018-04-11 11:20:56)
> > On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> > > Quoting Ewelina Musial (2018-04-11 09:27:12)
> > > > Test have similar functionality that gem_cs_prefetch IGT test
> > > > but gem_cs_prefetch is not up to date and there was an idea
> > > > to move this test to kselftests so this is respond for this
> > > > request.
> > > 
> > > gem_cs_prefetch itself does one thing: verify that we cannot cross the
> > > page boundary beyond the last page of the GTT. It is about the Command
> > > Streamer prefetch; there is no command streamer here.
> > > 
> > > gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> > > notes got muddled up.
> > > -Chris
> > 
> > Probably you are right. I focused on some other point of view. My test is checking
> > that if we cross the boundary beyond the last page values are stored in scratch.
> 
> If we cross the boundary beyond the end of the last page of the GTT, there are no
> more pages. Hitting scratch is not a sensible test; scratch is just a
> figment of the imagination, the only reason it may exist in some
> circumstances is to prevent page faults. And other than vtd w/a that
> was a bad idea.
> -Chris

So do you think that scenario give us something or I should focus on some other scenario?
I am just wondering, even if scratch is some imagination we need to be sure that after
removing page this address will point to scratch not to some random value, right?
That test is testing this too.
-Ewelina
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
@ 2018-04-11 10:57         ` Ewelina Musial
  0 siblings, 0 replies; 15+ messages in thread
From: Ewelina Musial @ 2018-04-11 10:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, Apr 11, 2018 at 11:43:34AM +0100, Chris Wilson wrote:
> Quoting Ewelina Musial (2018-04-11 11:20:56)
> > On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> > > Quoting Ewelina Musial (2018-04-11 09:27:12)
> > > > Test have similar functionality that gem_cs_prefetch IGT test
> > > > but gem_cs_prefetch is not up to date and there was an idea
> > > > to move this test to kselftests so this is respond for this
> > > > request.
> > > 
> > > gem_cs_prefetch itself does one thing: verify that we cannot cross the
> > > page boundary beyond the last page of the GTT. It is about the Command
> > > Streamer prefetch; there is no command streamer here.
> > > 
> > > gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> > > notes got muddled up.
> > > -Chris
> > 
> > Probably you are right. I focused on some other point of view. My test is checking
> > that if we cross the boundary beyond the last page values are stored in scratch.
> 
> If we cross the boundary beyond the end of the last page of the GTT, there are no
> more pages. Hitting scratch is not a sensible test; scratch is just a
> figment of the imagination, the only reason it may exist in some
> circumstances is to prevent page faults. And other than vtd w/a that
> was a bad idea.
> -Chris

So do you think that scenario give us something or I should focus on some other scenario?
I am just wondering, even if scratch is some imagination we need to be sure that after
removing page this address will point to scratch not to some random value, right?
That test is testing this too.
-Ewelina
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
  2018-04-11 10:57         ` Ewelina Musial
@ 2018-04-11 11:24           ` Chris Wilson
  -1 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2018-04-11 11:24 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: igt-dev, intel-gfx

Quoting Ewelina Musial (2018-04-11 11:57:39)
> On Wed, Apr 11, 2018 at 11:43:34AM +0100, Chris Wilson wrote:
> > Quoting Ewelina Musial (2018-04-11 11:20:56)
> > > On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> > > > Quoting Ewelina Musial (2018-04-11 09:27:12)
> > > > > Test have similar functionality that gem_cs_prefetch IGT test
> > > > > but gem_cs_prefetch is not up to date and there was an idea
> > > > > to move this test to kselftests so this is respond for this
> > > > > request.
> > > > 
> > > > gem_cs_prefetch itself does one thing: verify that we cannot cross the
> > > > page boundary beyond the last page of the GTT. It is about the Command
> > > > Streamer prefetch; there is no command streamer here.
> > > > 
> > > > gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> > > > notes got muddled up.
> > > > -Chris
> > > 
> > > Probably you are right. I focused on some other point of view. My test is checking
> > > that if we cross the boundary beyond the last page values are stored in scratch.
> > 
> > If we cross the boundary beyond the end of the last page of the GTT, there are no
> > more pages. Hitting scratch is not a sensible test; scratch is just a
> > figment of the imagination, the only reason it may exist in some
> > circumstances is to prevent page faults. And other than vtd w/a that
> > was a bad idea.
> > -Chris
> 
> So do you think that scenario give us something or I should focus on some other scenario?
> I am just wondering, even if scratch is some imagination we need to be sure that after
> removing page this address will point to scratch not to some random value, right?

No. On many machines, we don't set <the empty space> to point to anything,
we don't even write no-page into GSM block as that takes a few ms during
module load. So trying to have a universal rule about what the implementation
should do, doesn't make sense. Design wise scratch is scratch, it is not
meant to be retrievable.

From the standpoint of the question you asked, the answer is just that
have to make sure that insert_page(s) end up with pages where we say
they are; clear_range on the other hand has to be regarded as a no-op in
the general case.

Then you look at the uABI boundary and everytime you ask a question
about how do we define the expected user behaviour in such a case, it is
often much easier to actually test the uABI boundary itself. (At least
emulating userspace from inside the kernel looks fraught, though the
kernel ELF modules might be very useful to do just that.)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest
@ 2018-04-11 11:24           ` Chris Wilson
  0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2018-04-11 11:24 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: igt-dev, intel-gfx

Quoting Ewelina Musial (2018-04-11 11:57:39)
> On Wed, Apr 11, 2018 at 11:43:34AM +0100, Chris Wilson wrote:
> > Quoting Ewelina Musial (2018-04-11 11:20:56)
> > > On Wed, Apr 11, 2018 at 09:48:21AM +0100, Chris Wilson wrote:
> > > > Quoting Ewelina Musial (2018-04-11 09:27:12)
> > > > > Test have similar functionality that gem_cs_prefetch IGT test
> > > > > but gem_cs_prefetch is not up to date and there was an idea
> > > > > to move this test to kselftests so this is respond for this
> > > > > request.
> > > > 
> > > > gem_cs_prefetch itself does one thing: verify that we cannot cross the
> > > > page boundary beyond the last page of the GTT. It is about the Command
> > > > Streamer prefetch; there is no command streamer here.
> > > > 
> > > > gem_cs_prefetch could be simplified by EXEC_OBJECT_PINNED, I think the
> > > > notes got muddled up.
> > > > -Chris
> > > 
> > > Probably you are right. I focused on some other point of view. My test is checking
> > > that if we cross the boundary beyond the last page values are stored in scratch.
> > 
> > If we cross the boundary beyond the end of the last page of the GTT, there are no
> > more pages. Hitting scratch is not a sensible test; scratch is just a
> > figment of the imagination, the only reason it may exist in some
> > circumstances is to prevent page faults. And other than vtd w/a that
> > was a bad idea.
> > -Chris
> 
> So do you think that scenario give us something or I should focus on some other scenario?
> I am just wondering, even if scratch is some imagination we need to be sure that after
> removing page this address will point to scratch not to some random value, right?

No. On many machines, we don't set <the empty space> to point to anything,
we don't even write no-page into GSM block as that takes a few ms during
module load. So trying to have a universal rule about what the implementation
should do, doesn't make sense. Design wise scratch is scratch, it is not
meant to be retrievable.

From the standpoint of the question you asked, the answer is just that
have to make sure that insert_page(s) end up with pages where we say
they are; clear_range on the other hand has to be regarded as a no-op in
the general case.

Then you look at the uABI boundary and everytime you ask a question
about how do we define the expected user behaviour in such a case, it is
often much easier to actually test the uABI boundary itself. (At least
emulating userspace from inside the kernel looks fraught, though the
kernel ELF modules might be very useful to do just that.)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] ✓ Fi.CI.BAT: success for selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest (rev2)
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
                   ` (4 preceding siblings ...)
  (?)
@ 2018-04-11 15:03 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-04-11 15:03 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: igt-dev

== Series Details ==

Series: selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest (rev2)
URL   : https://patchwork.freedesktop.org/series/41528/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4422 -> IGTPW_1245 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1245/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_ringfill@basic-default-hang:
      fi-blb-e6850:       NOTRUN -> DMESG-WARN (fdo#101600)
      fi-pnv-d510:        NOTRUN -> DMESG-WARN (fdo#101600)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cfl-s3:          PASS -> INCOMPLETE (fdo#105641)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    
  fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#105641 https://bugs.freedesktop.org/show_bug.cgi?id=105641


== Participating hosts (27 -> 32) ==

  Additional (7): fi-kbl-7567u fi-bxt-dsi fi-skl-gvtdvm fi-bdw-gvtdvm fi-pnv-d510 fi-elk-e7500 fi-blb-e6850 
  Missing    (2): fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * IGT: IGT_4422 -> IGTPW_1245
    * Linux: CI_DRM_4044 -> CI_DRM_4046
    * Piglit: piglit_4422 -> piglit_4423

  CI_DRM_4044: bb98639a2babe9d26edca8ea44c3e9f968c6c30f @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4046: d123888920ccd112851ade43a3bf1c25627c2316 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1245/
  IGT_4422: a914075d55dd089095121906bf4c3e825a3cecf2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4422: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit
  piglit_4423: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit



== Testlist changes ==

-igt@gem_cs_prefetch@blt
-igt@gem_cs_prefetch@bsd
-igt@gem_cs_prefetch@bsd1
-igt@gem_cs_prefetch@bsd2
-igt@gem_cs_prefetch@default
-igt@gem_cs_prefetch@render
-igt@gem_cs_prefetch@vebox

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest (rev2)
  2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
                   ` (5 preceding siblings ...)
  (?)
@ 2018-04-11 18:47 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-04-11 18:47 UTC (permalink / raw)
  To: Ewelina Musial; +Cc: igt-dev

== Series Details ==

Series: selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest (rev2)
URL   : https://patchwork.freedesktop.org/series/41528/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4422_full -> IGTPW_1245_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1245_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1245_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_1245/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-blt:
      shard-kbl:          SKIP -> PASS +2

    igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
      shard-snb:          PASS -> SKIP

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@drv_suspend@fence-restore-tiled2untiled:
      shard-snb:          PASS -> INCOMPLETE (fdo#103880)

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-hsw:          PASS -> INCOMPLETE (fdo#103540)

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          PASS -> FAIL (fdo#102887)

    igt@kms_flip@2x-modeset-vs-vblank-race:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_flip_tiling@flip-y-tiled:
      shard-apl:          PASS -> FAIL (fdo#103822)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt:
      shard-apl:          PASS -> DMESG-FAIL (fdo#101623)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
      shard-hsw:          FAIL (fdo#104873) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-hsw:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@flip-vs-wf_vblank-interruptible:
      shard-hsw:          FAIL (fdo#103928) -> PASS

    igt@perf@polling:
      shard-hsw:          FAIL (fdo#102252) -> PASS

    
  fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
  fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 4) ==

  Missing    (1): shard-glkb 


== Build changes ==

    * IGT: IGT_4422 -> IGTPW_1245
    * Linux: CI_DRM_4044 -> CI_DRM_4046
    * Piglit: piglit_4422 -> piglit_4423

  CI_DRM_4044: bb98639a2babe9d26edca8ea44c3e9f968c6c30f @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4046: d123888920ccd112851ade43a3bf1c25627c2316 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1245/
  IGT_4422: a914075d55dd089095121906bf4c3e825a3cecf2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4422: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit
  piglit_4423: 45e115f293fd6acc0c9647cf2d3b76be78819ba5 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

end of thread, other threads:[~2018-04-11 18:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11  8:27 [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest Ewelina Musial
2018-04-11  8:27 ` [igt-dev] " Ewelina Musial
2018-04-11  8:27 ` [PATCH i-g-t] gem_cs_prefetch: Remove gem_cs_prefetch from IGT Ewelina Musial
2018-04-11  8:27   ` [igt-dev] " Ewelina Musial
2018-04-11  8:48 ` [igt-dev] [PATCH] selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest Chris Wilson
2018-04-11 10:20   ` Ewelina Musial
2018-04-11 10:43     ` [Intel-gfx] " Chris Wilson
2018-04-11 10:57       ` Ewelina Musial
2018-04-11 10:57         ` Ewelina Musial
2018-04-11 11:24         ` Chris Wilson
2018-04-11 11:24           ` [Intel-gfx] " Chris Wilson
2018-04-11  9:14 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-11 10:12 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-04-11 15:03 ` [igt-dev] ✓ Fi.CI.BAT: success for selftests/i915_gem_gtt: Create igt_ggtt_scratch subtest (rev2) Patchwork
2018-04-11 18:47 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.