linux_dsm_epyc7002/drivers/gpu/drm/i915
Daniel Vetter 8c59967c44 drm/i915: rewrite shmem_pwrite_slow to use copy_from_user
... instead of get_user_pages, because that fails on non page-backed
user addresses like e.g. a gtt mapping of a bo.

To get there essentially copy the vfs read path into pagecache. We
can't call that right away because we have to take care of bit17
swizzling. To not deadlock with our own pagefault handler we need
to completely drop struct_mutex, reducing the atomicty-guarantees
of our userspace abi. Implications for racing with other gem ioctl:

- execbuf, pwrite, pread: Due to -EFAULT fallback to slow paths there's
  already the risk of the pwrite call not being atomic, no degration.
- read/write access to mmaps: already fully racy, no degration.
- set_tiling: Calling set_tiling while reading/writing is already
  pretty much undefined, now it just got a bit worse. set_tiling is
  only called by libdrm on unused/new bos, so no problem.
- set_domain: When changing to the gtt domain while copying (without any
  read/write access, e.g. for synchronization), we might leave unflushed
  data in the cpu caches. The clflush_object at the end of pwrite_slow
  takes care of this problem.
- truncating of purgeable objects: the shmem_read_mapping_page call could
  reinstate backing storage for truncated objects. The check at the end
  of pwrite_slow takes care of this.

v2:
- add missing intel_gtt_chipset_flush
- add __ to copy_from_user_swizzled as suggest by Chris Wilson.

v3: Fixup bit17 swizzling, it swizzled the wrong pages.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-30 23:34:21 +01:00
..
dvo_ch7xxx.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ch7017.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ivch.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_sil164.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_tfp410.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo.h
i915_debugfs.c drm/i915: add debugfs file for swizzling information 2012-01-30 21:21:08 +01:00
i915_dma.c drm/i915: argument to control retiring behavior 2012-01-26 11:19:19 +01:00
i915_drv.c drm/i915: add a LLC feature flag in device description 2012-01-17 20:01:45 +01:00
i915_drv.h drm/i915: add per-ring fault reg to error_state 2012-01-29 23:17:52 +01:00
i915_gem_debug.c drm/i915: drop KM_USER0 argument to k(un)map_atomic 2011-10-20 15:26:37 -07:00
i915_gem_evict.c drm/i915: argument to control retiring behavior 2012-01-26 11:19:19 +01:00
i915_gem_execbuffer.c drm/i915: reject GTT domain in relocations 2012-01-29 18:37:10 +01:00
i915_gem_gtt.c drm/i915: drm/i915: Fix recursive calls to unmap 2012-01-26 11:25:51 +01:00
i915_gem_tiling.c drm/i915: fix swizzle detection for gen3 2012-01-30 21:19:15 +01:00
i915_gem.c drm/i915: rewrite shmem_pwrite_slow to use copy_from_user 2012-01-30 23:34:21 +01:00
i915_ioc32.c
i915_irq.c drm/i915: add per-ring fault reg to error_state 2012-01-29 23:17:52 +01:00
i915_reg.h drm/i915: add per-ring fault reg to error_state 2012-01-29 23:17:52 +01:00
i915_suspend.c drm/i915: Ivybridge still has fences! 2011-11-03 09:20:00 -07:00
i915_trace_points.c
i915_trace.h Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_acpi.c drm/i915: Silence _DSM errors 2012-01-16 21:08:19 +01:00
intel_bios.c drm/i915: Use kcalloc instead of kzalloc to allocate array 2012-01-17 17:33:24 +01:00
intel_bios.h drm/i915: Remove "i2c_speed" nonsense from child device table 2011-10-20 14:11:15 -07:00
intel_crt.c drm/i915: use transcoder select bits on VGA and HDMI on CPT 2011-10-20 15:26:43 -07:00
intel_display.c drm/i915: Separate fence pin counting from normal bind pin counting 2012-01-29 18:23:37 +01:00
intel_dp.c drm/i915/dp: Check for AUXCH error before checking for success 2012-01-17 16:47:00 +01:00
intel_drv.h drm/i915: Separate fence pin counting from normal bind pin counting 2012-01-29 18:23:37 +01:00
intel_dvo.c
intel_fb.c drm/i915: add SNB and IVB video sprite support v6 2012-01-03 09:31:09 -08:00
intel_hdmi.c drm/i915: HDMI hot remove notification to audio driver 2011-12-19 19:15:48 -08:00
intel_i2c.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
intel_lvds.c drm/i915: no-lvds quirk for ASUS AT5NM10T-I 2011-12-16 08:49:54 -08:00
intel_modes.c drm/i915: pass ELD to HDMI/DP audio driver 2011-09-21 14:52:41 -07:00
intel_opregion.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_overlay.c drm/i915: argument to control retiring behavior 2012-01-26 11:19:19 +01:00
intel_panel.c drivers: i915: Fix BLC PWM register setup 2012-01-17 11:42:29 +01:00
intel_ringbuffer.c drm/i915/ringbuffer: kill snb blt workaround 2012-01-29 17:50:40 +01:00
intel_ringbuffer.h drm/i915: switch ring->id to be a real id 2012-01-29 17:32:58 +01:00
intel_sdvo_regs.h Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_sdvo.c drm/i915/sdvo: Include LVDS panels for the IS_DIGITAL check 2011-12-16 08:49:56 -08:00
intel_sprite.c drm/i915: Separate fence pin counting from normal bind pin counting 2012-01-29 18:23:37 +01:00
intel_tv.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
Makefile drm/i915: kill i915_mem.c 2012-01-17 20:01:01 +01:00