1. 03 10月, 2019 1 次提交
  2. 01 10月, 2019 1 次提交
    • C
      drm/i915: Initialise breadcrumb lists on the virtual engine · f8db4d05
      Chris Wilson 提交于
      With deferring the breadcrumb signalling to the virtual engine (thanks
      preempt-to-busy) we need to make sure the lists and irq-worker are ready
      to send a signal.
      
      [41958.710544] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [41958.710553] #PF: supervisor write access in kernel mode
      [41958.710556] #PF: error_code(0x0002) - not-present page
      [41958.710558] PGD 0 P4D 0
      [41958.710562] Oops: 0002 [#1] SMP
      [41958.710565] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G     U            5.3.0+ #207
      [41958.710568] Hardware name: Intel Corporation NUC7i5BNK/NUC7i5BNB, BIOS BNKBL357.86A.0052.2017.0918.1346 09/18/2017
      [41958.710602] RIP: 0010:i915_request_enable_breadcrumb+0xe1/0x130 [i915]
      [41958.710605] Code: 8b 44 24 30 48 89 41 08 48 89 08 48 8b 85 98 01 00 00 48 8d 8d 90 01 00 00 48 89 95 98 01 00 00 49 89 4c 24 28 49 89 44 24 30 <48> 89 10 f0 80 4b 30 10 c6 85 88 01 00 00 00 e9 1a ff ff ff 48 83
      [41958.710609] RSP: 0018:ffffc90000003de0 EFLAGS: 00010046
      [41958.710612] RAX: 0000000000000000 RBX: ffff888735424480 RCX: ffff8887cddb2190
      [41958.710614] RDX: ffff8887cddb3570 RSI: ffff888850362190 RDI: ffff8887cddb2188
      [41958.710617] RBP: ffff8887cddb2000 R08: ffff8888503624a8 R09: 0000000000000100
      [41958.710619] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8887cddb3548
      [41958.710622] R13: 0000000000000000 R14: 0000000000000046 R15: ffff888850362070
      [41958.710625] FS:  0000000000000000(0000) GS:ffff88885ea00000(0000) knlGS:0000000000000000
      [41958.710628] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [41958.710630] CR2: 0000000000000000 CR3: 0000000002c09002 CR4: 00000000001606f0
      [41958.710633] Call Trace:
      [41958.710636]  <IRQ>
      [41958.710668]  __i915_request_submit+0x12b/0x160 [i915]
      [41958.710693]  virtual_submit_request+0x67/0x120 [i915]
      [41958.710720]  __unwind_incomplete_requests+0x131/0x170 [i915]
      [41958.710744]  execlists_dequeue+0xb40/0xe00 [i915]
      [41958.710771]  execlists_submission_tasklet+0x10f/0x150 [i915]
      [41958.710776]  tasklet_action_common.isra.17+0x41/0xa0
      [41958.710781]  __do_softirq+0xc8/0x221
      [41958.710785]  irq_exit+0xa6/0xb0
      [41958.710788]  smp_apic_timer_interrupt+0x4d/0x80
      [41958.710791]  apic_timer_interrupt+0xf/0x20
      [41958.710794]  </IRQ>
      
      Fixes: cb2377a9 ("drm/i915: Fixup preempt-to-busy vs reset of a virtual request")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191001103518.9113-1-chris@chris-wilson.co.uk
      f8db4d05
  3. 27 9月, 2019 1 次提交
  4. 26 9月, 2019 1 次提交
  5. 25 9月, 2019 1 次提交
  6. 24 9月, 2019 3 次提交
    • C
      drm/i915: Prevent bonded requests from overtaking each other on preemption · e2144503
      Chris Wilson 提交于
      Force bonded requests to run on distinct engines so that they cannot be
      shuffled onto the same engine where timeslicing will reverse the order.
      A bonded request will often wait on a semaphore signaled by its master,
      creating an implicit dependency -- if we ignore that implicit dependency
      and allow the bonded request to run on the same engine and before its
      master, we will cause a GPU hang. [Whether it will hang the GPU is
      debatable, we should keep on timeslicing and each timeslice should be
      "accidentally" counted as forward progress, in which case it should run
      but at one-half to one-third speed.]
      
      We can prevent this inversion by restricting which engines we allow
      ourselves to jump to upon preemption, i.e. baking in the arrangement
      established at first execution. (We should also consider capturing the
      implicit dependency using i915_sched_add_dependency(), but first we need
      to think about the constraints that requires on the execution/retirement
      ordering.)
      
      Fixes: 8ee36e04 ("drm/i915/execlists: Minimalistic timeslicing")
      References: ee113690 ("drm/i915/execlists: Virtual engine bonding")
      Testcase: igt/gem_exec_balancer/bonded-slice
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190923152844.8914-3-chris@chris-wilson.co.uk
      e2144503
    • C
      drm/i915: Fixup preempt-to-busy vs reset of a virtual request · cb2377a9
      Chris Wilson 提交于
      Due to the nature of preempt-to-busy the execlists active tracking and
      the schedule queue may become temporarily desync'ed (between resubmission
      to HW and its ack from HW). This means that we may have unwound a
      request and passed it back to the virtual engine, but it is still
      inflight on the HW and may even result in a GPU hang. If we detect that
      GPU hang and try to reset, the hanging request->engine will no longer
      match the current engine, which means that the request is not on the
      execlists active list and we should not try to find an older incomplete
      request. Given that we have deduced this must be a request on a virtual
      engine, it is the single active request in the context and so must be
      guilty (as the context is still inflight, it is prevented from being
      executed on another engine as we process the reset).
      
      Fixes: 22b7a426 ("drm/i915/execlists: Preempt-to-busy")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190923152844.8914-2-chris@chris-wilson.co.uk
      cb2377a9
    • C
      drm/i915: Fixup preempt-to-busy vs resubmission of a virtual request · b647c7df
      Chris Wilson 提交于
      As preempt-to-busy leaves the request on the HW as the resubmission is
      processed, that request may complete in the background and even cause a
      second virtual request to enter queue. This second virtual request
      breaks our "single request in the virtual pipeline" assumptions.
      Furthermore, as the virtual request may be completed and retired, we
      lose the reference the virtual engine assumes is held. Normally, just
      removing the request from the scheduler queue removes it from the
      engine, but the virtual engine keeps track of its singleton request via
      its ve->request. This pointer needs protecting with a reference.
      
      v2: Drop unnecessary motion of rq->engine = owner
      
      Fixes: 22b7a426 ("drm/i915/execlists: Preempt-to-busy")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190923152844.8914-1-chris@chris-wilson.co.uk
      b647c7df
  7. 23 9月, 2019 4 次提交
  8. 20 9月, 2019 2 次提交
    • C
      drm/i915: Mark i915_request.timeline as a volatile, rcu pointer · d19d71fc
      Chris Wilson 提交于
      The request->timeline is only valid until the request is retired (i.e.
      before it is completed). Upon retiring the request, the context may be
      unpinned and freed, and along with it the timeline may be freed. We
      therefore need to be very careful when chasing rq->timeline that the
      pointer does not disappear beneath us. The vast majority of users are in
      a protected context, either during request construction or retirement,
      where the timeline->mutex is held and the timeline cannot disappear. It
      is those few off the beaten path (where we access a second timeline) that
      need extra scrutiny -- to be added in the next patch after first adding
      the warnings about dangerous access.
      
      One complication, where we cannot use the timeline->mutex itself, is
      during request submission onto hardware (under spinlocks). Here, we want
      to check on the timeline to finalize the breadcrumb, and so we need to
      impose a second rule to ensure that the request->timeline is indeed
      valid. As we are submitting the request, it's context and timeline must
      be pinned, as it will be used by the hardware. Since it is pinned, we
      know the request->timeline must still be valid, and we cannot submit the
      idle barrier until after we release the engine->active.lock, ergo while
      submitting and holding that spinlock, a second thread cannot release the
      timeline.
      
      v2: Don't be lazy inside selftests; hold the timeline->mutex for as long
      as we need it, and tidy up acquiring the timeline with a bit of
      refactoring (i915_active_add_request)
      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/20190919111912.21631-1-chris@chris-wilson.co.uk
      d19d71fc
    • C
      drm/i915/tgl: Suspend pre-parser across GTT invalidations · c45e788d
      Chris Wilson 提交于
      Before we execute a batch, we must first issue any and all TLB
      invalidations so that batch picks up the new page table entries.
      Tigerlake's preparser is weakening our post-sync CS_STALL inside the
      invalidate pipe-control and allowing the loading of the batch buffer
      before we have setup its page table (and so it loads the wrong page and
      executes indefinitely).
      
      The igt_cs_tlb indicates that this issue can only be observed on rcs,
      even though the preparser is common to all engines. Alternatively, we
      could do TLB shootdown via mmio on updating the GTT.
      
      By inserting the pre-parser disable inside EMIT_INVALIDATE, we will also
      accidentally fixup execution that writes into subsequent batches, such
      as gem_exec_whisper and even relocations performed on the GPU. We should
      be careful not to allow this disable to become baked into the uABI! The
      issue is that if userspace relies on our disabling of the HW
      optimisation, when we are ready to enable that optimisation, userspace
      will then be broken...
      
      Testcase: igt/i915_selftests/live_gtt/igt_cs_tlb
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111753Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Acked-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190919151811.9526-1-chris@chris-wilson.co.uk
      c45e788d
  9. 17 9月, 2019 1 次提交
  10. 13 9月, 2019 1 次提交
  11. 12 9月, 2019 2 次提交
  12. 10 9月, 2019 2 次提交
    • C
      drm/i915/execlists: Ignore lost completion events · 198d2533
      Chris Wilson 提交于
      Icelake hit an issue where it missed reporting a completion event and
      instead jumped straight to a idle->active event (skipping over the
      active->idle and not even hitting the lite-restore preemption).
      
      661497511us : process_csb: rcs0 cs-irq head=11, tail=0
      661497512us : process_csb: rcs0 csb[0]: status=0x10008002:0x00000020 [lite-restore]
      661497512us : trace_ports: rcs0: preempted { 28cc8:11052, 0:0 }
      661497513us : trace_ports: rcs0: promote { 28cc8:11054, 0:0 }
      661497514us : __i915_request_submit: rcs0 fence 28cc8:11056, current 11052
      661497514us : __execlists_submission_tasklet: rcs0: queue_priority_hint:-2147483648, submit:yes
      661497515us : trace_ports: rcs0: submit { 28cc8:11056, 0:0 }
      661497530us : process_csb: rcs0 cs-irq head=0, tail=1
      661497530us : process_csb: rcs0 csb[1]: status=0x10008002:0x00000020 [lite-restore]
      661497531us : trace_ports: rcs0: preempted { 28cc8:11054!, 0:0 }
      661497535us : trace_ports: rcs0: promote { 28cc8:11056, 0:0 }
      661497540us : __i915_request_submit: rcs0 fence 28cc8:11058, current 11054
      661497544us : __execlists_submission_tasklet: rcs0: queue_priority_hint:-2147483648, submit:yes
      661497545us : trace_ports: rcs0: submit { 28cc8:11058, 0:0 }
      661497553us : process_csb: rcs0 cs-irq head=1, tail=2
      661497553us : process_csb: rcs0 csb[2]: status=0x10000001:0x00000000 [idle->active]
      661497574us : process_csb: process_csb:1538 GEM_BUG_ON(*execlists->active)
      Signed-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/20190907084334.28952-1-chris@chris-wilson.co.uk
      198d2533
    • C
      drm/i915/execlists: Clear STOP_RING bit on reset · fa9a09f1
      Chris Wilson 提交于
      During reset, we try to ensure no forward progress of the CS prior to
      the reset by setting the STOP_RING bit in RING_MI_MODE. Since gen9, this
      register is context saved and do we end up in the odd situation where we
      save the STOP_RING bit and so try to stop the engine again immediately
      upon resume. This is quite unexpected and causes us to complain about an
      early CS completion event!
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111514Signed-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/20190910080208.4223-1-chris@chris-wilson.co.uk
      fa9a09f1
  13. 09 9月, 2019 1 次提交
  14. 07 9月, 2019 2 次提交
  15. 31 8月, 2019 2 次提交
  16. 30 8月, 2019 1 次提交
  17. 28 8月, 2019 2 次提交
  18. 27 8月, 2019 1 次提交
  19. 22 8月, 2019 1 次提交
  20. 20 8月, 2019 3 次提交
  21. 17 8月, 2019 2 次提交
  22. 16 8月, 2019 2 次提交
  23. 15 8月, 2019 3 次提交