linux/drivers/gpu/drm/i915/gem
Matthew Auld 178e31ce82 drm/i915/userptr: restore probe_range behaviour
The conversion looks harmless, however the addr value is updated inside
the loop with the previous vm_end, which then incorrectly leads to
for_each_vma_range() iterating over stuff outside the range we care
about. Fix this by storing the end value separately. Also fix the case
where the range doesn't intersect with any vma, or if the vma itself
doesn't extend the entire range, which must mean we have hole at the
end. Both should result in an error, as per the previous behaviour.

v2: Fix the cases where the range is empty, or if there's a hole at
the end of the range

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7247
Testcase: igt@gem_userptr_blits@probe
Fixes: f683b9d613 ("i915: use the VMA iterator")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221028130635.465839-1-matthew.auld@intel.com
(cherry picked from commit 6f7de35b50860c345babf8ed0aa0d75f9315eee4)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2022-11-07 13:13:09 +00:00
..
selftests Merge tag 'drm-intel-next-2022-08-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-15 22:38:13 +10:00
i915_gem_busy.c dma-buf: specify usage while adding fences to dma_resv obj v7 2022-04-07 12:53:53 +02:00
i915_gem_clflush.c dma-buf: add DMA_RESV_USAGE_KERNEL v3 2022-04-07 12:53:54 +02:00
i915_gem_clflush.h
i915_gem_context_types.h drm/i915: Fixup kerneldoc in struct i915_gem_context 2022-04-06 08:33:40 +01:00
i915_gem_context.c drm fixes for 6.1-rc1 2022-10-13 21:56:34 -07:00
i915_gem_context.h
i915_gem_create.c drm/i915/uapi: add NEEDS_CPU_ACCESS hint 2022-07-01 08:30:00 +01:00
i915_gem_create.h drm/i915: split out gem/i915_gem_create.h from i915_drv.h 2022-02-11 14:43:28 +02:00
i915_gem_dmabuf.c drm/i915/dmabuf: fix sg_table handling in map_dma_buf 2022-11-07 13:12:57 +00:00
i915_gem_dmabuf.h drm/i915: split out gem/i915_gem_dmabuf.h from i915_drv.h 2022-02-11 13:50:37 +02:00
i915_gem_domain.c drm/i915: Rename ggtt_view as gtt_view 2022-09-08 10:24:17 +01:00
i915_gem_domain.h drm/i915: split out gem/i915_gem_domain.h from i915_drv.h 2022-02-14 11:25:52 +02:00
i915_gem_execbuffer.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
i915_gem_internal.c drm/i915: stop abusing swiotlb_max_segment 2022-10-31 12:32:04 +00:00
i915_gem_internal.h drm/i915: split out i915_gem_internal.h from i915_drv.h 2022-02-11 12:52:50 +02:00
i915_gem_ioctls.h
i915_gem_lmem.c Merge tag 'drm-intel-next-2022-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-gt-next 2022-05-23 09:34:47 +01:00
i915_gem_lmem.h drm/i915: remove unused i915_gem_lmem_obj_ops declaration 2022-09-13 20:33:27 +03:00
i915_gem_mman.c drm/i915/dgfx: Release mmap on rpm suspend 2022-09-14 18:19:59 +05:30
i915_gem_mman.h drm/i915/dgfx: Release mmap on rpm suspend 2022-09-14 18:19:59 +05:30
i915_gem_object_types.h drm/i915: allow control over the flags when migrating 2022-10-11 17:28:48 +01:00
i915_gem_object.c drm/i915: allow control over the flags when migrating 2022-10-11 17:28:48 +01:00
i915_gem_object.h drm/i915: allow control over the flags when migrating 2022-10-11 17:28:48 +01:00
i915_gem_pages.c Merge drm/drm-next into drm-intel-next 2022-08-29 15:14:59 +03:00
i915_gem_phys.c drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] 2022-03-17 11:35:36 +02:00
i915_gem_pm.c drm/i915: Refactor userfault_wakeref to re-use 2022-09-14 18:18:55 +05:30
i915_gem_pm.h
i915_gem_region.c drm/i915/ttm: fix 32b build 2022-07-17 14:53:47 -04:00
i915_gem_region.h drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_shmem.c drm/i915: Do not set cache_dirty for DGFX 2022-11-07 13:13:04 +00:00
i915_gem_shrinker.c - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
i915_gem_shrinker.h
i915_gem_stolen.c Merge tag 'drm-intel-gt-next-2022-09-16' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:42:47 +10:00
i915_gem_stolen.h drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_throttle.c drm/i915: split out i915_file_private.h from i915_drv.h 2022-02-14 13:16:28 +02:00
i915_gem_tiling.c drm/i915: split gem quirks from display quirks 2022-08-29 14:31:53 +03:00
i915_gem_tiling.h drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] 2022-03-17 11:35:36 +02:00
i915_gem_ttm_move.c drm/i915/ttm: disallow CPU fallback mode for ccs pages 2022-07-01 08:30:31 +01:00
i915_gem_ttm_move.h drm/i915/ttm: handle blitter failure on DG2 2022-07-01 08:30:00 +01:00
i915_gem_ttm_pm.c drm/i915/ttm: Abort suspend on i915_ttm_backup failure 2022-09-05 10:22:42 +01:00
i915_gem_ttm_pm.h
i915_gem_ttm.c drm/i915: stop abusing swiotlb_max_segment 2022-10-31 12:32:04 +00:00
i915_gem_ttm.h drm/i915/ttm: handle blitter failure on DG2 2022-07-01 08:30:00 +01:00
i915_gem_userptr.c drm/i915/userptr: restore probe_range behaviour 2022-11-07 13:13:09 +00:00
i915_gem_userptr.h
i915_gem_wait.c drm/i915/gem: Look for waitboosting across the whole object prior to individual waits 2022-07-12 18:21:55 -04:00
i915_gemfs.c drm/i915: Only setup private tmpfs mount when needed and fix logging 2022-05-09 14:03:50 +01:00
i915_gemfs.h drm/i915: Only setup private tmpfs mount when needed and fix logging 2022-05-09 14:03:50 +01:00