1. 27 4月, 2020 1 次提交
    • C
      drm/i915/execlists: Check preempt-timeout target before submit_ports · 68ace460
      Chris Wilson 提交于
      We evaluate *active, which is a pointer into execlists->inflight[]
      during dequeue to decide how long a preempt-timeout we need to apply.
      However, as soon as we do the submit_ports, the HW may send its ACK
      interrupt causing us to promote execlists->pending[] tp
      execlists->inflight[], overwriting the value of *active. We know *active
      is only stable until we submit (as we only submit when there is no
      pending promotion).
      
      [   16.102328] BUG: KCSAN: data-race in execlists_dequeue+0x1449/0x1600 [i915]
      [   16.102356]
      [   16.102375] race at unknown origin, with read to 0xffff8881e9500488 of 8 bytes by task 429 on cpu 1:
      [   16.102780]  execlists_dequeue+0x1449/0x1600 [i915]
      [   16.103160]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [   16.103540]  execlists_submit_request+0x38e/0x3c0 [i915]
      [   16.103940]  submit_notify+0x8f/0xc0 [i915]
      [   16.104308]  __i915_sw_fence_complete+0x61/0x420 [i915]
      [   16.104683]  i915_sw_fence_complete+0x58/0x80 [i915]
      [   16.105054]  i915_sw_fence_commit+0x16/0x20 [i915]
      [   16.105457]  __i915_request_queue+0x60/0x70 [i915]
      [   16.105843]  i915_gem_do_execbuffer+0x2d6b/0x4230 [i915]
      [   16.106227]  i915_gem_execbuffer2_ioctl+0x2b0/0x580 [i915]
      [   16.106257]  drm_ioctl_kernel+0xe9/0x130
      [   16.106279]  drm_ioctl+0x27d/0x45e
      [   16.106311]  ksys_ioctl+0x89/0xb0
      [   16.106336]  __x64_sys_ioctl+0x42/0x60
      [   16.106370]  do_syscall_64+0x6e/0x2c0
      [   16.106397]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      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/20200426094231.21995-1-chris@chris-wilson.co.uk
      68ace460
  2. 26 4月, 2020 3 次提交
  3. 24 4月, 2020 2 次提交
  4. 23 4月, 2020 2 次提交
    • C
      drm/i915/gt: Carefully order virtual_submission_tasklet · 36fe164d
      Chris Wilson 提交于
      During the virtual engine's submission tasklet, we take the request and
      insert into the submission queue on each of our siblings. This seems
      quite simply, and so no problems with ordering. However, the sibling
      execlists' submission tasklets may run concurrently with the virtual
      engine's tasklet, submitting the request to HW before the virtual
      finishes its task of telling all the siblings. If this happens, the
      sibling tasklet may *reorder* the ve->sibling[] array that the virtual
      engine tasklet is processing. This can *only* reorder within the
      elements already processed by the virtual engine, nevertheless the
      race is detected by KCSAN:
      
      [  185.580014] BUG: KCSAN: data-race in execlists_dequeue [i915] / virtual_submission_tasklet [i915]
      [  185.580054]
      [  185.580076] write to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 2:
      [  185.580553]  execlists_dequeue+0x6ad/0x1600 [i915]
      [  185.581044]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [  185.581517]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [  185.581554]  tasklet_action_common.isra.0+0x42/0x90
      [  185.581585]  __do_softirq+0xc8/0x206
      [  185.581613]  run_ksoftirqd+0x15/0x20
      [  185.581641]  smpboot_thread_fn+0x15a/0x270
      [  185.581669]  kthread+0x19a/0x1e0
      [  185.581695]  ret_from_fork+0x1f/0x30
      [  185.581717]
      [  185.581736] read to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 0:
      [  185.582231]  virtual_submission_tasklet+0x10e/0x5c0 [i915]
      [  185.582265]  tasklet_action_common.isra.0+0x42/0x90
      [  185.582291]  __do_softirq+0xc8/0x206
      [  185.582315]  run_ksoftirqd+0x15/0x20
      [  185.582340]  smpboot_thread_fn+0x15a/0x270
      [  185.582368]  kthread+0x19a/0x1e0
      [  185.582395]  ret_from_fork+0x1f/0x30
      [  185.582417]
      
      We can prevent this race by checking for the ve->request after looking
      up the sibling array.
      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/20200423115315.26825-1-chris@chris-wilson.co.uk
      36fe164d
    • C
      drm/i915/execlists: Drop request-before-CS assertion · 15501287
      Chris Wilson 提交于
      When we migrated to execlists, one of the conditions we wanted to test
      for was whether the breadcrumb seqno was being written before the
      breadcumb interrupt was delivered. This was following on from issues
      observed on previous generations which were not so strongly ordered. With
      the removal of the missed interrupt detection, we have not reliable
      means of detecting the out-of-order seqno/interrupt but instead tried to
      assert that the relationship between the CS event interrupt and the
      breadwrite should be strongly ordered. However, Icelake proves it is
      possible for the HW implementation to forget about minor little details
      such as write ordering and so the order between *processing* the CS
      event and the breadcrumb is unreliable.
      
      Remove the unreliable assertion, but leave a debug telltale in case we
      have reason to suspect.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1658Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200422141749.28709-1-chris@chris-wilson.co.uk
      15501287
  5. 21 4月, 2020 1 次提交
  6. 17 4月, 2020 1 次提交
  7. 08 4月, 2020 1 次提交
  8. 07 4月, 2020 1 次提交
    • C
      drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore · c4e8ba73
      Chris Wilson 提交于
      If we find ourselves waiting on a MI_SEMAPHORE_WAIT, either within the
      user batch or in our own preamble, the engine raises a
      GT_WAIT_ON_SEMAPHORE interrupt. We can unmask that interrupt and so
      respond to a semaphore wait by yielding the timeslice, if we have
      another context to yield to!
      
      The only real complication is that the interrupt is only generated for
      the start of the semaphore wait, and is asynchronous to our
      process_csb() -- that is, we may not have registered the timeslice before
      we see the interrupt. To ensure we don't miss a potential semaphore
      blocking forward progress (e.g. selftests/live_timeslice_preempt) we mark
      the interrupt and apply it to the next timeslice regardless of whether it
      was active at the time.
      
      v2: We use semaphores in preempt-to-busy, within the timeslicing
      implementation itself! Ergo, when we do insert a preemption due to an
      expired timeslice, the new context may start with the missed semaphore
      flagged by the retired context and be yielded, ad infinitum. To avoid
      this, read the context id at the time of the semaphore interrupt and
      only yield if that context is still active.
      
      Fixes: 8ee36e04 ("drm/i915/execlists: Minimalistic timeslicing")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Kenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200407130811.17321-1-chris@chris-wilson.co.uk
      c4e8ba73
  9. 04 4月, 2020 1 次提交
  10. 03 4月, 2020 1 次提交
  11. 01 4月, 2020 2 次提交
  12. 31 3月, 2020 3 次提交
  13. 28 3月, 2020 1 次提交
  14. 27 3月, 2020 1 次提交
  15. 25 3月, 2020 3 次提交
  16. 23 3月, 2020 1 次提交
  17. 19 3月, 2020 1 次提交
  18. 16 3月, 2020 2 次提交
  19. 13 3月, 2020 1 次提交
  20. 12 3月, 2020 1 次提交
  21. 11 3月, 2020 2 次提交
  22. 10 3月, 2020 5 次提交
    • C
      drm/i915/gt: Defend against concurrent updates to execlists->active · f494960d
      Chris Wilson 提交于
      [  206.875637] BUG: KCSAN: data-race in __i915_schedule+0x7fc/0x930 [i915]
      [  206.875654]
      [  206.875666] race at unknown origin, with read to 0xffff8881f7644480 of 8 bytes by task 703 on cpu 3:
      [  206.875901]  __i915_schedule+0x7fc/0x930 [i915]
      [  206.876130]  __bump_priority+0x63/0x80 [i915]
      [  206.876361]  __i915_sched_node_add_dependency+0x258/0x300 [i915]
      [  206.876593]  i915_sched_node_add_dependency+0x50/0xa0 [i915]
      [  206.876824]  i915_request_await_dma_fence+0x1da/0x530 [i915]
      [  206.877057]  i915_request_await_object+0x2fe/0x470 [i915]
      [  206.877287]  i915_gem_do_execbuffer+0x45dc/0x4c20 [i915]
      [  206.877517]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [  206.877535]  drm_ioctl_kernel+0xe4/0x120
      [  206.877549]  drm_ioctl+0x297/0x4c7
      [  206.877563]  ksys_ioctl+0x89/0xb0
      [  206.877577]  __x64_sys_ioctl+0x42/0x60
      [  206.877591]  do_syscall_64+0x6e/0x2c0
      [  206.877606]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      v2: Be safe and include mb
      
      References: https://gitlab.freedesktop.org/drm/intel/issues/1318Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309170540.10332-1-chris@chris-wilson.co.uk
      f494960d
    • C
      drm/i915/execlsts: Mark up racy inspection of current i915_request priority · a4e648a0
      Chris Wilson 提交于
      [  120.176548] BUG: KCSAN: data-race in __i915_schedule [i915] / effective_prio [i915]
      [  120.176566]
      [  120.176577] write to 0xffff8881e35e6540 of 4 bytes by task 730 on cpu 3:
      [  120.176792]  __i915_schedule+0x63e/0x920 [i915]
      [  120.177007]  __bump_priority+0x63/0x80 [i915]
      [  120.177220]  __i915_sched_node_add_dependency+0x258/0x300 [i915]
      [  120.177438]  i915_sched_node_add_dependency+0x50/0xa0 [i915]
      [  120.177654]  i915_request_await_dma_fence+0x1da/0x530 [i915]
      [  120.177867]  i915_request_await_object+0x2fe/0x470 [i915]
      [  120.178081]  i915_gem_do_execbuffer+0x45dc/0x4c20 [i915]
      [  120.178292]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [  120.178309]  drm_ioctl_kernel+0xe4/0x120
      [  120.178322]  drm_ioctl+0x297/0x4c7
      [  120.178335]  ksys_ioctl+0x89/0xb0
      [  120.178348]  __x64_sys_ioctl+0x42/0x60
      [  120.178361]  do_syscall_64+0x6e/0x2c0
      [  120.178375]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  120.178387]
      [  120.178397] read to 0xffff8881e35e6540 of 4 bytes by interrupt on cpu 2:
      [  120.178606]  effective_prio+0x25/0xc0 [i915]
      [  120.178812]  process_csb+0xe8b/0x10a0 [i915]
      [  120.179021]  execlists_submission_tasklet+0x30/0x170 [i915]
      [  120.179038]  tasklet_action_common.isra.0+0x42/0xa0
      [  120.179053]  __do_softirq+0xd7/0x2cd
      [  120.179066]  irq_exit+0xbe/0xe0
      [  120.179078]  do_IRQ+0x51/0x100
      [  120.179090]  ret_from_intr+0x0/0x1c
      [  120.179104]  cpuidle_enter_state+0x1b8/0x5d0
      [  120.179117]  cpuidle_enter+0x50/0x90
      [  120.179131]  do_idle+0x1a1/0x1f0
      [  120.179145]  cpu_startup_entry+0x14/0x16
      [  120.179158]  start_secondary+0x120/0x180
      [  120.179172]  secondary_startup_64+0xa4/0xb0
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309110934.868-5-chris@chris-wilson.co.uk
      a4e648a0
    • C
      drm/i915/execlists: Mark up read of i915_request.fence.flags · fa192d90
      Chris Wilson 提交于
      [  145.927961] BUG: KCSAN: data-race in can_merge_rq [i915] / signal_irq_work [i915]
      [  145.927980]
      [  145.927992] write (marked) to 0xffff8881e513fab0 of 8 bytes by interrupt on cpu 2:
      [  145.928250]  signal_irq_work+0x134/0x640 [i915]
      [  145.928268]  irq_work_run_list+0xd7/0x120
      [  145.928283]  irq_work_run+0x1d/0x50
      [  145.928300]  smp_irq_work_interrupt+0x21/0x30
      [  145.928328]  irq_work_interrupt+0xf/0x20
      [  145.928356]  _raw_spin_unlock_irqrestore+0x34/0x40
      [  145.928596]  execlists_submission_tasklet+0xde/0x170 [i915]
      [  145.928616]  tasklet_action_common.isra.0+0x42/0xa0
      [  145.928632]  __do_softirq+0xd7/0x2cd
      [  145.928646]  irq_exit+0xbe/0xe0
      [  145.928665]  do_IRQ+0x51/0x100
      [  145.928684]  ret_from_intr+0x0/0x1c
      [  145.928699]  schedule+0x0/0xb0
      [  145.928719]  worker_thread+0x194/0x670
      [  145.928743]  kthread+0x19a/0x1e0
      [  145.928765]  ret_from_fork+0x1f/0x30
      [  145.928784]
      [  145.928796] read to 0xffff8881e513fab0 of 8 bytes by task 738 on cpu 1:
      [  145.929046]  can_merge_rq+0xb1/0x100 [i915]
      [  145.929282]  __execlists_submission_tasklet+0x866/0x25a0 [i915]
      [  145.929518]  execlists_submit_request+0x2a4/0x2b0 [i915]
      [  145.929758]  submit_notify+0x8f/0xc0 [i915]
      [  145.929989]  __i915_sw_fence_complete+0x5d/0x3e0 [i915]
      [  145.930221]  i915_sw_fence_complete+0x58/0x80 [i915]
      [  145.930453]  i915_sw_fence_commit+0x16/0x20 [i915]
      [  145.930698]  __i915_request_queue+0x60/0x70 [i915]
      [  145.930935]  i915_gem_do_execbuffer+0x3997/0x4c20 [i915]
      [  145.931175]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [  145.931194]  drm_ioctl_kernel+0xe4/0x120
      [  145.931208]  drm_ioctl+0x297/0x4c7
      [  145.931222]  ksys_ioctl+0x89/0xb0
      [  145.931238]  __x64_sys_ioctl+0x42/0x60
      [  145.931260]  do_syscall_64+0x6e/0x2c0
      [  145.931275]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309110934.868-4-chris@chris-wilson.co.uk
      fa192d90
    • C
      drm/i915/gt: Mark up racy check of last list element · 875c3b4b
      Chris Wilson 提交于
      [   25.025543] BUG: KCSAN: data-race in __i915_request_create [i915] / process_csb [i915]
      [   25.025561]
      [   25.025573] write (marked) to 0xffff8881e85c1620 of 8 bytes by task 696 on cpu 1:
      [   25.025789]  __i915_request_create+0x54b/0x5d0 [i915]
      [   25.026001]  i915_request_create+0xcc/0x150 [i915]
      [   25.026218]  i915_gem_do_execbuffer+0x2f70/0x4c20 [i915]
      [   25.026428]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [   25.026445]  drm_ioctl_kernel+0xe4/0x120
      [   25.026459]  drm_ioctl+0x297/0x4c7
      [   25.026472]  ksys_ioctl+0x89/0xb0
      [   25.026484]  __x64_sys_ioctl+0x42/0x60
      [   25.026497]  do_syscall_64+0x6e/0x2c0
      [   25.026510]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   25.026522]
      [   25.026532] read to 0xffff8881e85c1620 of 8 bytes by interrupt on cpu 2:
      [   25.026742]  process_csb+0x8d6/0x1070 [i915]
      [   25.026949]  execlists_submission_tasklet+0x30/0x170 [i915]
      [   25.026969]  tasklet_action_common.isra.0+0x42/0xa0
      [   25.026984]  __do_softirq+0xd7/0x2cd
      [   25.026997]  irq_exit+0xbe/0xe0
      [   25.027009]  do_IRQ+0x51/0x100
      [   25.027021]  ret_from_intr+0x0/0x1c
      [   25.027033]  poll_idle+0x3e/0x13b
      [   25.027047]  cpuidle_enter_state+0x189/0x5d0
      [   25.027060]  cpuidle_enter+0x50/0x90
      [   25.027074]  do_idle+0x1a1/0x1f0
      [   25.027086]  cpu_startup_entry+0x14/0x16
      [   25.027100]  start_secondary+0x120/0x180
      [   25.027116]  secondary_startup_64+0xa4/0xb0
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309110934.868-2-chris@chris-wilson.co.uk
      875c3b4b
    • C
      drm/i915/execlists: Mark up the racy access to switch_priority_hint · 23a44ae9
      Chris Wilson 提交于
      [ 7534.150687] BUG: KCSAN: data-race in __execlists_submission_tasklet [i915] / process_csb [i915]
      [ 7534.150706]
      [ 7534.150717] write to 0xffff8881f1bc24b4 of 4 bytes by task 24404 on cpu 3:
      [ 7534.150925]  __execlists_submission_tasklet+0x1158/0x2780 [i915]
      [ 7534.151133]  execlists_submit_request+0x2e8/0x2f0 [i915]
      [ 7534.151348]  submit_notify+0x8f/0xc0 [i915]
      [ 7534.151549]  __i915_sw_fence_complete+0x5d/0x3e0 [i915]
      [ 7534.151753]  i915_sw_fence_complete+0x58/0x80 [i915]
      [ 7534.151963]  i915_sw_fence_commit+0x16/0x20 [i915]
      [ 7534.152179]  __i915_request_queue+0x60/0x70 [i915]
      [ 7534.152388]  i915_gem_do_execbuffer+0x3997/0x4c20 [i915]
      [ 7534.152598]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [ 7534.152615]  drm_ioctl_kernel+0xe4/0x120
      [ 7534.152629]  drm_ioctl+0x297/0x4c7
      [ 7534.152642]  ksys_ioctl+0x89/0xb0
      [ 7534.152654]  __x64_sys_ioctl+0x42/0x60
      [ 7534.152667]  do_syscall_64+0x6e/0x2c0
      [ 7534.152681]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [ 7534.152693]
      [ 7534.152703] read to 0xffff8881f1bc24b4 of 4 bytes by interrupt on cpu 2:
      [ 7534.152914]  process_csb+0xe7c/0x10a0 [i915]
      [ 7534.153120]  execlists_submission_tasklet+0x30/0x170 [i915]
      [ 7534.153138]  tasklet_action_common.isra.0+0x42/0xa0
      [ 7534.153153]  __do_softirq+0xd7/0x2cd
      [ 7534.153166]  run_ksoftirqd+0x15/0x20
      [ 7534.153180]  smpboot_thread_fn+0x1ab/0x300
      [ 7534.153194]  kthread+0x19a/0x1e0
      [ 7534.153207]  ret_from_fork+0x1f/0x30
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309144249.10309-1-chris@chris-wilson.co.uk
      23a44ae9
  23. 07 3月, 2020 1 次提交
  24. 06 3月, 2020 1 次提交
  25. 05 3月, 2020 1 次提交