1. 03 7月, 2020 1 次提交
  2. 02 7月, 2020 1 次提交
  3. 12 6月, 2020 1 次提交
  4. 28 5月, 2020 1 次提交
  5. 22 5月, 2020 1 次提交
  6. 07 5月, 2020 1 次提交
    • C
      drm/i915: Check current i915_vma.pin_count status first on unbind · af23facc
      Chris Wilson 提交于
      Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is
      currently pinned, without waiting to see if the inflight operations may
      unpin it. We see this problem with the shrinker trying to unbind the
      active vma from inside its bind worker:
      
      <6> [472.618968] Workqueue: events_unbound fence_work [i915]
      <4> [472.618970] Call Trace:
      <4> [472.618974]  ? __schedule+0x2e5/0x810
      <4> [472.618978]  schedule+0x37/0xe0
      <4> [472.618982]  schedule_preempt_disabled+0xf/0x20
      <4> [472.618984]  __mutex_lock+0x281/0x9c0
      <4> [472.618987]  ? mark_held_locks+0x49/0x70
      <4> [472.618989]  ? _raw_spin_unlock_irqrestore+0x47/0x60
      <4> [472.619038]  ? i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619084]  ? i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619122]  i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619165]  i915_gem_object_unbind+0x1dc/0x400 [i915]
      <4> [472.619208]  i915_gem_shrink+0x328/0x660 [i915]
      <4> [472.619250]  ? i915_gem_shrink_all+0x38/0x60 [i915]
      <4> [472.619282]  i915_gem_shrink_all+0x38/0x60 [i915]
      <4> [472.619325]  vm_alloc_page.constprop.25+0x1aa/0x240 [i915]
      <4> [472.619330]  ? rcu_read_lock_sched_held+0x4d/0x80
      <4> [472.619363]  ? __alloc_pd+0xb/0x30 [i915]
      <4> [472.619366]  ? module_assert_mutex_or_preempt+0xf/0x30
      <4> [472.619368]  ? __module_address+0x23/0xe0
      <4> [472.619371]  ? is_module_address+0x26/0x40
      <4> [472.619374]  ? static_obj+0x34/0x50
      <4> [472.619376]  ? lockdep_init_map+0x4d/0x1e0
      <4> [472.619407]  setup_page_dma+0xd/0x90 [i915]
      <4> [472.619437]  alloc_pd+0x29/0x50 [i915]
      <4> [472.619470]  __gen8_ppgtt_alloc+0x443/0x6b0 [i915]
      <4> [472.619503]  gen8_ppgtt_alloc+0xd7/0x300 [i915]
      <4> [472.619535]  ppgtt_bind_vma+0x2a/0xe0 [i915]
      <4> [472.619577]  __vma_bind+0x26/0x40 [i915]
      <4> [472.619611]  fence_work+0x1c/0x90 [i915]
      <4> [472.619617]  process_one_work+0x26a/0x620
      
      Fixes: 2850748e ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200403120150.17091-1-chris@chris-wilson.co.uk
      (cherry picked from commit 614654ab)
      (cherry picked from commit dd086cf516d9bea3878abb267f62ccc53acd764b)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      af23facc
  7. 28 4月, 2020 1 次提交
    • C
      drm/i915/gem: Hold obj->vma.lock over for_each_ggtt_vma() · f524a774
      Chris Wilson 提交于
      While the ggtt vma are protected by their object lifetime, the list
      continues until it hits a non-ggtt vma, and that vma is not protected
      and may be freed as we inspect it. Hence, we require the obj->vma.lock
      to protect the list as we iterate.
      
      An example of forgetting to hold the obj->vma.lock is
      
      [1642834.464973] general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] SMP PTI
      [1642834.464977] CPU: 3 PID: 1954 Comm: Xorg Not tainted 5.6.0-300.fc32.x86_64 #1
      [1642834.464979] Hardware name: LENOVO 20ARS25701/20ARS25701, BIOS GJET94WW (2.44 ) 09/14/2017
      [1642834.465021] RIP: 0010:i915_gem_object_set_tiling+0x2c0/0x3e0 [i915]
      [1642834.465024] Code: 8b 84 24 18 01 00 00 f6 c4 80 74 59 49 8b 94 24 a0 00 00 00 49 8b 84 24 e0 00 00 00 49 8b 74 24 10 48 8b 92 30 01 00 00 89 c7 <80> ba 0a 06 00 00 03 0f 87 86 00 00 00 ba 00 00 08 00 b9 00 00 10
      [1642834.465025] RSP: 0018:ffffa98780c77d60 EFLAGS: 00010282
      [1642834.465028] RAX: ffff8d232bfb2578 RBX: 0000000000000002 RCX: ffff8d25873a0000
      [1642834.465029] RDX: dead000000000122 RSI: fffff0af8ac6e408 RDI: 000000002bfb2578
      [1642834.465030] RBP: ffff8d25873a0000 R08: ffff8d252bfb5638 R09: 0000000000000000
      [1642834.465031] R10: 0000000000000000 R11: ffff8d252bfb5640 R12: ffffa987801cb8f8
      [1642834.465032] R13: 0000000000001000 R14: ffff8d233e972e50 R15: ffff8d233e972d00
      [1642834.465034] FS:  00007f6a3d327f00(0000) GS:ffff8d25926c0000(0000) knlGS:0000000000000000
      [1642834.465036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [1642834.465037] CR2: 00007f6a2064d000 CR3: 00000002fb57c001 CR4: 00000000001606e0
      [1642834.465038] Call Trace:
      [1642834.465083]  i915_gem_set_tiling_ioctl+0x122/0x230 [i915]
      [1642834.465121]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465151]  drm_ioctl_kernel+0x86/0xd0 [drm]
      [1642834.465156]  ? avc_has_perm+0x3b/0x160
      [1642834.465178]  drm_ioctl+0x206/0x390 [drm]
      [1642834.465216]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465221]  ? selinux_file_ioctl+0x122/0x1c0
      [1642834.465226]  ? __do_munmap+0x24b/0x4d0
      [1642834.465231]  ksys_ioctl+0x82/0xc0
      [1642834.465235]  __x64_sys_ioctl+0x16/0x20
      [1642834.465238]  do_syscall_64+0x5b/0xf0
      [1642834.465243]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [1642834.465245] RIP: 0033:0x7f6a3d7b047b
      [1642834.465247] Code: 0f 1e fa 48 8b 05 1d aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed a9 0c 00 f7 d8 64 89 01 48
      [1642834.465249] RSP: 002b:00007ffe71adba28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [1642834.465251] RAX: ffffffffffffffda RBX: 000055f99048fa40 RCX: 00007f6a3d7b047b
      [1642834.465253] RDX: 00007ffe71adba30 RSI: 00000000c0106461 RDI: 000000000000000e
      [1642834.465254] RBP: 0000000000000002 R08: 000055f98f3f1798 R09: 0000000000000002
      [1642834.465255] R10: 0000000000001000 R11: 0000000000000246 R12: 0000000000000080
      [1642834.465257] R13: 000055f98f3f1690 R14: 00000000c0106461 R15: 00007ffe71adba30
      
      Now to take the spinlock during the list iteration, we need to break it
      down into two phases. In the first phase under the lock, we cannot sleep
      and so must defer the actual work to a second list, protected by the
      ggtt->mutex.
      
      We also need to hold the spinlock during creation of a new vma to
      serialise with updates of the tiling on the object.
      Reported-by: NDave Airlie <airlied@redhat.com>
      Fixes: 2850748e ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200422072805.17340-1-chris@chris-wilson.co.uk
      (cherry picked from commit cb593e5d)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      f524a774
  8. 24 4月, 2020 1 次提交
  9. 22 4月, 2020 1 次提交
    • C
      drm/i915/gem: Hold obj->vma.lock over for_each_ggtt_vma() · cb593e5d
      Chris Wilson 提交于
      While the ggtt vma are protected by their object lifetime, the list
      continues until it hits a non-ggtt vma, and that vma is not protected
      and may be freed as we inspect it. Hence, we require the obj->vma.lock
      to protect the list as we iterate.
      
      An example of forgetting to hold the obj->vma.lock is
      
      [1642834.464973] general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] SMP PTI
      [1642834.464977] CPU: 3 PID: 1954 Comm: Xorg Not tainted 5.6.0-300.fc32.x86_64 #1
      [1642834.464979] Hardware name: LENOVO 20ARS25701/20ARS25701, BIOS GJET94WW (2.44 ) 09/14/2017
      [1642834.465021] RIP: 0010:i915_gem_object_set_tiling+0x2c0/0x3e0 [i915]
      [1642834.465024] Code: 8b 84 24 18 01 00 00 f6 c4 80 74 59 49 8b 94 24 a0 00 00 00 49 8b 84 24 e0 00 00 00 49 8b 74 24 10 48 8b 92 30 01 00 00 89 c7 <80> ba 0a 06 00 00 03 0f 87 86 00 00 00 ba 00 00 08 00 b9 00 00 10
      [1642834.465025] RSP: 0018:ffffa98780c77d60 EFLAGS: 00010282
      [1642834.465028] RAX: ffff8d232bfb2578 RBX: 0000000000000002 RCX: ffff8d25873a0000
      [1642834.465029] RDX: dead000000000122 RSI: fffff0af8ac6e408 RDI: 000000002bfb2578
      [1642834.465030] RBP: ffff8d25873a0000 R08: ffff8d252bfb5638 R09: 0000000000000000
      [1642834.465031] R10: 0000000000000000 R11: ffff8d252bfb5640 R12: ffffa987801cb8f8
      [1642834.465032] R13: 0000000000001000 R14: ffff8d233e972e50 R15: ffff8d233e972d00
      [1642834.465034] FS:  00007f6a3d327f00(0000) GS:ffff8d25926c0000(0000) knlGS:0000000000000000
      [1642834.465036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [1642834.465037] CR2: 00007f6a2064d000 CR3: 00000002fb57c001 CR4: 00000000001606e0
      [1642834.465038] Call Trace:
      [1642834.465083]  i915_gem_set_tiling_ioctl+0x122/0x230 [i915]
      [1642834.465121]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465151]  drm_ioctl_kernel+0x86/0xd0 [drm]
      [1642834.465156]  ? avc_has_perm+0x3b/0x160
      [1642834.465178]  drm_ioctl+0x206/0x390 [drm]
      [1642834.465216]  ? i915_gem_object_set_tiling+0x3e0/0x3e0 [i915]
      [1642834.465221]  ? selinux_file_ioctl+0x122/0x1c0
      [1642834.465226]  ? __do_munmap+0x24b/0x4d0
      [1642834.465231]  ksys_ioctl+0x82/0xc0
      [1642834.465235]  __x64_sys_ioctl+0x16/0x20
      [1642834.465238]  do_syscall_64+0x5b/0xf0
      [1642834.465243]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [1642834.465245] RIP: 0033:0x7f6a3d7b047b
      [1642834.465247] Code: 0f 1e fa 48 8b 05 1d aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed a9 0c 00 f7 d8 64 89 01 48
      [1642834.465249] RSP: 002b:00007ffe71adba28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [1642834.465251] RAX: ffffffffffffffda RBX: 000055f99048fa40 RCX: 00007f6a3d7b047b
      [1642834.465253] RDX: 00007ffe71adba30 RSI: 00000000c0106461 RDI: 000000000000000e
      [1642834.465254] RBP: 0000000000000002 R08: 000055f98f3f1798 R09: 0000000000000002
      [1642834.465255] R10: 0000000000001000 R11: 0000000000000246 R12: 0000000000000080
      [1642834.465257] R13: 000055f98f3f1690 R14: 00000000c0106461 R15: 00007ffe71adba30
      
      Now to take the spinlock during the list iteration, we need to break it
      down into two phases. In the first phase under the lock, we cannot sleep
      and so must defer the actual work to a second list, protected by the
      ggtt->mutex.
      
      We also need to hold the spinlock during creation of a new vma to
      serialise with updates of the tiling on the object.
      Reported-by: NDave Airlie <airlied@redhat.com>
      Fixes: 2850748e ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200422072805.17340-1-chris@chris-wilson.co.uk
      cb593e5d
  10. 07 4月, 2020 1 次提交
  11. 04 4月, 2020 2 次提交
    • C
      drm/i915: Check current i915_vma.pin_count status first on unbind · 614654ab
      Chris Wilson 提交于
      Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is
      currently pinned, without waiting to see if the inflight operations may
      unpin it. We see this problem with the shrinker trying to unbind the
      active vma from inside its bind worker:
      
      <6> [472.618968] Workqueue: events_unbound fence_work [i915]
      <4> [472.618970] Call Trace:
      <4> [472.618974]  ? __schedule+0x2e5/0x810
      <4> [472.618978]  schedule+0x37/0xe0
      <4> [472.618982]  schedule_preempt_disabled+0xf/0x20
      <4> [472.618984]  __mutex_lock+0x281/0x9c0
      <4> [472.618987]  ? mark_held_locks+0x49/0x70
      <4> [472.618989]  ? _raw_spin_unlock_irqrestore+0x47/0x60
      <4> [472.619038]  ? i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619084]  ? i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619122]  i915_vma_unbind+0xae/0x110 [i915]
      <4> [472.619165]  i915_gem_object_unbind+0x1dc/0x400 [i915]
      <4> [472.619208]  i915_gem_shrink+0x328/0x660 [i915]
      <4> [472.619250]  ? i915_gem_shrink_all+0x38/0x60 [i915]
      <4> [472.619282]  i915_gem_shrink_all+0x38/0x60 [i915]
      <4> [472.619325]  vm_alloc_page.constprop.25+0x1aa/0x240 [i915]
      <4> [472.619330]  ? rcu_read_lock_sched_held+0x4d/0x80
      <4> [472.619363]  ? __alloc_pd+0xb/0x30 [i915]
      <4> [472.619366]  ? module_assert_mutex_or_preempt+0xf/0x30
      <4> [472.619368]  ? __module_address+0x23/0xe0
      <4> [472.619371]  ? is_module_address+0x26/0x40
      <4> [472.619374]  ? static_obj+0x34/0x50
      <4> [472.619376]  ? lockdep_init_map+0x4d/0x1e0
      <4> [472.619407]  setup_page_dma+0xd/0x90 [i915]
      <4> [472.619437]  alloc_pd+0x29/0x50 [i915]
      <4> [472.619470]  __gen8_ppgtt_alloc+0x443/0x6b0 [i915]
      <4> [472.619503]  gen8_ppgtt_alloc+0xd7/0x300 [i915]
      <4> [472.619535]  ppgtt_bind_vma+0x2a/0xe0 [i915]
      <4> [472.619577]  __vma_bind+0x26/0x40 [i915]
      <4> [472.619611]  fence_work+0x1c/0x90 [i915]
      <4> [472.619617]  process_one_work+0x26a/0x620
      
      Fixes: 2850748e ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200403120150.17091-1-chris@chris-wilson.co.uk
      614654ab
    • C
      drm/i915: Revoke mmap before fence · 9657aaa2
      Chris Wilson 提交于
      Make sure we revoke the user's mmaps of this vma to force them to take a
      pagefault *before* we remove the associated aperture detiling register.
      
      Fixes: 0d86ee35 ("drm/i915/gt: Make fence revocation unequivocal")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200403160951.8271-1-chris@chris-wilson.co.uk
      9657aaa2
  12. 02 4月, 2020 3 次提交
  13. 28 3月, 2020 1 次提交
  14. 27 3月, 2020 1 次提交
  15. 25 3月, 2020 1 次提交
  16. 23 3月, 2020 1 次提交
  17. 11 3月, 2020 1 次提交
  18. 04 3月, 2020 1 次提交
  19. 22 2月, 2020 1 次提交
  20. 11 2月, 2020 1 次提交
  21. 03 2月, 2020 1 次提交
  22. 31 1月, 2020 1 次提交
  23. 24 1月, 2020 2 次提交
  24. 22 1月, 2020 1 次提交
  25. 11 1月, 2020 1 次提交
  26. 09 1月, 2020 1 次提交
  27. 23 12月, 2019 2 次提交
  28. 22 12月, 2019 1 次提交
  29. 18 12月, 2019 2 次提交
  30. 09 12月, 2019 1 次提交
  31. 06 12月, 2019 1 次提交
  32. 05 12月, 2019 1 次提交
  33. 04 12月, 2019 1 次提交
  34. 31 10月, 2019 1 次提交