linux/drivers/gpu/drm/i915
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
..
display drm/i915/psr: Send update also on invalidate 2022-11-07 13:13:00 +00:00
gem drm/i915/userptr: restore probe_range behaviour 2022-11-07 13:13:09 +00:00
gt drm/i915: Extend Wa_1607297627 to Alderlake-P 2022-10-24 10:14:48 +01:00
gvt VFIO updates for v6.1-rc1 2022-10-12 14:46:48 -07:00
pxp 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
selftests treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
.gitignore
i915_active_types.h
i915_active.c drm/i915: Bump GT idling delay to 2 jiffies 2022-07-12 17:44:40 -04:00
i915_active.h drm/i915: Remove unused bits of i915_vma/active api 2021-12-20 16:26:09 +01:00
i915_cmd_parser.c drm/i915: include linux/highmem.h and linux/swap.h where needed 2022-03-04 11:15:25 +02:00
i915_cmd_parser.h drm/i915: split out i915_cmd_parser.h from i915_drv.h 2022-01-10 15:43:09 +02:00
i915_config.c
i915_debugfs_params.c drm/i915: Use to_gt() helper 2021-12-17 21:51:59 -08:00
i915_debugfs_params.h
i915_debugfs.c Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:51:00 +10:00
i915_debugfs.h
i915_deps.c drm/i915: fix broken build 2022-04-08 10:36:11 +02:00
i915_deps.h drm/i915: Break out the i915_deps utility 2021-12-22 08:52:57 +01:00
i915_driver.c drm/i915/tgl+: Add locking around DKL PHY register accesses 2022-10-31 12:31:57 +00:00
i915_driver.h drm/i915: Move intel_vtd_active and run_as_guest to i915_utils 2022-03-30 12:04:01 +01:00
i915_drm_client.c drm/i915/fdinfo: Don't show engine classes not present 2022-06-20 13:07:49 +03:00
i915_drm_client.h drm/i915/client: only include what's needed 2022-06-07 21:31:17 +03:00
i915_drv.h drm/i915/display: remove ipc_enabled from struct drm_i915_private 2022-09-27 11:05:15 +01:00
i915_file_private.h drm/i915: Explicitly track DRM clients 2022-04-05 08:38:49 +01:00
i915_fixed.h
i915_gem_evict.c Merge tag 'drm-intel-gt-next-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next 2022-02-23 15:03:51 -05:00
i915_gem_evict.h Merge tag 'drm-intel-gt-next-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next 2022-02-23 15:03:51 -05:00
i915_gem_gtt.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
i915_gem_gtt.h drm/i915: Remove short-term pins from execbuf, v6. 2022-01-18 12:19:30 +01:00
i915_gem_ww.c
i915_gem_ww.h
i915_gem.c drm pull for 6.1-rc1 2022-10-05 11:24:12 -07:00
i915_gem.h Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:51:00 +10:00
i915_getparam.c drm/i915: move overlay to display.overlay 2022-08-29 13:24:26 +03:00
i915_getparam.h drm/i915: split out i915_getparam.h from i915_drv.h 2022-01-10 15:43:05 +02:00
i915_gpu_error.c 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_gpu_error.h drm/i915/guc: Record CTB info in error logs 2022-08-17 10:06:59 -07:00
i915_ioc32.c drm/i915: split out i915_getparam.h from i915_drv.h 2022-01-10 15:43:05 +02:00
i915_ioc32.h
i915_ioctl.c drm/i915: split out i915_reg_read_ioctl() to i915_ioctl.[ch] 2022-01-21 09:59:22 +02:00
i915_ioctl.h drm/i915: split out i915_reg_read_ioctl() to i915_ioctl.[ch] 2022-01-21 09:59:22 +02:00
i915_iosf_mbi.h
i915_irq.c Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:51:00 +10:00
i915_irq.h drm/i915/hpd: hide struct intel_hotplug_funcs 2022-02-09 13:39:35 +02:00
i915_memcpy.c
i915_memcpy.h
i915_mitigations.c drm/i915: move the DRIVER_* macros to i915_driver.[ch] 2022-02-10 11:44:25 +02:00
i915_mitigations.h
i915_mm.c
i915_mm.h drm/i915: Fix header test for !CONFIG_X86 2022-02-07 12:56:49 +00:00
i915_module.c Merge tag 'drm-intel-gt-next-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next 2022-02-23 15:03:51 -05:00
i915_params.c drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers. 2022-09-24 15:02:01 +02:00
i915_params.h drm/i915/guc: Remove log size module parameters 2022-08-29 15:02:48 +03:00
i915_pci.c drm/i915: fix device info for devices without display 2022-09-27 11:05:26 +01:00
i915_pci.h drm/i915: Sanitycheck PCI BARs 2022-08-10 13:11:17 +03:00
i915_perf_oa_regs.h drm/i915/perf: Express OA register ranges with i915_range 2022-02-02 07:52:23 -08:00
i915_perf_types.h drm/i915: Fix CFI violation with show_dynamic_id() 2022-05-19 12:10:57 +03:00
i915_perf.c drm/i915/perf: replace BUG_ON() with WARN_ON() 2022-08-31 18:34:10 +03:00
i915_perf.h
i915_pmu.c Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
i915_pmu.h
i915_priolist_types.h
i915_pvinfo.h
i915_query.c drm/i915/uapi: expose the avail tracking 2022-07-01 08:29:59 +01:00
i915_query.h
i915_reg_defs.h drm/i915/gt: Remove GEN12_SFC_DONE_MAX from register defs header 2022-03-11 08:18:27 -08:00
i915_reg.h drm/i915/tgl+: Add locking around DKL PHY register accesses 2022-10-31 12:31:57 +00:00
i915_request.c Revert "drm/i915: Hold reference to intel_context over life of i915_request" 2022-06-27 23:47:26 +05:30
i915_request.h drm/i915: Do not access rq->engine without a reference 2022-06-27 23:46:35 +05:30
i915_scatterlist.c drm/i915/ttm: fix 32b build 2022-07-17 14:53:47 -04:00
i915_scatterlist.h drm/i915: stop abusing swiotlb_max_segment 2022-10-31 12:32:04 +00:00
i915_scheduler_types.h
i915_scheduler.c
i915_scheduler.h drm/i915/tasklet: separate local hacks around struct tasklet_struct 2022-06-07 21:47:19 +03:00
i915_selftest.h Revert "drm/i915/guc: Add delay to disable scheduling after pin count goes to zero" 2022-08-20 09:41:56 -07:00
i915_suspend.c drm/i915/fbc: Remove intel_fbc_global_disable() 2022-04-13 17:19:04 +03:00
i915_suspend.h
i915_sw_fence_work.c
i915_sw_fence_work.h
i915_sw_fence.c drm/i915/fence: replace BUG_ON() with BUILD_BUG_ON() 2022-08-31 18:34:11 +03:00
i915_sw_fence.h drm/i915/fence: replace BUG_ON() with BUILD_BUG_ON() 2022-08-31 18:34:11 +03:00
i915_switcheroo.c
i915_switcheroo.h
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915/gt: Fix memory leaks in per-gt sysfs 2022-06-13 13:04:31 +03:00
i915_sysfs.h drm/i915/gt: create per-tile sysfs interface 2022-03-21 08:37:39 +00:00
i915_tasklet.h drm/i915/tasklet: separate local hacks around struct tasklet_struct 2022-06-07 21:47:19 +03:00
i915_trace_points.c
i915_trace.h
i915_ttm_buddy_manager.c drm/i915: Implement intersect/compatible functions 2022-08-22 15:35:45 +02:00
i915_ttm_buddy_manager.h drm/i915/uapi: expose the avail tracking 2022-07-01 08:29:59 +01:00
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: Move intel_vtd_active and run_as_guest to i915_utils 2022-03-30 12:04:01 +01:00
i915_utils.h drm/i915/utils: remove unused KBps/MBps/GBps macros 2022-08-23 15:38:30 +03:00
i915_vgpu.c drm/i915: Add object locking to i915_gem_evict_for_node and i915_gem_evict_something, v2. 2022-01-18 12:18:03 +01:00
i915_vgpu.h
i915_vma_resource.c drm/i915/gt: Batch TLB invalidations 2022-08-08 14:06:55 -04:00
i915_vma_resource.h drm/i915/gt: Batch TLB invalidations 2022-08-08 14:06:55 -04:00
i915_vma_types.h drm/i915: Rename ggtt_view as gtt_view 2022-09-08 10:24:17 +01:00
i915_vma.c drm/i915: Set correct domains values at _i915_vma_move_to_active 2022-09-12 09:56:50 -04:00
i915_vma.h drm/i915: Rename ggtt_view as gtt_view 2022-09-08 10:24:17 +01:00
intel_device_info.c drm/i915: fix device info for devices without display 2022-09-27 11:05:26 +01:00
intel_device_info.h Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:51:00 +10:00
intel_dram.c drm/i915/mtl: Obtain SAGV values from MMIO instead of GT pcode mailbox 2022-09-12 15:25:19 -07:00
intel_dram.h
intel_gvt_mmio_table.c drm pull for 6.1-rc1 2022-10-05 11:24:12 -07:00
intel_gvt.c drm/i915/gvt: Fix the compiling error when CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n 2022-04-28 17:01:17 -04:00
intel_gvt.h drm/i915/gvt: move the gvt code into kvmgt.ko 2022-04-21 07:36:56 -04:00
intel_mchbar_regs.h drm/i915/guc/slpc: Allow SLPC to use efficient frequency 2022-08-24 09:17:15 -04:00
intel_memory_region.c drm/i915: remove intel_memory_region avail 2022-07-01 08:29:59 +01:00
intel_memory_region.h drm/i915: remove intel_memory_region avail 2022-07-01 08:29:59 +01:00
intel_pch.c drm/i915/mtl: Add PCH support 2022-08-25 12:50:40 -07:00
intel_pch.h drm/i915/mtl: Add PCH support 2022-08-25 12:50:40 -07:00
intel_pci_config.h drm/i915: Use of BARs names instead of numbers 2022-08-10 13:11:14 +03:00
intel_pcode.c drm/i915/pcode: Add a couple of pcode helpers 2022-05-20 09:11:45 +01:00
intel_pcode.h drm/i915/pcode: Add a couple of pcode helpers 2022-05-20 09:11:45 +01:00
intel_pm_types.h
intel_pm.c Merge tag 'drm-intel-next-2022-09-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-09-21 07:51:00 +10:00
intel_pm.h drm/i915: Extract skl_watermark.c 2022-09-09 16:50:33 +03:00
intel_region_ttm.c drm/i915/ttm: fix 32b build 2022-07-17 14:53:47 -04:00
intel_region_ttm.h drm/i915/ttm: fix 32b build 2022-07-17 14:53:47 -04:00
intel_runtime_pm.c drm/i915/dgfx: Keep PCI autosuspend control 'on' by default on all dGPU 2022-10-24 10:14:54 +01:00
intel_runtime_pm.h drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device 2022-02-11 13:22:10 +02:00
intel_sbi.c drm/i915: Only include i915_reg.h from .c files 2022-02-02 07:59:54 -08:00
intel_sbi.h
intel_step.c drm/i915/pvc: Extract stepping information from PCI revid 2022-05-31 14:44:57 -07:00
intel_step.h drm/i915/pvc: Extract stepping information from PCI revid 2022-05-31 14:44:57 -07:00
intel_uncore.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
intel_uncore.h drm/i915/uncore: Add GSI offset to uncore 2022-09-12 15:23:12 +03:00
intel_wakeref.c
intel_wakeref.h
intel_wopcm.c drm/i915/wopcm: Handle pre-programmed WOPCM registers 2022-01-26 11:47:24 -08:00
intel_wopcm.h
Kconfig ACPI: video: Add Nvidia WMI EC brightness control detection (v3) 2022-09-03 12:17:26 +02:00
Kconfig.debug
Kconfig.profile
Kconfig.unstable drm/i915: Kill the fake lmem support 2022-02-18 22:31:46 -08:00
Makefile drm/i915/tgl+: Add locking around DKL PHY register accesses 2022-10-31 12:31:57 +00:00
TODO.txt drm/i915/tasklet: separate local hacks around struct tasklet_struct 2022-06-07 21:47:19 +03:00
vlv_sideband_reg.h drm/i915: split out vlv sideband registers from i915_reg.h 2022-01-10 16:17:50 +02:00
vlv_sideband.c drm/i915: Only include i915_reg.h from .c files 2022-02-02 07:59:54 -08:00
vlv_sideband.h drm/i915: split out vlv sideband registers from i915_reg.h 2022-01-10 16:17:50 +02:00
vlv_suspend.c drm/i915: Use str_on_off() 2022-03-02 08:48:23 -08:00
vlv_suspend.h