All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-05-27 18:51 ` Matthew Auld
  0 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-05-27 18:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Eero Tamminen, Christoph Hellwig, dri-devel

This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.

We are unfortunately seeing more issues like we did in 293837b9ac8d
("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
now for the vm_fault_gtt path, where we are now hitting the same
BUG_ON(!pte_none(*pte)):

[10887.466150] kernel BUG at mm/memory.c:2183!
[10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
[10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
[10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
[10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
[10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
[10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
[10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
[10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
[10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
[10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
[10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
[10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
[10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
[10887.466223] Call Trace:
[10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
[10887.466381]  ? ktime_get+0x38/0x90
[10887.466389]  __do_fault+0x37/0x90
[10887.466395]  __handle_mm_fault+0xc46/0x1200
[10887.466402]  handle_mm_fault+0xce/0x2a0
[10887.466407]  do_user_addr_fault+0x1c5/0x660

Reverting this commit is reported to fix the issue.

Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/Kconfig             |  1 -
 drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
 drivers/gpu/drm/i915/i915_drv.h          |  3 ++
 drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
 4 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 93f4d059fc89..1e1cb245fca7 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -20,7 +20,6 @@ config DRM_I915
 	select INPUT if ACPI
 	select ACPI_VIDEO if ACPI
 	select ACPI_BUTTON if ACPI
-	select IO_MAPPING
 	select SYNC_FILE
 	select IOSF_MBI
 	select CRC32
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index f6fe5cb01438..8598a1c78a4c 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
 		goto err_unpin;
 
 	/* Finally, remap it using the new GTT offset */
-	ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
-			(vma->ggtt_view.partial.offset << PAGE_SHIFT),
-			(ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
-			min_t(u64, vma->size, area->vm_end - area->vm_start));
+	ret = remap_io_mapping(area,
+			       area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
+			       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
+			       min_t(u64, vma->size, area->vm_end - area->vm_start),
+			       &ggtt->iomap);
 	if (ret)
 		goto err_fence;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0f6d27da69ac..e926f20c5b82 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file);
 
 /* i915_mm.c */
+int remap_io_mapping(struct vm_area_struct *vma,
+		     unsigned long addr, unsigned long pfn, unsigned long size,
+		     struct io_mapping *iomap);
 int remap_io_sg(struct vm_area_struct *vma,
 		unsigned long addr, unsigned long size,
 		struct scatterlist *sgl, resource_size_t iobase);
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index 9a777b0ff59b..666808cb3a32 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -37,6 +37,17 @@ struct remap_pfn {
 	resource_size_t iobase;
 };
 
+static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
+{
+	struct remap_pfn *r = data;
+
+	/* Special PTE are not associated with any struct page */
+	set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
+	r->pfn++;
+
+	return 0;
+}
+
 #define use_dma(io) ((io) != -1)
 
 static inline unsigned long sgt_pfn(const struct remap_pfn *r)
@@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
 	return 0;
 }
 
+/**
+ * remap_io_mapping - remap an IO mapping to userspace
+ * @vma: user vma to map to
+ * @addr: target user address to start at
+ * @pfn: physical address of kernel memory
+ * @size: size of map area
+ * @iomap: the source io_mapping
+ *
+ *  Note: this is only safe if the mm semaphore is held when called.
+ */
+int remap_io_mapping(struct vm_area_struct *vma,
+		     unsigned long addr, unsigned long pfn, unsigned long size,
+		     struct io_mapping *iomap)
+{
+	struct remap_pfn r;
+	int err;
+
 #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
+	GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
+
+	/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
+	r.mm = vma->vm_mm;
+	r.pfn = pfn;
+	r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
+			  (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
+
+	err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
+	if (unlikely(err)) {
+		zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
+		return err;
+	}
+
+	return 0;
+}
 
 /**
  * remap_io_sg - remap an IO mapping to userspace
-- 
2.26.3


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

* [Intel-gfx] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-05-27 18:51 ` Matthew Auld
  0 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-05-27 18:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Eero Tamminen, Christoph Hellwig, dri-devel

This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.

We are unfortunately seeing more issues like we did in 293837b9ac8d
("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
now for the vm_fault_gtt path, where we are now hitting the same
BUG_ON(!pte_none(*pte)):

[10887.466150] kernel BUG at mm/memory.c:2183!
[10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
[10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
[10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
[10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
[10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
[10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
[10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
[10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
[10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
[10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
[10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
[10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
[10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
[10887.466223] Call Trace:
[10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
[10887.466381]  ? ktime_get+0x38/0x90
[10887.466389]  __do_fault+0x37/0x90
[10887.466395]  __handle_mm_fault+0xc46/0x1200
[10887.466402]  handle_mm_fault+0xce/0x2a0
[10887.466407]  do_user_addr_fault+0x1c5/0x660

Reverting this commit is reported to fix the issue.

Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/Kconfig             |  1 -
 drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
 drivers/gpu/drm/i915/i915_drv.h          |  3 ++
 drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
 4 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 93f4d059fc89..1e1cb245fca7 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -20,7 +20,6 @@ config DRM_I915
 	select INPUT if ACPI
 	select ACPI_VIDEO if ACPI
 	select ACPI_BUTTON if ACPI
-	select IO_MAPPING
 	select SYNC_FILE
 	select IOSF_MBI
 	select CRC32
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index f6fe5cb01438..8598a1c78a4c 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
 		goto err_unpin;
 
 	/* Finally, remap it using the new GTT offset */
-	ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
-			(vma->ggtt_view.partial.offset << PAGE_SHIFT),
-			(ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
-			min_t(u64, vma->size, area->vm_end - area->vm_start));
+	ret = remap_io_mapping(area,
+			       area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
+			       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
+			       min_t(u64, vma->size, area->vm_end - area->vm_start),
+			       &ggtt->iomap);
 	if (ret)
 		goto err_fence;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0f6d27da69ac..e926f20c5b82 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file);
 
 /* i915_mm.c */
+int remap_io_mapping(struct vm_area_struct *vma,
+		     unsigned long addr, unsigned long pfn, unsigned long size,
+		     struct io_mapping *iomap);
 int remap_io_sg(struct vm_area_struct *vma,
 		unsigned long addr, unsigned long size,
 		struct scatterlist *sgl, resource_size_t iobase);
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index 9a777b0ff59b..666808cb3a32 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -37,6 +37,17 @@ struct remap_pfn {
 	resource_size_t iobase;
 };
 
+static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
+{
+	struct remap_pfn *r = data;
+
+	/* Special PTE are not associated with any struct page */
+	set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
+	r->pfn++;
+
+	return 0;
+}
+
 #define use_dma(io) ((io) != -1)
 
 static inline unsigned long sgt_pfn(const struct remap_pfn *r)
@@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
 	return 0;
 }
 
+/**
+ * remap_io_mapping - remap an IO mapping to userspace
+ * @vma: user vma to map to
+ * @addr: target user address to start at
+ * @pfn: physical address of kernel memory
+ * @size: size of map area
+ * @iomap: the source io_mapping
+ *
+ *  Note: this is only safe if the mm semaphore is held when called.
+ */
+int remap_io_mapping(struct vm_area_struct *vma,
+		     unsigned long addr, unsigned long pfn, unsigned long size,
+		     struct io_mapping *iomap)
+{
+	struct remap_pfn r;
+	int err;
+
 #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
+	GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
+
+	/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
+	r.mm = vma->vm_mm;
+	r.pfn = pfn;
+	r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
+			  (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
+
+	err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
+	if (unlikely(err)) {
+		zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
+		return err;
+	}
+
+	return 0;
+}
 
 /**
  * remap_io_sg - remap an IO mapping to userspace
-- 
2.26.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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Revert "i915: use io_mapping_map_user"
  2021-05-27 18:51 ` [Intel-gfx] " Matthew Auld
  (?)
@ 2021-05-27 22:05 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2021-05-27 22:05 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

== Series Details ==

Series: Revert "i915: use io_mapping_map_user"
URL   : https://patchwork.freedesktop.org/series/90696/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
479d445cbfa3 Revert "i915: use io_mapping_map_user"
-:8: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 293837b9ac8d ("Revert "i915: fix remap_io_sg to verify the pgprot"")'
#8: 
We are unfortunately seeing more issues like we did in 293837b9ac8d

total: 1 errors, 0 warnings, 0 checks, 88 lines checked


_______________________________________________
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

* [Intel-gfx] ✓ Fi.CI.BAT: success for Revert "i915: use io_mapping_map_user"
  2021-05-27 18:51 ` [Intel-gfx] " Matthew Auld
  (?)
  (?)
@ 2021-05-27 22:35 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2021-05-27 22:35 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 4216 bytes --]

== Series Details ==

Series: Revert "i915: use io_mapping_map_user"
URL   : https://patchwork.freedesktop.org/series/90696/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10145 -> Patchwork_20229
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_gttfill@basic:
    - fi-bsw-n3050:       NOTRUN -> [SKIP][1] ([fdo#109271])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-bsw-n3050/igt@gem_exec_gttfill@basic.html

  * igt@gem_exec_suspend@basic-s3:
    - fi-bsw-n3050:       NOTRUN -> [INCOMPLETE][2] ([i915#3159])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-bsw-n3050/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_selftest@live@hangcheck:
    - fi-snb-2600:        [PASS][3] -> [INCOMPLETE][4] ([i915#2782])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-snb-2600/igt@i915_selftest@live@hangcheck.html

  
#### Possible fixes ####

  * igt@kms_frontbuffer_tracking@basic:
    - fi-tgl-u2:          [FAIL][5] ([i915#2416]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/fi-tgl-u2/igt@kms_frontbuffer_tracking@basic.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-tgl-u2/igt@kms_frontbuffer_tracking@basic.html

  
#### Warnings ####

  * igt@runner@aborted:
    - fi-kbl-soraka:      [FAIL][7] ([i915#1436] / [i915#3363]) -> [FAIL][8] ([i915#1436] / [i915#2426] / [i915#3363])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/fi-kbl-soraka/igt@runner@aborted.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-kbl-soraka/igt@runner@aborted.html
    - fi-kbl-7567u:       [FAIL][9] ([i915#1436] / [i915#3363]) -> [FAIL][10] ([i915#1436] / [i915#2426] / [i915#3363])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/fi-kbl-7567u/igt@runner@aborted.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-kbl-7567u/igt@runner@aborted.html
    - fi-skl-6700k2:      [FAIL][11] ([i915#1436] / [i915#3363]) -> [FAIL][12] ([i915#1436] / [i915#2426] / [i915#3363])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/fi-skl-6700k2/igt@runner@aborted.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/fi-skl-6700k2/igt@runner@aborted.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
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#2416]: https://gitlab.freedesktop.org/drm/intel/issues/2416
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
  [i915#2932]: https://gitlab.freedesktop.org/drm/intel/issues/2932
  [i915#2966]: https://gitlab.freedesktop.org/drm/intel/issues/2966
  [i915#3159]: https://gitlab.freedesktop.org/drm/intel/issues/3159
  [i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363


Participating hosts (43 -> 40)
------------------------------

  Additional (1): fi-bsw-n3050 
  Missing    (4): fi-ilk-m540 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u 


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

  * Linux: CI_DRM_10145 -> Patchwork_20229

  CI-20190529: 20190529
  CI_DRM_10145: 1b8b25e48b6d72ccd335a79d30c7e6641befb17b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6095: 5c7b7a8e441577a00cc4e71ec0ae57af640eb92a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_20229: 479d445cbfa3304df2fea5a473489cf5474534e2 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

479d445cbfa3 Revert "i915: use io_mapping_map_user"

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 5634 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
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

* [Intel-gfx] ✗ Fi.CI.IGT: failure for Revert "i915: use io_mapping_map_user"
  2021-05-27 18:51 ` [Intel-gfx] " Matthew Auld
                   ` (2 preceding siblings ...)
  (?)
@ 2021-05-28 20:41 ` Patchwork
  -1 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2021-05-28 20:41 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 30258 bytes --]

== Series Details ==

Series: Revert "i915: use io_mapping_map_user"
URL   : https://patchwork.freedesktop.org/series/90696/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10145_full -> Patchwork_20229_full
====================================================

Summary
-------

  **FAILURE**

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

  

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_rpm@modeset-non-lpsp-stress:
    - shard-kbl:          NOTRUN -> [TIMEOUT][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@i915_pm_rpm@modeset-non-lpsp-stress.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@feature_discovery@display-2x:
    - shard-iclb:         NOTRUN -> [SKIP][2] ([i915#1839])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@feature_discovery@display-2x.html

  * igt@feature_discovery@psr2:
    - shard-iclb:         NOTRUN -> [SKIP][3] ([i915#658]) +3 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@feature_discovery@psr2.html

  * igt@gem_create@create-clear:
    - shard-glk:          [PASS][4] -> [FAIL][5] ([i915#1888] / [i915#3160])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-glk8/igt@gem_create@create-clear.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk1/igt@gem_create@create-clear.html

  * igt@gem_create@create-massive:
    - shard-skl:          NOTRUN -> [DMESG-WARN][6] ([i915#3002])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl10/igt@gem_create@create-massive.html

  * igt@gem_ctx_persistence@legacy-engines-mixed:
    - shard-snb:          NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#1099]) +10 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb7/igt@gem_ctx_persistence@legacy-engines-mixed.html

  * igt@gem_ctx_persistence@many-contexts:
    - shard-iclb:         NOTRUN -> [FAIL][8] ([i915#2410])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb3/igt@gem_ctx_persistence@many-contexts.html

  * igt@gem_ctx_sseu@engines:
    - shard-tglb:         NOTRUN -> [SKIP][9] ([i915#280])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@gem_ctx_sseu@engines.html

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          NOTRUN -> [FAIL][10] ([i915#3354])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb7/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-apl:          NOTRUN -> [FAIL][11] ([i915#2846])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl3/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-flow@rcs0:
    - shard-skl:          NOTRUN -> [SKIP][12] ([fdo#109271]) +166 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl2/igt@gem_exec_fair@basic-flow@rcs0.html
    - shard-tglb:         [PASS][13] -> [FAIL][14] ([i915#2842]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-tglb2/igt@gem_exec_fair@basic-flow@rcs0.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb5/igt@gem_exec_fair@basic-flow@rcs0.html

  * igt@gem_exec_fair@basic-none-vip@rcs0:
    - shard-tglb:         NOTRUN -> [FAIL][15] ([i915#2842]) +1 similar issue
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb8/igt@gem_exec_fair@basic-none-vip@rcs0.html
    - shard-glk:          NOTRUN -> [FAIL][16] ([i915#2842])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk8/igt@gem_exec_fair@basic-none-vip@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][17] ([i915#2842]) +3 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gem_exec_fair@basic-pace@vcs1.html
    - shard-kbl:          [PASS][18] -> [FAIL][19] ([i915#2842])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-kbl7/igt@gem_exec_fair@basic-pace@vcs1.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@gem_exec_fair@basic-pace@vcs1.html

  * igt@gem_exec_fair@basic-pace@vecs0:
    - shard-kbl:          [PASS][20] -> [SKIP][21] ([fdo#109271])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-kbl7/igt@gem_exec_fair@basic-pace@vecs0.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@gem_exec_fair@basic-pace@vecs0.html

  * igt@gem_exec_params@no-vebox:
    - shard-iclb:         NOTRUN -> [SKIP][22] ([fdo#109283]) +2 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb5/igt@gem_exec_params@no-vebox.html

  * igt@gem_exec_params@rsvd2-dirt:
    - shard-tglb:         NOTRUN -> [SKIP][23] ([fdo#109283])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb8/igt@gem_exec_params@rsvd2-dirt.html

  * igt@gem_mmap_gtt@big-copy:
    - shard-iclb:         [PASS][24] -> [FAIL][25] ([i915#307]) +2 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-iclb3/igt@gem_mmap_gtt@big-copy.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb5/igt@gem_mmap_gtt@big-copy.html

  * igt@gem_mmap_gtt@big-copy-odd:
    - shard-glk:          NOTRUN -> [FAIL][26] ([i915#307])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk5/igt@gem_mmap_gtt@big-copy-odd.html

  * igt@gem_mmap_gtt@coherency:
    - shard-tglb:         NOTRUN -> [SKIP][27] ([fdo#111656])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@gem_mmap_gtt@coherency.html

  * igt@gem_render_copy@y-tiled-mc-ccs-to-yf-tiled-ccs:
    - shard-iclb:         NOTRUN -> [SKIP][28] ([i915#768]) +4 similar issues
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gem_render_copy@y-tiled-mc-ccs-to-yf-tiled-ccs.html

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

  * igt@gem_userptr_blits@dmabuf-unsync:
    - shard-tglb:         NOTRUN -> [SKIP][30] ([i915#3297]) +1 similar issue
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@gem_userptr_blits@dmabuf-unsync.html
    - shard-iclb:         NOTRUN -> [SKIP][31] ([i915#3297]) +2 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gem_userptr_blits@dmabuf-unsync.html

  * igt@gem_userptr_blits@input-checking:
    - shard-apl:          NOTRUN -> [DMESG-WARN][32] ([i915#3002])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl3/igt@gem_userptr_blits@input-checking.html
    - shard-snb:          NOTRUN -> [DMESG-WARN][33] ([i915#3002])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb2/igt@gem_userptr_blits@input-checking.html

  * igt@gem_userptr_blits@vma-merge:
    - shard-snb:          NOTRUN -> [FAIL][34] ([i915#2724])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb7/igt@gem_userptr_blits@vma-merge.html
    - shard-apl:          NOTRUN -> [FAIL][35] ([i915#3318])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl8/igt@gem_userptr_blits@vma-merge.html
    - shard-iclb:         NOTRUN -> [FAIL][36] ([i915#3318])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gem_userptr_blits@vma-merge.html
    - shard-kbl:          NOTRUN -> [FAIL][37] ([i915#3318])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@gem_userptr_blits@vma-merge.html

  * igt@gen7_exec_parse@chained-batch:
    - shard-iclb:         NOTRUN -> [SKIP][38] ([fdo#109289]) +2 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gen7_exec_parse@chained-batch.html
    - shard-tglb:         NOTRUN -> [SKIP][39] ([fdo#109289])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@gen7_exec_parse@chained-batch.html

  * igt@gen9_exec_parse@bb-large:
    - shard-tglb:         NOTRUN -> [SKIP][40] ([i915#2527])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@gen9_exec_parse@bb-large.html
    - shard-apl:          NOTRUN -> [FAIL][41] ([i915#3296])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@gen9_exec_parse@bb-large.html

  * igt@gen9_exec_parse@bb-start-param:
    - shard-tglb:         NOTRUN -> [SKIP][42] ([fdo#112306]) +2 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@gen9_exec_parse@bb-start-param.html
    - shard-iclb:         NOTRUN -> [SKIP][43] ([fdo#112306]) +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gen9_exec_parse@bb-start-param.html

  * igt@gen9_exec_parse@shadow-peek:
    - shard-iclb:         NOTRUN -> [SKIP][44] ([i915#2856])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@gen9_exec_parse@shadow-peek.html

  * igt@i915_pm_dc@dc9-dpms:
    - shard-iclb:         NOTRUN -> [FAIL][45] ([i915#3343])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@i915_pm_dc@dc9-dpms.html

  * igt@i915_pm_lpsp@screens-disabled:
    - shard-tglb:         NOTRUN -> [SKIP][46] ([i915#1902])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@i915_pm_lpsp@screens-disabled.html

  * igt@i915_pm_rc6_residency@media-rc6-accuracy:
    - shard-tglb:         NOTRUN -> [SKIP][47] ([fdo#109289] / [fdo#111719])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb8/igt@i915_pm_rc6_residency@media-rc6-accuracy.html

  * igt@i915_pm_rpm@dpms-non-lpsp:
    - shard-tglb:         NOTRUN -> [SKIP][48] ([fdo#111644] / [i915#1397] / [i915#2411])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@i915_pm_rpm@dpms-non-lpsp.html
    - shard-iclb:         NOTRUN -> [SKIP][49] ([fdo#110892])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@i915_pm_rpm@dpms-non-lpsp.html

  * igt@i915_pm_sseu@full-enable:
    - shard-tglb:         NOTRUN -> [SKIP][50] ([fdo#109288])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@i915_pm_sseu@full-enable.html
    - shard-iclb:         NOTRUN -> [SKIP][51] ([fdo#109288])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@i915_pm_sseu@full-enable.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][52] ([i915#180])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_big_fb@linear-8bpp-rotate-270:
    - shard-tglb:         NOTRUN -> [SKIP][53] ([fdo#111614]) +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb5/igt@kms_big_fb@linear-8bpp-rotate-270.html
    - shard-iclb:         NOTRUN -> [SKIP][54] ([fdo#110725] / [fdo#111614])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb3/igt@kms_big_fb@linear-8bpp-rotate-270.html

  * igt@kms_big_fb@yf-tiled-8bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][55] ([fdo#110723])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_big_fb@yf-tiled-8bpp-rotate-90.html

  * igt@kms_big_joiner@basic:
    - shard-apl:          NOTRUN -> [SKIP][56] ([fdo#109271] / [i915#2705]) +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@kms_big_joiner@basic.html

  * igt@kms_ccs@pipe-c-bad-aux-stride:
    - shard-skl:          NOTRUN -> [SKIP][57] ([fdo#109271] / [fdo#111304]) +2 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl2/igt@kms_ccs@pipe-c-bad-aux-stride.html

  * igt@kms_chamelium@hdmi-edid-change-during-suspend:
    - shard-apl:          NOTRUN -> [SKIP][58] ([fdo#109271] / [fdo#111827]) +32 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl3/igt@kms_chamelium@hdmi-edid-change-during-suspend.html

  * igt@kms_chamelium@hdmi-hpd:
    - shard-skl:          NOTRUN -> [SKIP][59] ([fdo#109271] / [fdo#111827]) +18 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl2/igt@kms_chamelium@hdmi-hpd.html

  * igt@kms_chamelium@hdmi-hpd-storm:
    - shard-kbl:          NOTRUN -> [SKIP][60] ([fdo#109271] / [fdo#111827]) +25 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@kms_chamelium@hdmi-hpd-storm.html

  * igt@kms_color@pipe-a-ctm-0-5:
    - shard-skl:          [PASS][61] -> [DMESG-WARN][62] ([i915#1982])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-skl4/igt@kms_color@pipe-a-ctm-0-5.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl5/igt@kms_color@pipe-a-ctm-0-5.html

  * igt@kms_color@pipe-d-ctm-0-25:
    - shard-iclb:         NOTRUN -> [SKIP][63] ([fdo#109278] / [i915#1149]) +2 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_color@pipe-d-ctm-0-25.html

  * igt@kms_color_chamelium@pipe-a-ctm-blue-to-red:
    - shard-snb:          NOTRUN -> [SKIP][64] ([fdo#109271] / [fdo#111827]) +46 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb2/igt@kms_color_chamelium@pipe-a-ctm-blue-to-red.html

  * igt@kms_color_chamelium@pipe-c-ctm-0-5:
    - shard-iclb:         NOTRUN -> [SKIP][65] ([fdo#109284] / [fdo#111827]) +17 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_color_chamelium@pipe-c-ctm-0-5.html
    - shard-glk:          NOTRUN -> [SKIP][66] ([fdo#109271] / [fdo#111827]) +15 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk2/igt@kms_color_chamelium@pipe-c-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-d-ctm-green-to-red:
    - shard-tglb:         NOTRUN -> [SKIP][67] ([fdo#109284] / [fdo#111827]) +14 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb5/igt@kms_color_chamelium@pipe-d-ctm-green-to-red.html
    - shard-iclb:         NOTRUN -> [SKIP][68] ([fdo#109278] / [fdo#109284] / [fdo#111827])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb3/igt@kms_color_chamelium@pipe-d-ctm-green-to-red.html

  * igt@kms_content_protection@atomic:
    - shard-kbl:          NOTRUN -> [TIMEOUT][69] ([i915#1319]) +2 similar issues
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@kms_content_protection@atomic.html
    - shard-iclb:         NOTRUN -> [SKIP][70] ([fdo#109300] / [fdo#111066])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_content_protection@atomic.html

  * igt@kms_content_protection@dp-mst-lic-type-1:
    - shard-iclb:         NOTRUN -> [SKIP][71] ([i915#3116])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb5/igt@kms_content_protection@dp-mst-lic-type-1.html

  * igt@kms_content_protection@lic:
    - shard-apl:          NOTRUN -> [TIMEOUT][72] ([i915#1319]) +1 similar issue
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@kms_content_protection@lic.html

  * igt@kms_cursor_crc@pipe-a-cursor-32x32-sliding:
    - shard-tglb:         NOTRUN -> [SKIP][73] ([i915#3319]) +1 similar issue
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@kms_cursor_crc@pipe-a-cursor-32x32-sliding.html

  * igt@kms_cursor_crc@pipe-a-cursor-512x512-sliding:
    - shard-iclb:         NOTRUN -> [SKIP][74] ([fdo#109278] / [fdo#109279]) +4 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_cursor_crc@pipe-a-cursor-512x512-sliding.html

  * igt@kms_cursor_crc@pipe-b-cursor-512x170-rapid-movement:
    - shard-tglb:         NOTRUN -> [SKIP][75] ([i915#3359]) +1 similar issue
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@kms_cursor_crc@pipe-b-cursor-512x170-rapid-movement.html

  * igt@kms_cursor_crc@pipe-d-cursor-32x32-rapid-movement:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([fdo#109278]) +32 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb5/igt@kms_cursor_crc@pipe-d-cursor-32x32-rapid-movement.html

  * igt@kms_cursor_crc@pipe-d-cursor-512x512-sliding:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([fdo#109279] / [i915#3359]) +4 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb5/igt@kms_cursor_crc@pipe-d-cursor-512x512-sliding.html

  * igt@kms_cursor_edge_walk@pipe-d-64x64-left-edge:
    - shard-kbl:          NOTRUN -> [SKIP][78] ([fdo#109271]) +223 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@kms_cursor_edge_walk@pipe-d-64x64-left-edge.html

  * igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions-varying-size:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([fdo#109274] / [fdo#109278]) +7 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-skl:          [PASS][80] -> [FAIL][81] ([i915#2346] / [i915#533])
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-skl2/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@pipe-d-torture-bo:
    - shard-apl:          NOTRUN -> [SKIP][82] ([fdo#109271] / [i915#533]) +3 similar issues
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@kms_cursor_legacy@pipe-d-torture-bo.html

  * igt@kms_dp_dsc@basic-dsc-enable-dp:
    - shard-tglb:         NOTRUN -> [SKIP][83] ([fdo#109349])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@kms_dp_dsc@basic-dsc-enable-dp.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-ytiled:
    - shard-skl:          NOTRUN -> [DMESG-WARN][84] ([i915#1982])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl4/igt@kms_draw_crc@draw-method-rgb565-pwrite-ytiled.html

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

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@c-dp1:
    - shard-kbl:          NOTRUN -> [FAIL][86] ([i915#79])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-dp1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs:
    - shard-tglb:         NOTRUN -> [SKIP][87] ([i915#2587])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile:
    - shard-glk:          NOTRUN -> [SKIP][88] ([fdo#109271] / [i915#2642])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk9/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile.html
    - shard-skl:          NOTRUN -> [SKIP][89] ([fdo#109271] / [i915#2642])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl4/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile.html
    - shard-kbl:          NOTRUN -> [SKIP][90] ([fdo#109271] / [i915#2642])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl7/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
    - shard-snb:          NOTRUN -> [SKIP][91] ([fdo#109271]) +775 similar issues
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-snb2/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile.html

  * igt@kms_force_connector_basic@force-load-detect:
    - shard-iclb:         NOTRUN -> [SKIP][92] ([fdo#109285])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb3/igt@kms_force_connector_basic@force-load-detect.html
    - shard-tglb:         NOTRUN -> [SKIP][93] ([fdo#109285])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb5/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-shrfb-msflip-blt:
    - shard-tglb:         NOTRUN -> [SKIP][94] ([fdo#111825]) +42 similar issues
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-shrfb-msflip-blt.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-kbl:          [PASS][95] -> [DMESG-WARN][96] ([i915#180]) +3 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-kbl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-gtt:
    - shard-skl:          [PASS][97] -> [FAIL][98] ([i915#49])
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-skl4/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-gtt.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl7/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-gtt.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-pgflip-blt:
    - shard-iclb:         [PASS][99] -> [FAIL][100] ([i915#49])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-iclb8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-pgflip-blt.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-shrfb-plflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][101] ([fdo#109280]) +41 similar issues
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_frontbuffer_tracking@psr-2p-primscrn-shrfb-plflip-blt.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-d-frame-sequence:
    - shard-kbl:          NOTRUN -> [SKIP][102] ([fdo#109271] / [i915#533]) +1 similar issue
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-d-frame-sequence.html
    - shard-skl:          NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#533])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl9/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-d-frame-sequence.html
    - shard-glk:          NOTRUN -> [SKIP][104] ([fdo#109271] / [i915#533])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk9/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-d-frame-sequence.html

  * igt@kms_plane@plane-position-hole@pipe-a-planes:
    - shard-iclb:         [PASS][105] -> [FAIL][106] ([i915#2472])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-iclb8/igt@kms_plane@plane-position-hole@pipe-a-planes.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_plane@plane-position-hole@pipe-a-planes.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
    - shard-skl:          NOTRUN -> [FAIL][107] ([fdo#108145] / [i915#265]) +3 similar issues
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl2/igt@kms_plane_alpha_blend@pipe-a-alpha-7efc.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-glk:          NOTRUN -> [FAIL][108] ([fdo#108145] / [i915#265]) +1 similar issue
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk9/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
    - shard-apl:          NOTRUN -> [FAIL][109] ([i915#265])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
    - shard-kbl:          NOTRUN -> [FAIL][110] ([fdo#108145] / [i915#265]) +2 similar issues
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl4/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html
    - shard-apl:          NOTRUN -> [FAIL][111] ([fdo#108145] / [i915#265]) +1 similar issue
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl8/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
    - shard-tglb:         NOTRUN -> [SKIP][112] ([fdo#111615]) +3 similar issues
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb8/igt@kms_plane_multiple@atomic-pipe-b-tiling-yf.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
    - shard-kbl:          NOTRUN -> [SKIP][113] ([fdo#109271] / [i915#2733])
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl3/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5:
    - shard-apl:          NOTRUN -> [SKIP][114] ([fdo#109271] / [i915#658]) +6 similar issues
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl1/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5.html

  * igt@kms_psr2_sf@plane-move-sf-dmg-area-3:
    - shard-kbl:          NOTRUN -> [SKIP][115] ([fdo#109271] / [i915#658]) +5 similar issues
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-kbl3/igt@kms_psr2_sf@plane-move-sf-dmg-area-3.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-3:
    - shard-tglb:         NOTRUN -> [SKIP][116] ([i915#2920]) +1 similar issue
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb6/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-3.html
    - shard-skl:          NOTRUN -> [SKIP][117] ([fdo#109271] / [i915#658]) +2 similar issues
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl6/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-3.html
    - shard-glk:          NOTRUN -> [SKIP][118] ([fdo#109271] / [i915#658]) +1 similar issue
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk5/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-3.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         NOTRUN -> [SKIP][119] ([fdo#109642] / [fdo#111068] / [i915#658])
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         NOTRUN -> [SKIP][120] ([fdo#109441]) +2 similar issues
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@kms_psr@psr2_sprite_mmap_cpu:
    - shard-tglb:         NOTRUN -> [FAIL][121] ([i915#132] / [i915#3467]) +2 similar issues
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@kms_psr@psr2_sprite_mmap_cpu.html

  * igt@kms_sysfs_edid_timing:
    - shard-apl:          NOTRUN -> [FAIL][122] ([IGT#2])
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl3/igt@kms_sysfs_edid_timing.html

  * igt@kms_writeback@writeback-check-output:
    - shard-apl:          NOTRUN -> [SKIP][123] ([fdo#109271] / [i915#2437]) +2 similar issues
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-apl3/igt@kms_writeback@writeback-check-output.html

  * igt@nouveau_crc@pipe-a-source-rg:
    - shard-tglb:         NOTRUN -> [SKIP][124] ([i915#2530]) +2 similar issues
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-tglb3/igt@nouveau_crc@pipe-a-source-rg.html

  * igt@nouveau_crc@pipe-b-source-outp-complete:
    - shard-glk:          NOTRUN -> [SKIP][125] ([fdo#109271]) +104 similar issues
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-glk5/igt@nouveau_crc@pipe-b-source-outp-complete.html
    - shard-iclb:         NOTRUN -> [SKIP][126] ([i915#2530]) +2 similar issues
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb4/igt@nouveau_crc@pipe-b-source-outp-complete.html

  * igt@perf@polling-small-buf:
    - shard-skl:          [PASS][127] -> [FAIL][128] ([i915#1722])
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10145/shard-skl8/igt@perf@polling-small-buf.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-skl8/igt@perf@polling-small-buf.html

  * igt@perf_pmu@event-wait@rcs0:
    - shard-iclb:         NOTRUN -> [SKIP][129] ([fdo#112283])
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20229/shard-iclb5/igt@perf_pmu@event-wait@rcs0.html

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 33956 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
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] [PATCH] Revert "i915: use io_mapping_map_user"
  2021-05-27 18:51 ` [Intel-gfx] " Matthew Auld
@ 2021-06-02  7:28   ` Matthew Auld
  -1 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-06-02  7:28 UTC (permalink / raw)
  To: Matthew Auld
  Cc: Tvrtko Ursulin, Thomas Hellström, Daniel Vetter,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Eero Tamminen

On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
>
> This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
>
> We are unfortunately seeing more issues like we did in 293837b9ac8d
> ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> now for the vm_fault_gtt path, where we are now hitting the same
> BUG_ON(!pte_none(*pte)):
>
> [10887.466150] kernel BUG at mm/memory.c:2183!
> [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> [10887.466223] Call Trace:
> [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> [10887.466381]  ? ktime_get+0x38/0x90
> [10887.466389]  __do_fault+0x37/0x90
> [10887.466395]  __handle_mm_fault+0xc46/0x1200
> [10887.466402]  handle_mm_fault+0xce/0x2a0
> [10887.466407]  do_user_addr_fault+0x1c5/0x660
>
> Reverting this commit is reported to fix the issue.
>
> Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>

Could someone give an ack for this? There are at least two separate
user reports for this issue.

> ---
>  drivers/gpu/drm/i915/Kconfig             |  1 -
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
>  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
>  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
>  4 files changed, 52 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index 93f4d059fc89..1e1cb245fca7 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -20,7 +20,6 @@ config DRM_I915
>         select INPUT if ACPI
>         select ACPI_VIDEO if ACPI
>         select ACPI_BUTTON if ACPI
> -       select IO_MAPPING
>         select SYNC_FILE
>         select IOSF_MBI
>         select CRC32
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index f6fe5cb01438..8598a1c78a4c 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
>                 goto err_unpin;
>
>         /* Finally, remap it using the new GTT offset */
> -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> +       ret = remap_io_mapping(area,
> +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> +                              &ggtt->iomap);
>         if (ret)
>                 goto err_fence;
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0f6d27da69ac..e926f20c5b82 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
>                         struct drm_file *file);
>
>  /* i915_mm.c */
> +int remap_io_mapping(struct vm_area_struct *vma,
> +                    unsigned long addr, unsigned long pfn, unsigned long size,
> +                    struct io_mapping *iomap);
>  int remap_io_sg(struct vm_area_struct *vma,
>                 unsigned long addr, unsigned long size,
>                 struct scatterlist *sgl, resource_size_t iobase);
> diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> index 9a777b0ff59b..666808cb3a32 100644
> --- a/drivers/gpu/drm/i915/i915_mm.c
> +++ b/drivers/gpu/drm/i915/i915_mm.c
> @@ -37,6 +37,17 @@ struct remap_pfn {
>         resource_size_t iobase;
>  };
>
> +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> +{
> +       struct remap_pfn *r = data;
> +
> +       /* Special PTE are not associated with any struct page */
> +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> +       r->pfn++;
> +
> +       return 0;
> +}
> +
>  #define use_dma(io) ((io) != -1)
>
>  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
>         return 0;
>  }
>
> +/**
> + * remap_io_mapping - remap an IO mapping to userspace
> + * @vma: user vma to map to
> + * @addr: target user address to start at
> + * @pfn: physical address of kernel memory
> + * @size: size of map area
> + * @iomap: the source io_mapping
> + *
> + *  Note: this is only safe if the mm semaphore is held when called.
> + */
> +int remap_io_mapping(struct vm_area_struct *vma,
> +                    unsigned long addr, unsigned long pfn, unsigned long size,
> +                    struct io_mapping *iomap)
> +{
> +       struct remap_pfn r;
> +       int err;
> +
>  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> +
> +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> +       r.mm = vma->vm_mm;
> +       r.pfn = pfn;
> +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> +
> +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> +       if (unlikely(err)) {
> +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> +               return err;
> +       }
> +
> +       return 0;
> +}
>
>  /**
>   * remap_io_sg - remap an IO mapping to userspace
> --
> 2.26.3
>
> _______________________________________________
> 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] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-06-02  7:28   ` Matthew Auld
  0 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-06-02  7:28 UTC (permalink / raw)
  To: Matthew Auld
  Cc: Thomas Hellström, Daniel Vetter, Intel Graphics Development,
	ML dri-devel, Christoph Hellwig, Eero Tamminen

On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
>
> This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
>
> We are unfortunately seeing more issues like we did in 293837b9ac8d
> ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> now for the vm_fault_gtt path, where we are now hitting the same
> BUG_ON(!pte_none(*pte)):
>
> [10887.466150] kernel BUG at mm/memory.c:2183!
> [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> [10887.466223] Call Trace:
> [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> [10887.466381]  ? ktime_get+0x38/0x90
> [10887.466389]  __do_fault+0x37/0x90
> [10887.466395]  __handle_mm_fault+0xc46/0x1200
> [10887.466402]  handle_mm_fault+0xce/0x2a0
> [10887.466407]  do_user_addr_fault+0x1c5/0x660
>
> Reverting this commit is reported to fix the issue.
>
> Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>

Could someone give an ack for this? There are at least two separate
user reports for this issue.

> ---
>  drivers/gpu/drm/i915/Kconfig             |  1 -
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
>  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
>  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
>  4 files changed, 52 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index 93f4d059fc89..1e1cb245fca7 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -20,7 +20,6 @@ config DRM_I915
>         select INPUT if ACPI
>         select ACPI_VIDEO if ACPI
>         select ACPI_BUTTON if ACPI
> -       select IO_MAPPING
>         select SYNC_FILE
>         select IOSF_MBI
>         select CRC32
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index f6fe5cb01438..8598a1c78a4c 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
>                 goto err_unpin;
>
>         /* Finally, remap it using the new GTT offset */
> -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> +       ret = remap_io_mapping(area,
> +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> +                              &ggtt->iomap);
>         if (ret)
>                 goto err_fence;
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0f6d27da69ac..e926f20c5b82 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
>                         struct drm_file *file);
>
>  /* i915_mm.c */
> +int remap_io_mapping(struct vm_area_struct *vma,
> +                    unsigned long addr, unsigned long pfn, unsigned long size,
> +                    struct io_mapping *iomap);
>  int remap_io_sg(struct vm_area_struct *vma,
>                 unsigned long addr, unsigned long size,
>                 struct scatterlist *sgl, resource_size_t iobase);
> diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> index 9a777b0ff59b..666808cb3a32 100644
> --- a/drivers/gpu/drm/i915/i915_mm.c
> +++ b/drivers/gpu/drm/i915/i915_mm.c
> @@ -37,6 +37,17 @@ struct remap_pfn {
>         resource_size_t iobase;
>  };
>
> +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> +{
> +       struct remap_pfn *r = data;
> +
> +       /* Special PTE are not associated with any struct page */
> +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> +       r->pfn++;
> +
> +       return 0;
> +}
> +
>  #define use_dma(io) ((io) != -1)
>
>  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
>         return 0;
>  }
>
> +/**
> + * remap_io_mapping - remap an IO mapping to userspace
> + * @vma: user vma to map to
> + * @addr: target user address to start at
> + * @pfn: physical address of kernel memory
> + * @size: size of map area
> + * @iomap: the source io_mapping
> + *
> + *  Note: this is only safe if the mm semaphore is held when called.
> + */
> +int remap_io_mapping(struct vm_area_struct *vma,
> +                    unsigned long addr, unsigned long pfn, unsigned long size,
> +                    struct io_mapping *iomap)
> +{
> +       struct remap_pfn r;
> +       int err;
> +
>  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> +
> +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> +       r.mm = vma->vm_mm;
> +       r.pfn = pfn;
> +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> +
> +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> +       if (unlikely(err)) {
> +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> +               return err;
> +       }
> +
> +       return 0;
> +}
>
>  /**
>   * remap_io_sg - remap an IO mapping to userspace
> --
> 2.26.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
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] [PATCH] Revert "i915: use io_mapping_map_user"
  2021-06-02  7:28   ` Matthew Auld
@ 2021-06-02  8:00     ` Daniel Vetter
  -1 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2021-06-02  8:00 UTC (permalink / raw)
  To: Matthew Auld, Joonas Lahtinen, airlied
  Cc: Tvrtko Ursulin, Thomas Hellström,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Linus Torvalds, Eero Tamminen

On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
<matthew.william.auld@gmail.com> wrote:
>
> On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> >
> > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> >
> > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > now for the vm_fault_gtt path, where we are now hitting the same
> > BUG_ON(!pte_none(*pte)):
> >
> > [10887.466150] kernel BUG at mm/memory.c:2183!
> > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > [10887.466223] Call Trace:
> > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > [10887.466381]  ? ktime_get+0x38/0x90
> > [10887.466389]  __do_fault+0x37/0x90
> > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> >
> > Reverting this commit is reported to fix the issue.
> >
> > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>
> Could someone give an ack for this? There are at least two separate
> user reports for this issue.

I was assuming Christoph would ack this, but fwiw:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Also adding Joonas to make sure this doesn't miss the -fixes pull
request train. Also can't hurt to cc Linus since he reverted the other
part of this already in -rc3.
-Daniel
>
> > ---
> >  drivers/gpu/drm/i915/Kconfig             |  1 -
> >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> >  4 files changed, 52 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > index 93f4d059fc89..1e1cb245fca7 100644
> > --- a/drivers/gpu/drm/i915/Kconfig
> > +++ b/drivers/gpu/drm/i915/Kconfig
> > @@ -20,7 +20,6 @@ config DRM_I915
> >         select INPUT if ACPI
> >         select ACPI_VIDEO if ACPI
> >         select ACPI_BUTTON if ACPI
> > -       select IO_MAPPING
> >         select SYNC_FILE
> >         select IOSF_MBI
> >         select CRC32
> > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > index f6fe5cb01438..8598a1c78a4c 100644
> > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> >                 goto err_unpin;
> >
> >         /* Finally, remap it using the new GTT offset */
> > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > +       ret = remap_io_mapping(area,
> > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > +                              &ggtt->iomap);
> >         if (ret)
> >                 goto err_fence;
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 0f6d27da69ac..e926f20c5b82 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> >                         struct drm_file *file);
> >
> >  /* i915_mm.c */
> > +int remap_io_mapping(struct vm_area_struct *vma,
> > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > +                    struct io_mapping *iomap);
> >  int remap_io_sg(struct vm_area_struct *vma,
> >                 unsigned long addr, unsigned long size,
> >                 struct scatterlist *sgl, resource_size_t iobase);
> > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > index 9a777b0ff59b..666808cb3a32 100644
> > --- a/drivers/gpu/drm/i915/i915_mm.c
> > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > @@ -37,6 +37,17 @@ struct remap_pfn {
> >         resource_size_t iobase;
> >  };
> >
> > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > +{
> > +       struct remap_pfn *r = data;
> > +
> > +       /* Special PTE are not associated with any struct page */
> > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > +       r->pfn++;
> > +
> > +       return 0;
> > +}
> > +
> >  #define use_dma(io) ((io) != -1)
> >
> >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> >         return 0;
> >  }
> >
> > +/**
> > + * remap_io_mapping - remap an IO mapping to userspace
> > + * @vma: user vma to map to
> > + * @addr: target user address to start at
> > + * @pfn: physical address of kernel memory
> > + * @size: size of map area
> > + * @iomap: the source io_mapping
> > + *
> > + *  Note: this is only safe if the mm semaphore is held when called.
> > + */
> > +int remap_io_mapping(struct vm_area_struct *vma,
> > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > +                    struct io_mapping *iomap)
> > +{
> > +       struct remap_pfn r;
> > +       int err;
> > +
> >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > +
> > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > +       r.mm = vma->vm_mm;
> > +       r.pfn = pfn;
> > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > +
> > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > +       if (unlikely(err)) {
> > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > +               return err;
> > +       }
> > +
> > +       return 0;
> > +}
> >
> >  /**
> >   * remap_io_sg - remap an IO mapping to userspace
> > --
> > 2.26.3
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [Intel-gfx] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-06-02  8:00     ` Daniel Vetter
  0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2021-06-02  8:00 UTC (permalink / raw)
  To: Matthew Auld, Joonas Lahtinen, airlied
  Cc: Thomas Hellström, Intel Graphics Development, ML dri-devel,
	Christoph Hellwig, Matthew Auld, Linus Torvalds, Eero Tamminen

On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
<matthew.william.auld@gmail.com> wrote:
>
> On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> >
> > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> >
> > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > now for the vm_fault_gtt path, where we are now hitting the same
> > BUG_ON(!pte_none(*pte)):
> >
> > [10887.466150] kernel BUG at mm/memory.c:2183!
> > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > [10887.466223] Call Trace:
> > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > [10887.466381]  ? ktime_get+0x38/0x90
> > [10887.466389]  __do_fault+0x37/0x90
> > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> >
> > Reverting this commit is reported to fix the issue.
> >
> > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>
> Could someone give an ack for this? There are at least two separate
> user reports for this issue.

I was assuming Christoph would ack this, but fwiw:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Also adding Joonas to make sure this doesn't miss the -fixes pull
request train. Also can't hurt to cc Linus since he reverted the other
part of this already in -rc3.
-Daniel
>
> > ---
> >  drivers/gpu/drm/i915/Kconfig             |  1 -
> >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> >  4 files changed, 52 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > index 93f4d059fc89..1e1cb245fca7 100644
> > --- a/drivers/gpu/drm/i915/Kconfig
> > +++ b/drivers/gpu/drm/i915/Kconfig
> > @@ -20,7 +20,6 @@ config DRM_I915
> >         select INPUT if ACPI
> >         select ACPI_VIDEO if ACPI
> >         select ACPI_BUTTON if ACPI
> > -       select IO_MAPPING
> >         select SYNC_FILE
> >         select IOSF_MBI
> >         select CRC32
> > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > index f6fe5cb01438..8598a1c78a4c 100644
> > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> >                 goto err_unpin;
> >
> >         /* Finally, remap it using the new GTT offset */
> > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > +       ret = remap_io_mapping(area,
> > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > +                              &ggtt->iomap);
> >         if (ret)
> >                 goto err_fence;
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 0f6d27da69ac..e926f20c5b82 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> >                         struct drm_file *file);
> >
> >  /* i915_mm.c */
> > +int remap_io_mapping(struct vm_area_struct *vma,
> > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > +                    struct io_mapping *iomap);
> >  int remap_io_sg(struct vm_area_struct *vma,
> >                 unsigned long addr, unsigned long size,
> >                 struct scatterlist *sgl, resource_size_t iobase);
> > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > index 9a777b0ff59b..666808cb3a32 100644
> > --- a/drivers/gpu/drm/i915/i915_mm.c
> > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > @@ -37,6 +37,17 @@ struct remap_pfn {
> >         resource_size_t iobase;
> >  };
> >
> > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > +{
> > +       struct remap_pfn *r = data;
> > +
> > +       /* Special PTE are not associated with any struct page */
> > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > +       r->pfn++;
> > +
> > +       return 0;
> > +}
> > +
> >  #define use_dma(io) ((io) != -1)
> >
> >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> >         return 0;
> >  }
> >
> > +/**
> > + * remap_io_mapping - remap an IO mapping to userspace
> > + * @vma: user vma to map to
> > + * @addr: target user address to start at
> > + * @pfn: physical address of kernel memory
> > + * @size: size of map area
> > + * @iomap: the source io_mapping
> > + *
> > + *  Note: this is only safe if the mm semaphore is held when called.
> > + */
> > +int remap_io_mapping(struct vm_area_struct *vma,
> > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > +                    struct io_mapping *iomap)
> > +{
> > +       struct remap_pfn r;
> > +       int err;
> > +
> >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > +
> > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > +       r.mm = vma->vm_mm;
> > +       r.pfn = pfn;
> > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > +
> > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > +       if (unlikely(err)) {
> > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > +               return err;
> > +       }
> > +
> > +       return 0;
> > +}
> >
> >  /**
> >   * remap_io_sg - remap an IO mapping to userspace
> > --
> > 2.26.3
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
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] [PATCH] Revert "i915: use io_mapping_map_user"
  2021-06-02  8:00     ` Daniel Vetter
@ 2021-06-02 10:10       ` Matthew Auld
  -1 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-06-02 10:10 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Tvrtko Ursulin, Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

On Wed, 2 Jun 2021 at 09:01, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
> <matthew.william.auld@gmail.com> wrote:
> >
> > On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> > >
> > > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> > >
> > > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > > now for the vm_fault_gtt path, where we are now hitting the same
> > > BUG_ON(!pte_none(*pte)):
> > >
> > > [10887.466150] kernel BUG at mm/memory.c:2183!
> > > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > > [10887.466223] Call Trace:
> > > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > > [10887.466381]  ? ktime_get+0x38/0x90
> > > [10887.466389]  __do_fault+0x37/0x90
> > > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> > >
> > > Reverting this commit is reported to fix the issue.
> > >
> > > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > > Cc: Christoph Hellwig <hch@lst.de>
> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> >
> > Could someone give an ack for this? There are at least two separate
> > user reports for this issue.
>
> I was assuming Christoph would ack this, but fwiw:
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Pushed to gt-next. Thanks for the ack Daniel.

>
> Also adding Joonas to make sure this doesn't miss the -fixes pull
> request train. Also can't hurt to cc Linus since he reverted the other
> part of this already in -rc3.
> -Daniel
> >
> > > ---
> > >  drivers/gpu/drm/i915/Kconfig             |  1 -
> > >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> > >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> > >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> > >  4 files changed, 52 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > > index 93f4d059fc89..1e1cb245fca7 100644
> > > --- a/drivers/gpu/drm/i915/Kconfig
> > > +++ b/drivers/gpu/drm/i915/Kconfig
> > > @@ -20,7 +20,6 @@ config DRM_I915
> > >         select INPUT if ACPI
> > >         select ACPI_VIDEO if ACPI
> > >         select ACPI_BUTTON if ACPI
> > > -       select IO_MAPPING
> > >         select SYNC_FILE
> > >         select IOSF_MBI
> > >         select CRC32
> > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > index f6fe5cb01438..8598a1c78a4c 100644
> > > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> > >                 goto err_unpin;
> > >
> > >         /* Finally, remap it using the new GTT offset */
> > > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > > +       ret = remap_io_mapping(area,
> > > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > > +                              &ggtt->iomap);
> > >         if (ret)
> > >                 goto err_fence;
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index 0f6d27da69ac..e926f20c5b82 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> > >                         struct drm_file *file);
> > >
> > >  /* i915_mm.c */
> > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > +                    struct io_mapping *iomap);
> > >  int remap_io_sg(struct vm_area_struct *vma,
> > >                 unsigned long addr, unsigned long size,
> > >                 struct scatterlist *sgl, resource_size_t iobase);
> > > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > > index 9a777b0ff59b..666808cb3a32 100644
> > > --- a/drivers/gpu/drm/i915/i915_mm.c
> > > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > > @@ -37,6 +37,17 @@ struct remap_pfn {
> > >         resource_size_t iobase;
> > >  };
> > >
> > > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > > +{
> > > +       struct remap_pfn *r = data;
> > > +
> > > +       /* Special PTE are not associated with any struct page */
> > > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > > +       r->pfn++;
> > > +
> > > +       return 0;
> > > +}
> > > +
> > >  #define use_dma(io) ((io) != -1)
> > >
> > >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> > >         return 0;
> > >  }
> > >
> > > +/**
> > > + * remap_io_mapping - remap an IO mapping to userspace
> > > + * @vma: user vma to map to
> > > + * @addr: target user address to start at
> > > + * @pfn: physical address of kernel memory
> > > + * @size: size of map area
> > > + * @iomap: the source io_mapping
> > > + *
> > > + *  Note: this is only safe if the mm semaphore is held when called.
> > > + */
> > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > +                    struct io_mapping *iomap)
> > > +{
> > > +       struct remap_pfn r;
> > > +       int err;
> > > +
> > >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > > +
> > > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > > +       r.mm = vma->vm_mm;
> > > +       r.pfn = pfn;
> > > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > > +
> > > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > > +       if (unlikely(err)) {
> > > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > > +               return err;
> > > +       }
> > > +
> > > +       return 0;
> > > +}
> > >
> > >  /**
> > >   * remap_io_sg - remap an IO mapping to userspace
> > > --
> > > 2.26.3
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

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

* Re: [Intel-gfx] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-06-02 10:10       ` Matthew Auld
  0 siblings, 0 replies; 15+ messages in thread
From: Matthew Auld @ 2021-06-02 10:10 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

On Wed, 2 Jun 2021 at 09:01, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
> <matthew.william.auld@gmail.com> wrote:
> >
> > On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> > >
> > > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> > >
> > > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > > now for the vm_fault_gtt path, where we are now hitting the same
> > > BUG_ON(!pte_none(*pte)):
> > >
> > > [10887.466150] kernel BUG at mm/memory.c:2183!
> > > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > > [10887.466223] Call Trace:
> > > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > > [10887.466381]  ? ktime_get+0x38/0x90
> > > [10887.466389]  __do_fault+0x37/0x90
> > > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> > >
> > > Reverting this commit is reported to fix the issue.
> > >
> > > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > > Cc: Christoph Hellwig <hch@lst.de>
> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> >
> > Could someone give an ack for this? There are at least two separate
> > user reports for this issue.
>
> I was assuming Christoph would ack this, but fwiw:
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Pushed to gt-next. Thanks for the ack Daniel.

>
> Also adding Joonas to make sure this doesn't miss the -fixes pull
> request train. Also can't hurt to cc Linus since he reverted the other
> part of this already in -rc3.
> -Daniel
> >
> > > ---
> > >  drivers/gpu/drm/i915/Kconfig             |  1 -
> > >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> > >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> > >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> > >  4 files changed, 52 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > > index 93f4d059fc89..1e1cb245fca7 100644
> > > --- a/drivers/gpu/drm/i915/Kconfig
> > > +++ b/drivers/gpu/drm/i915/Kconfig
> > > @@ -20,7 +20,6 @@ config DRM_I915
> > >         select INPUT if ACPI
> > >         select ACPI_VIDEO if ACPI
> > >         select ACPI_BUTTON if ACPI
> > > -       select IO_MAPPING
> > >         select SYNC_FILE
> > >         select IOSF_MBI
> > >         select CRC32
> > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > index f6fe5cb01438..8598a1c78a4c 100644
> > > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> > >                 goto err_unpin;
> > >
> > >         /* Finally, remap it using the new GTT offset */
> > > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > > +       ret = remap_io_mapping(area,
> > > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > > +                              &ggtt->iomap);
> > >         if (ret)
> > >                 goto err_fence;
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index 0f6d27da69ac..e926f20c5b82 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> > >                         struct drm_file *file);
> > >
> > >  /* i915_mm.c */
> > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > +                    struct io_mapping *iomap);
> > >  int remap_io_sg(struct vm_area_struct *vma,
> > >                 unsigned long addr, unsigned long size,
> > >                 struct scatterlist *sgl, resource_size_t iobase);
> > > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > > index 9a777b0ff59b..666808cb3a32 100644
> > > --- a/drivers/gpu/drm/i915/i915_mm.c
> > > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > > @@ -37,6 +37,17 @@ struct remap_pfn {
> > >         resource_size_t iobase;
> > >  };
> > >
> > > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > > +{
> > > +       struct remap_pfn *r = data;
> > > +
> > > +       /* Special PTE are not associated with any struct page */
> > > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > > +       r->pfn++;
> > > +
> > > +       return 0;
> > > +}
> > > +
> > >  #define use_dma(io) ((io) != -1)
> > >
> > >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> > >         return 0;
> > >  }
> > >
> > > +/**
> > > + * remap_io_mapping - remap an IO mapping to userspace
> > > + * @vma: user vma to map to
> > > + * @addr: target user address to start at
> > > + * @pfn: physical address of kernel memory
> > > + * @size: size of map area
> > > + * @iomap: the source io_mapping
> > > + *
> > > + *  Note: this is only safe if the mm semaphore is held when called.
> > > + */
> > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > +                    struct io_mapping *iomap)
> > > +{
> > > +       struct remap_pfn r;
> > > +       int err;
> > > +
> > >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > > +
> > > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > > +       r.mm = vma->vm_mm;
> > > +       r.pfn = pfn;
> > > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > > +
> > > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > > +       if (unlikely(err)) {
> > > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > > +               return err;
> > > +       }
> > > +
> > > +       return 0;
> > > +}
> > >
> > >  /**
> > >   * remap_io_sg - remap an IO mapping to userspace
> > > --
> > > 2.26.3
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
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] [PATCH] Revert "i915: use io_mapping_map_user"
  2021-06-02 10:10       ` Matthew Auld
@ 2021-06-02 16:29         ` Daniel Vetter
  -1 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2021-06-02 16:29 UTC (permalink / raw)
  To: Matthew Auld, Jani Nikula, Rodrigo Vivi
  Cc: Tvrtko Ursulin, Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

Adding Jani and Rodrigo since drm-intel-fixes is on them.
-Daniel

On Wed, Jun 2, 2021 at 12:10 PM Matthew Auld
<matthew.william.auld@gmail.com> wrote:
>
> On Wed, 2 Jun 2021 at 09:01, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
> > <matthew.william.auld@gmail.com> wrote:
> > >
> > > On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> > > >
> > > > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> > > >
> > > > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > > > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > > > now for the vm_fault_gtt path, where we are now hitting the same
> > > > BUG_ON(!pte_none(*pte)):
> > > >
> > > > [10887.466150] kernel BUG at mm/memory.c:2183!
> > > > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > > > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > > > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > > > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > > > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > > > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > > > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > > > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > > > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > > > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > > > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > > > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > > > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > > > [10887.466223] Call Trace:
> > > > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > > > [10887.466381]  ? ktime_get+0x38/0x90
> > > > [10887.466389]  __do_fault+0x37/0x90
> > > > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > > > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > > > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> > > >
> > > > Reverting this commit is reported to fix the issue.
> > > >
> > > > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > > > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > > > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > > > Cc: Christoph Hellwig <hch@lst.de>
> > > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> > >
> > > Could someone give an ack for this? There are at least two separate
> > > user reports for this issue.
> >
> > I was assuming Christoph would ack this, but fwiw:
> >
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Pushed to gt-next. Thanks for the ack Daniel.
>
> >
> > Also adding Joonas to make sure this doesn't miss the -fixes pull
> > request train. Also can't hurt to cc Linus since he reverted the other
> > part of this already in -rc3.
> > -Daniel
> > >
> > > > ---
> > > >  drivers/gpu/drm/i915/Kconfig             |  1 -
> > > >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> > > >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> > > >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> > > >  4 files changed, 52 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > > > index 93f4d059fc89..1e1cb245fca7 100644
> > > > --- a/drivers/gpu/drm/i915/Kconfig
> > > > +++ b/drivers/gpu/drm/i915/Kconfig
> > > > @@ -20,7 +20,6 @@ config DRM_I915
> > > >         select INPUT if ACPI
> > > >         select ACPI_VIDEO if ACPI
> > > >         select ACPI_BUTTON if ACPI
> > > > -       select IO_MAPPING
> > > >         select SYNC_FILE
> > > >         select IOSF_MBI
> > > >         select CRC32
> > > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > index f6fe5cb01438..8598a1c78a4c 100644
> > > > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> > > >                 goto err_unpin;
> > > >
> > > >         /* Finally, remap it using the new GTT offset */
> > > > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > > > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > > > +       ret = remap_io_mapping(area,
> > > > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > > > +                              &ggtt->iomap);
> > > >         if (ret)
> > > >                 goto err_fence;
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > > index 0f6d27da69ac..e926f20c5b82 100644
> > > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> > > >                         struct drm_file *file);
> > > >
> > > >  /* i915_mm.c */
> > > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > > +                    struct io_mapping *iomap);
> > > >  int remap_io_sg(struct vm_area_struct *vma,
> > > >                 unsigned long addr, unsigned long size,
> > > >                 struct scatterlist *sgl, resource_size_t iobase);
> > > > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > > > index 9a777b0ff59b..666808cb3a32 100644
> > > > --- a/drivers/gpu/drm/i915/i915_mm.c
> > > > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > > > @@ -37,6 +37,17 @@ struct remap_pfn {
> > > >         resource_size_t iobase;
> > > >  };
> > > >
> > > > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > > > +{
> > > > +       struct remap_pfn *r = data;
> > > > +
> > > > +       /* Special PTE are not associated with any struct page */
> > > > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > > > +       r->pfn++;
> > > > +
> > > > +       return 0;
> > > > +}
> > > > +
> > > >  #define use_dma(io) ((io) != -1)
> > > >
> > > >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > > > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> > > >         return 0;
> > > >  }
> > > >
> > > > +/**
> > > > + * remap_io_mapping - remap an IO mapping to userspace
> > > > + * @vma: user vma to map to
> > > > + * @addr: target user address to start at
> > > > + * @pfn: physical address of kernel memory
> > > > + * @size: size of map area
> > > > + * @iomap: the source io_mapping
> > > > + *
> > > > + *  Note: this is only safe if the mm semaphore is held when called.
> > > > + */
> > > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > > +                    struct io_mapping *iomap)
> > > > +{
> > > > +       struct remap_pfn r;
> > > > +       int err;
> > > > +
> > > >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > > > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > > > +
> > > > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > > > +       r.mm = vma->vm_mm;
> > > > +       r.pfn = pfn;
> > > > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > > > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > > > +
> > > > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > > > +       if (unlikely(err)) {
> > > > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > > > +               return err;
> > > > +       }
> > > > +
> > > > +       return 0;
> > > > +}
> > > >
> > > >  /**
> > > >   * remap_io_sg - remap an IO mapping to userspace
> > > > --
> > > > 2.26.3
> > > >
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [Intel-gfx] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-06-02 16:29         ` Daniel Vetter
  0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2021-06-02 16:29 UTC (permalink / raw)
  To: Matthew Auld, Jani Nikula, Rodrigo Vivi
  Cc: Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

Adding Jani and Rodrigo since drm-intel-fixes is on them.
-Daniel

On Wed, Jun 2, 2021 at 12:10 PM Matthew Auld
<matthew.william.auld@gmail.com> wrote:
>
> On Wed, 2 Jun 2021 at 09:01, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > On Wed, Jun 2, 2021 at 9:28 AM Matthew Auld
> > <matthew.william.auld@gmail.com> wrote:
> > >
> > > On Thu, 27 May 2021 at 19:52, Matthew Auld <matthew.auld@intel.com> wrote:
> > > >
> > > > This reverts commit b739f125e4ebd73d10ed30a856574e13649119ed.
> > > >
> > > > We are unfortunately seeing more issues like we did in 293837b9ac8d
> > > > ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
> > > > now for the vm_fault_gtt path, where we are now hitting the same
> > > > BUG_ON(!pte_none(*pte)):
> > > >
> > > > [10887.466150] kernel BUG at mm/memory.c:2183!
> > > > [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
> > > > [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
> > > > [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
> > > > [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
> > > > [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
> > > > [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
> > > > [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
> > > > [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
> > > > [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
> > > > [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
> > > > [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
> > > > [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
> > > > [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > > [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
> > > > [10887.466223] Call Trace:
> > > > [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
> > > > [10887.466381]  ? ktime_get+0x38/0x90
> > > > [10887.466389]  __do_fault+0x37/0x90
> > > > [10887.466395]  __handle_mm_fault+0xc46/0x1200
> > > > [10887.466402]  handle_mm_fault+0xce/0x2a0
> > > > [10887.466407]  do_user_addr_fault+0x1c5/0x660
> > > >
> > > > Reverting this commit is reported to fix the issue.
> > > >
> > > > Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
> > > > References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
> > > > Fixes: b739f125e4eb ("i915: use io_mapping_map_user")
> > > > Cc: Christoph Hellwig <hch@lst.de>
> > > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> > >
> > > Could someone give an ack for this? There are at least two separate
> > > user reports for this issue.
> >
> > I was assuming Christoph would ack this, but fwiw:
> >
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Pushed to gt-next. Thanks for the ack Daniel.
>
> >
> > Also adding Joonas to make sure this doesn't miss the -fixes pull
> > request train. Also can't hurt to cc Linus since he reverted the other
> > part of this already in -rc3.
> > -Daniel
> > >
> > > > ---
> > > >  drivers/gpu/drm/i915/Kconfig             |  1 -
> > > >  drivers/gpu/drm/i915/gem/i915_gem_mman.c |  9 ++---
> > > >  drivers/gpu/drm/i915/i915_drv.h          |  3 ++
> > > >  drivers/gpu/drm/i915/i915_mm.c           | 44 ++++++++++++++++++++++++
> > > >  4 files changed, 52 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > > > index 93f4d059fc89..1e1cb245fca7 100644
> > > > --- a/drivers/gpu/drm/i915/Kconfig
> > > > +++ b/drivers/gpu/drm/i915/Kconfig
> > > > @@ -20,7 +20,6 @@ config DRM_I915
> > > >         select INPUT if ACPI
> > > >         select ACPI_VIDEO if ACPI
> > > >         select ACPI_BUTTON if ACPI
> > > > -       select IO_MAPPING
> > > >         select SYNC_FILE
> > > >         select IOSF_MBI
> > > >         select CRC32
> > > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > index f6fe5cb01438..8598a1c78a4c 100644
> > > > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> > > > @@ -367,10 +367,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
> > > >                 goto err_unpin;
> > > >
> > > >         /* Finally, remap it using the new GTT offset */
> > > > -       ret = io_mapping_map_user(&ggtt->iomap, area, area->vm_start +
> > > > -                       (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > > -                       (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > > -                       min_t(u64, vma->size, area->vm_end - area->vm_start));
> > > > +       ret = remap_io_mapping(area,
> > > > +                              area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
> > > > +                              (ggtt->gmadr.start + vma->node.start) >> PAGE_SHIFT,
> > > > +                              min_t(u64, vma->size, area->vm_end - area->vm_start),
> > > > +                              &ggtt->iomap);
> > > >         if (ret)
> > > >                 goto err_fence;
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > > index 0f6d27da69ac..e926f20c5b82 100644
> > > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > > @@ -1941,6 +1941,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> > > >                         struct drm_file *file);
> > > >
> > > >  /* i915_mm.c */
> > > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > > +                    struct io_mapping *iomap);
> > > >  int remap_io_sg(struct vm_area_struct *vma,
> > > >                 unsigned long addr, unsigned long size,
> > > >                 struct scatterlist *sgl, resource_size_t iobase);
> > > > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> > > > index 9a777b0ff59b..666808cb3a32 100644
> > > > --- a/drivers/gpu/drm/i915/i915_mm.c
> > > > +++ b/drivers/gpu/drm/i915/i915_mm.c
> > > > @@ -37,6 +37,17 @@ struct remap_pfn {
> > > >         resource_size_t iobase;
> > > >  };
> > > >
> > > > +static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
> > > > +{
> > > > +       struct remap_pfn *r = data;
> > > > +
> > > > +       /* Special PTE are not associated with any struct page */
> > > > +       set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
> > > > +       r->pfn++;
> > > > +
> > > > +       return 0;
> > > > +}
> > > > +
> > > >  #define use_dma(io) ((io) != -1)
> > > >
> > > >  static inline unsigned long sgt_pfn(const struct remap_pfn *r)
> > > > @@ -66,7 +77,40 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
> > > >         return 0;
> > > >  }
> > > >
> > > > +/**
> > > > + * remap_io_mapping - remap an IO mapping to userspace
> > > > + * @vma: user vma to map to
> > > > + * @addr: target user address to start at
> > > > + * @pfn: physical address of kernel memory
> > > > + * @size: size of map area
> > > > + * @iomap: the source io_mapping
> > > > + *
> > > > + *  Note: this is only safe if the mm semaphore is held when called.
> > > > + */
> > > > +int remap_io_mapping(struct vm_area_struct *vma,
> > > > +                    unsigned long addr, unsigned long pfn, unsigned long size,
> > > > +                    struct io_mapping *iomap)
> > > > +{
> > > > +       struct remap_pfn r;
> > > > +       int err;
> > > > +
> > > >  #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > > > +       GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
> > > > +
> > > > +       /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> > > > +       r.mm = vma->vm_mm;
> > > > +       r.pfn = pfn;
> > > > +       r.prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> > > > +                         (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> > > > +
> > > > +       err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
> > > > +       if (unlikely(err)) {
> > > > +               zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
> > > > +               return err;
> > > > +       }
> > > > +
> > > > +       return 0;
> > > > +}
> > > >
> > > >  /**
> > > >   * remap_io_sg - remap an IO mapping to userspace
> > > > --
> > > > 2.26.3
> > > >
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
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] [PATCH] Revert "i915: use io_mapping_map_user"
  2021-06-02 16:29         ` Daniel Vetter
@ 2021-06-03  8:41           ` Jani Nikula
  -1 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2021-06-03  8:41 UTC (permalink / raw)
  To: Daniel Vetter, Matthew Auld, Rodrigo Vivi
  Cc: Tvrtko Ursulin, Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

On Wed, 02 Jun 2021, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Adding Jani and Rodrigo since drm-intel-fixes is on them.

Just sent the fixes pull request with this for v5.13-rc5:

https://lore.kernel.org/r/87lf7rpcmp.fsf@intel.com


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] [PATCH] Revert "i915: use io_mapping_map_user"
@ 2021-06-03  8:41           ` Jani Nikula
  0 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2021-06-03  8:41 UTC (permalink / raw)
  To: Daniel Vetter, Matthew Auld, Rodrigo Vivi
  Cc: Thomas Hellström, Linus Torvalds,
	Intel Graphics Development, ML dri-devel, Christoph Hellwig,
	Matthew Auld, Eero Tamminen

On Wed, 02 Jun 2021, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Adding Jani and Rodrigo since drm-intel-fixes is on them.

Just sent the fixes pull request with this for v5.13-rc5:

https://lore.kernel.org/r/87lf7rpcmp.fsf@intel.com


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
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

end of thread, other threads:[~2021-06-03  8:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 18:51 [PATCH] Revert "i915: use io_mapping_map_user" Matthew Auld
2021-05-27 18:51 ` [Intel-gfx] " Matthew Auld
2021-05-27 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-05-27 22:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-05-28 20:41 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-02  7:28 ` [Intel-gfx] [PATCH] " Matthew Auld
2021-06-02  7:28   ` Matthew Auld
2021-06-02  8:00   ` Daniel Vetter
2021-06-02  8:00     ` Daniel Vetter
2021-06-02 10:10     ` Matthew Auld
2021-06-02 10:10       ` Matthew Auld
2021-06-02 16:29       ` Daniel Vetter
2021-06-02 16:29         ` Daniel Vetter
2021-06-03  8:41         ` Jani Nikula
2021-06-03  8:41           ` Jani Nikula

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.