1. 03 12月, 2019 2 次提交
    • C
      drm/i915: Lift i915_vma_pin() out of intel_renderstate_emit() · 42d10511
      Chris Wilson 提交于
      Once inside a request, inside the timeline->mutex, pinning is verboten.
      
      <4> [896.032829] ======================================================
      <4> [896.032831] WARNING: possible circular locking dependency detected
      <4> [896.032835] 5.4.0-rc8-CI-Patchwork_15533+ #1 Tainted: G     U
      <4> [896.032838] ------------------------------------------------------
      <4> [896.032841] gem_exec_parall/3720 is trying to acquire lock:
      <4> [896.032844] ffff888401863270 (&kernel#2){+.+.}, at: i915_request_create+0x16/0x1c0 [i915]
      <4> [896.032915]
      but task is already holding lock:
      <4> [896.032917] ffff8883ec1c93c0 (&vm->mutex){+.+.}, at: i915_vma_pin+0xf3/0x11c0 [i915]
      <4> [896.032952]
      which lock already depends on the new lock.
      
      <4> [896.032954]
      the existing dependency chain (in reverse order) is:
      <4> [896.032956]
      -> #1 (&vm->mutex){+.+.}:
      <4> [896.032961]        __mutex_lock+0x9a/0x9d0
      <4> [896.032995]        i915_vma_pin+0xf3/0x11c0 [i915]
      <4> [896.033033]        intel_renderstate_emit+0xb9/0x9e0 [i915]
      <4> [896.033081]        i915_gem_init+0x5a9/0xa50 [i915]
      <4> [896.033112]        i915_driver_probe+0xb00/0x15f0 [i915]
      <4> [896.033144]        i915_pci_probe+0x43/0x1c0 [i915]
      <4> [896.033149]        pci_device_probe+0x9e/0x120
      <4> [896.033154]        really_probe+0xea/0x420
      <4> [896.033158]        driver_probe_device+0x10b/0x120
      <4> [896.033161]        device_driver_attach+0x4a/0x50
      <4> [896.033164]        __driver_attach+0x97/0x130
      <4> [896.033168]        bus_for_each_dev+0x74/0xc0
      <4> [896.033171]        bus_add_driver+0x142/0x220
      <4> [896.033174]        driver_register+0x56/0xf0
      <4> [896.033178]        do_one_initcall+0x58/0x2ff
      <4> [896.033183]        do_init_module+0x56/0x1f8
      <4> [896.033187]        load_module+0x243e/0x29f0
      <4> [896.033190]        __do_sys_finit_module+0xe9/0x110
      <4> [896.033194]        do_syscall_64+0x4f/0x210
      <4> [896.033197]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4> [896.033200]
      -> #0 (&kernel#2){+.+.}:
      <4> [896.033206]        __lock_acquire+0x1328/0x15d0
      <4> [896.033209]        lock_acquire+0xa7/0x1c0
      <4> [896.033213]        __mutex_lock+0x9a/0x9d0
      <4> [896.033255]        i915_request_create+0x16/0x1c0 [i915]
      <4> [896.033287]        intel_engine_flush_barriers+0x4c/0x100 [i915]
      <4> [896.033327]        ggtt_flush+0x37/0x60 [i915]
      <4> [896.033366]        i915_gem_evict_something+0x46b/0x5a0 [i915]
      <4> [896.033407]        i915_gem_gtt_insert+0x21d/0x6a0 [i915]
      <4> [896.033449]        i915_vma_pin+0xb36/0x11c0 [i915]
      <4> [896.033488]        gen6_ppgtt_pin+0xd5/0x170 [i915]
      <4> [896.033523]        ring_context_pin+0x2e/0xc0 [i915]
      <4> [896.033554]        __intel_context_do_pin+0x6b/0x190 [i915]
      <4> [896.033591]        i915_gem_do_execbuffer+0x1814/0x26c0 [i915]
      <4> [896.033627]        i915_gem_execbuffer2_ioctl+0x11b/0x460 [i915]
      <4> [896.033632]        drm_ioctl_kernel+0xa7/0xf0
      <4> [896.033635]        drm_ioctl+0x2e1/0x390
      <4> [896.033638]        do_vfs_ioctl+0xa0/0x6f0
      <4> [896.033641]        ksys_ioctl+0x35/0x60
      <4> [896.033644]        __x64_sys_ioctl+0x11/0x20
      <4> [896.033647]        do_syscall_64+0x4f/0x210
      <4> [896.033650]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Lift the object allocation and pin prior to the request construction.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202204316.2665847-1-chris@chris-wilson.co.uk
      42d10511
    • C
      drm/i915/gem: Take runtime-pm wakeref prior to unbinding · 3e817471
      Chris Wilson 提交于
      Some machines require ACPI for runtime resume, and ACPI is quite kmalloc
      happy. We cannot handle kmalloc from inside the vm->mutex, as they are
      used by the shrinker, and so we must ensure the global runtime-pm is
      awake prior to unbinding to avoid the potential inversion.
      
      <4> [57.121748] ======================================================
      <4> [57.121750] WARNING: possible circular locking dependency detected
      <4> [57.121753] 5.4.0-rc8-CI-CI_DRM_7466+ #1 Tainted: G     U
      <4> [57.121754] ------------------------------------------------------
      <4> [57.121756] i915_pm_rpm/1105 is trying to acquire lock:
      <4> [57.121758] ffffffff82263a40 (fs_reclaim){+.+.}, at: fs_reclaim_acquire.part.117+0x0/0x30
      <4> [57.121766]
      but task is already holding lock:
      <4> [57.121768] ffff888475a593c0 (&vm->mutex){+.+.}, at: i915_vma_unbind+0x21/0x50 [i915]
      <4> [57.121868]
      which lock already depends on the new lock.
      
      <4> [57.121869]
      the existing dependency chain (in reverse order) is:
      <4> [57.121871]
      -> #1 (&vm->mutex){+.+.}:
      <4> [57.121951]        i915_gem_shrinker_taints_mutex+0xa2/0xd0 [i915]
      <4> [57.122028]        i915_address_space_init+0xa9/0x170 [i915]
      <4> [57.122104]        i915_ggtt_init_hw+0x47/0x130 [i915]
      <4> [57.122150]        i915_driver_probe+0xbb4/0x15f0 [i915]
      <4> [57.122197]        i915_pci_probe+0x43/0x1c0 [i915]
      <4> [57.122202]        pci_device_probe+0x9e/0x120
      <4> [57.122206]        really_probe+0xea/0x420
      <4> [57.122209]        driver_probe_device+0x10b/0x120
      <4> [57.122212]        device_driver_attach+0x4a/0x50
      <4> [57.122214]        __driver_attach+0x97/0x130
      <4> [57.122217]        bus_for_each_dev+0x74/0xc0
      <4> [57.122220]        bus_add_driver+0x142/0x220
      <4> [57.122222]        driver_register+0x56/0xf0
      <4> [57.122226]        do_one_initcall+0x58/0x2ff
      <4> [57.122230]        do_init_module+0x56/0x1f8
      <4> [57.122233]        load_module+0x243e/0x29f0
      <4> [57.122236]        __do_sys_finit_module+0xe9/0x110
      <4> [57.122239]        do_syscall_64+0x4f/0x210
      <4> [57.122242]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4> [57.122244]
      -> #0 (fs_reclaim){+.+.}:
      <4> [57.122249]        __lock_acquire+0x1328/0x15d0
      <4> [57.122251]        lock_acquire+0xa7/0x1c0
      <4> [57.122254]        fs_reclaim_acquire.part.117+0x24/0x30
      <4> [57.122257]        __kmalloc+0x48/0x320
      <4> [57.122261]        acpi_ns_internalize_name+0x44/0x9b
      <4> [57.122264]        acpi_ns_get_node_unlocked+0x6b/0xd3
      <4> [57.122267]        acpi_ns_get_node+0x3b/0x50
      <4> [57.122271]        acpi_get_handle+0x8a/0xb4
      <4> [57.122274]        acpi_has_method+0x1c/0x40
      <4> [57.122278]        acpi_pci_set_power_state+0x40/0xe0
      <4> [57.122281]        pci_platform_power_transition+0x3e/0x90
      <4> [57.122284]        pci_set_power_state+0x83/0xf0
      <4> [57.122287]        pci_restore_standard_config+0x22/0x40
      <4> [57.122289]        pci_pm_runtime_resume+0x23/0xc0
      <4> [57.122293]        __rpm_callback+0xb1/0x110
      <4> [57.122296]        rpm_callback+0x1a/0x70
      <4> [57.122299]        rpm_resume+0x50e/0x790
      <4> [57.122302]        __pm_runtime_resume+0x42/0x80
      <4> [57.122357]        __intel_runtime_pm_get+0x15/0x60 [i915]
      <4> [57.122435]        ggtt_unbind_vma+0x24/0x60 [i915]
      <4> [57.122514]        __i915_vma_unbind.part.39+0xb5/0x500 [i915]
      <4> [57.122593]        i915_vma_unbind+0x2d/0x50 [i915]
      <4> [57.122668]        i915_gem_object_unbind+0x11c/0x260 [i915]
      <4> [57.122740]        i915_gem_object_set_cache_level+0x32/0x90 [i915]
      <4> [57.122810]        i915_gem_set_caching_ioctl+0x1f7/0x2f0 [i915]
      <4> [57.122815]        drm_ioctl_kernel+0xa7/0xf0
      <4> [57.122818]        drm_ioctl+0x2e1/0x390
      <4> [57.122822]        do_vfs_ioctl+0xa0/0x6f0
      <4> [57.122825]        ksys_ioctl+0x35/0x60
      <4> [57.122828]        __x64_sys_ioctl+0x11/0x20
      <4> [57.122830]        do_syscall_64+0x4f/0x210
      <4> [57.122833]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Closes: https://gitlab.freedesktop.org/drm/intel/issues/711Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191203101347.2836057-1-chris@chris-wilson.co.uk
      3e817471
  2. 21 11月, 2019 1 次提交
  3. 16 11月, 2019 1 次提交
  4. 06 11月, 2019 1 次提交
    • J
      drm/i915: Support ro ppgtt mapped cmdparser shadow buffers · 4f7af194
      Jon Bloomfield 提交于
      For Gen7, the original cmdparser motive was to permit limited
      use of register read/write instructions in unprivileged BB's.
      This worked by copying the user supplied bb to a kmd owned
      bb, and running it in secure mode, from the ggtt, only if
      the scanner finds no unsafe commands or registers.
      
      For Gen8+ we can't use this same technique because running bb's
      from the ggtt also disables access to ppgtt space. But we also
      do not actually require 'secure' execution since we are only
      trying to reduce the available command/register set. Instead we
      will copy the user buffer to a kmd owned read-only bb in ppgtt,
      and run in the usual non-secure mode.
      
      Note that ro pages are only supported by ppgtt (not ggtt), but
      luckily that's exactly what we need.
      
      Add the required paths to map the shadow buffer to ppgtt ro for Gen8+
      
      v2: IS_GEN7/IS_GEN (Mika)
      v3: rebase
      v4: rebase
      v5: rebase
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      4f7af194
  5. 05 11月, 2019 1 次提交
  6. 01 11月, 2019 2 次提交
  7. 29 10月, 2019 1 次提交
  8. 27 10月, 2019 1 次提交
  9. 23 10月, 2019 1 次提交
  10. 22 10月, 2019 5 次提交
  11. 18 10月, 2019 1 次提交
  12. 17 10月, 2019 3 次提交
    • C
      drm/i915: Store i915_ggtt as the backpointer on fence registers · e9d4c924
      Chris Wilson 提交于
      Now that i915_ggtt knows everything about its own paths to perform mmio,
      we can use that as our primary backpointer for individual fence
      registers. This reduces the amount of pointer dancing we have to perform
      on the common paths, but more importantly finishes our fence register
      encapsulation.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191016143234.4075-1-chris@chris-wilson.co.uk
      e9d4c924
    • C
      drm/i915: Do initial mocs configuration directly · eca0b720
      Chris Wilson 提交于
      Now that we record the default "goldenstate" context, we do not need to
      emit the mocs registers at the start of each context and can simply do
      mmio before the first context and capture the registers as part of its
      default image. As a consequence, this means that we repeat the mmio
      after each engine reset, fixing up any platform and registers that were
      zapped by the reset (for those platforms with global not context-saved
      settings).
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111723
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111645Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>
      Reviewed-by: NPrathap Kumar Valsan <prathap.kumar.valsan@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191016090749.7092-1-chris@chris-wilson.co.uk
      eca0b720
    • C
      drm/i915/userptr: Never allow userptr into the mappable GGTT · 4f2a572e
      Chris Wilson 提交于
      Daniel Vetter uncovered a nasty cycle in using the mmu-notifiers to
      invalidate userptr objects which also happen to be pulled into GGTT
      mmaps. That is when we unbind the userptr object (on mmu invalidation),
      we revoke all CPU mmaps, which may then recurse into mmu invalidation.
      
      We looked for ways of breaking the cycle, but the revocation on
      invalidation is required and cannot be avoided. The only solution we
      could see was to not allow such GGTT bindings of userptr objects in the
      first place. In practice, no one really wants to use a GGTT mmapping of
      a CPU pointer...
      
      Just before Daniel's explosive lockdep patches land in v5.4-rc1, we got
      a genuine blip from CI:
      
      <4>[  246.793958] ======================================================
      <4>[  246.793972] WARNING: possible circular locking dependency detected
      <4>[  246.793989] 5.3.0-gbd6c56f50d15-drmtip_372+ #1 Tainted: G     U
      <4>[  246.794003] ------------------------------------------------------
      <4>[  246.794017] kswapd0/145 is trying to acquire lock:
      <4>[  246.794030] 000000003f565be6 (&dev->struct_mutex/1){+.+.}, at: userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
      <4>[  246.794250]
                        but task is already holding lock:
      <4>[  246.794263] 000000001799cef9 (&anon_vma->rwsem){++++}, at: page_lock_anon_vma_read+0xe6/0x2a0
      <4>[  246.794291]
                        which lock already depends on the new lock.
      
      <4>[  246.794307]
                        the existing dependency chain (in reverse order) is:
      <4>[  246.794322]
                        -> #3 (&anon_vma->rwsem){++++}:
      <4>[  246.794344]        down_write+0x33/0x70
      <4>[  246.794357]        __vma_adjust+0x3d9/0x7b0
      <4>[  246.794370]        __split_vma+0x16a/0x180
      <4>[  246.794385]        mprotect_fixup+0x2a5/0x320
      <4>[  246.794399]        do_mprotect_pkey+0x208/0x2e0
      <4>[  246.794413]        __x64_sys_mprotect+0x16/0x20
      <4>[  246.794429]        do_syscall_64+0x55/0x1c0
      <4>[  246.794443]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794456]
                        -> #2 (&mapping->i_mmap_rwsem){++++}:
      <4>[  246.794478]        down_write+0x33/0x70
      <4>[  246.794493]        unmap_mapping_pages+0x48/0x130
      <4>[  246.794519]        i915_vma_revoke_mmap+0x81/0x1b0 [i915]
      <4>[  246.794519]        i915_vma_unbind+0x11d/0x4a0 [i915]
      <4>[  246.794519]        i915_vma_destroy+0x31/0x300 [i915]
      <4>[  246.794519]        __i915_gem_free_objects+0xb8/0x4b0 [i915]
      <4>[  246.794519]        drm_file_free.part.0+0x1e6/0x290
      <4>[  246.794519]        drm_release+0xa6/0xe0
      <4>[  246.794519]        __fput+0xc2/0x250
      <4>[  246.794519]        task_work_run+0x82/0xb0
      <4>[  246.794519]        do_exit+0x35b/0xdb0
      <4>[  246.794519]        do_group_exit+0x34/0xb0
      <4>[  246.794519]        __x64_sys_exit_group+0xf/0x10
      <4>[  246.794519]        do_syscall_64+0x55/0x1c0
      <4>[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794519]
                        -> #1 (&vm->mutex){+.+.}:
      <4>[  246.794519]        i915_gem_shrinker_taints_mutex+0x6d/0xe0 [i915]
      <4>[  246.794519]        i915_address_space_init+0x9f/0x160 [i915]
      <4>[  246.794519]        i915_ggtt_init_hw+0x55/0x170 [i915]
      <4>[  246.794519]        i915_driver_probe+0xc9f/0x1620 [i915]
      <4>[  246.794519]        i915_pci_probe+0x43/0x1b0 [i915]
      <4>[  246.794519]        pci_device_probe+0x9e/0x120
      <4>[  246.794519]        really_probe+0xea/0x3d0
      <4>[  246.794519]        driver_probe_device+0x10b/0x120
      <4>[  246.794519]        device_driver_attach+0x4a/0x50
      <4>[  246.794519]        __driver_attach+0x97/0x130
      <4>[  246.794519]        bus_for_each_dev+0x74/0xc0
      <4>[  246.794519]        bus_add_driver+0x13f/0x210
      <4>[  246.794519]        driver_register+0x56/0xe0
      <4>[  246.794519]        do_one_initcall+0x58/0x300
      <4>[  246.794519]        do_init_module+0x56/0x1f6
      <4>[  246.794519]        load_module+0x25bd/0x2a40
      <4>[  246.794519]        __se_sys_finit_module+0xd3/0xf0
      <4>[  246.794519]        do_syscall_64+0x55/0x1c0
      <4>[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794519]
                        -> #0 (&dev->struct_mutex/1){+.+.}:
      <4>[  246.794519]        __lock_acquire+0x15d8/0x1e90
      <4>[  246.794519]        lock_acquire+0xa6/0x1c0
      <4>[  246.794519]        __mutex_lock+0x9d/0x9b0
      <4>[  246.794519]        userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
      <4>[  246.794519]        __mmu_notifier_invalidate_range_start+0x85/0x110
      <4>[  246.794519]        try_to_unmap_one+0x76b/0x860
      <4>[  246.794519]        rmap_walk_anon+0x104/0x280
      <4>[  246.794519]        try_to_unmap+0xc0/0xf0
      <4>[  246.794519]        shrink_page_list+0x561/0xc10
      <4>[  246.794519]        shrink_inactive_list+0x220/0x440
      <4>[  246.794519]        shrink_node_memcg+0x36e/0x740
      <4>[  246.794519]        shrink_node+0xcb/0x490
      <4>[  246.794519]        balance_pgdat+0x241/0x580
      <4>[  246.794519]        kswapd+0x16c/0x530
      <4>[  246.794519]        kthread+0x119/0x130
      <4>[  246.794519]        ret_from_fork+0x24/0x50
      <4>[  246.794519]
                        other info that might help us debug this:
      
      <4>[  246.794519] Chain exists of:
                          &dev->struct_mutex/1 --> &mapping->i_mmap_rwsem --> &anon_vma->rwsem
      
      <4>[  246.794519]  Possible unsafe locking scenario:
      
      <4>[  246.794519]        CPU0                    CPU1
      <4>[  246.794519]        ----                    ----
      <4>[  246.794519]   lock(&anon_vma->rwsem);
      <4>[  246.794519]                                lock(&mapping->i_mmap_rwsem);
      <4>[  246.794519]                                lock(&anon_vma->rwsem);
      <4>[  246.794519]   lock(&dev->struct_mutex/1);
      <4>[  246.794519]
                         *** DEADLOCK ***
      
      v2: Say no to mmap_ioctl
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111744
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111870Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190928082546.3473-1-chris@chris-wilson.co.uk
      (cherry picked from commit a4311745)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      4f2a572e
  13. 04 10月, 2019 10 次提交
  14. 02 10月, 2019 1 次提交
    • C
      drm/i915/userptr: Never allow userptr into the mappable GGTT · a4311745
      Chris Wilson 提交于
      Daniel Vetter uncovered a nasty cycle in using the mmu-notifiers to
      invalidate userptr objects which also happen to be pulled into GGTT
      mmaps. That is when we unbind the userptr object (on mmu invalidation),
      we revoke all CPU mmaps, which may then recurse into mmu invalidation.
      
      We looked for ways of breaking the cycle, but the revocation on
      invalidation is required and cannot be avoided. The only solution we
      could see was to not allow such GGTT bindings of userptr objects in the
      first place. In practice, no one really wants to use a GGTT mmapping of
      a CPU pointer...
      
      Just before Daniel's explosive lockdep patches land in v5.4-rc1, we got
      a genuine blip from CI:
      
      <4>[  246.793958] ======================================================
      <4>[  246.793972] WARNING: possible circular locking dependency detected
      <4>[  246.793989] 5.3.0-gbd6c56f50d15-drmtip_372+ #1 Tainted: G     U
      <4>[  246.794003] ------------------------------------------------------
      <4>[  246.794017] kswapd0/145 is trying to acquire lock:
      <4>[  246.794030] 000000003f565be6 (&dev->struct_mutex/1){+.+.}, at: userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
      <4>[  246.794250]
                        but task is already holding lock:
      <4>[  246.794263] 000000001799cef9 (&anon_vma->rwsem){++++}, at: page_lock_anon_vma_read+0xe6/0x2a0
      <4>[  246.794291]
                        which lock already depends on the new lock.
      
      <4>[  246.794307]
                        the existing dependency chain (in reverse order) is:
      <4>[  246.794322]
                        -> #3 (&anon_vma->rwsem){++++}:
      <4>[  246.794344]        down_write+0x33/0x70
      <4>[  246.794357]        __vma_adjust+0x3d9/0x7b0
      <4>[  246.794370]        __split_vma+0x16a/0x180
      <4>[  246.794385]        mprotect_fixup+0x2a5/0x320
      <4>[  246.794399]        do_mprotect_pkey+0x208/0x2e0
      <4>[  246.794413]        __x64_sys_mprotect+0x16/0x20
      <4>[  246.794429]        do_syscall_64+0x55/0x1c0
      <4>[  246.794443]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794456]
                        -> #2 (&mapping->i_mmap_rwsem){++++}:
      <4>[  246.794478]        down_write+0x33/0x70
      <4>[  246.794493]        unmap_mapping_pages+0x48/0x130
      <4>[  246.794519]        i915_vma_revoke_mmap+0x81/0x1b0 [i915]
      <4>[  246.794519]        i915_vma_unbind+0x11d/0x4a0 [i915]
      <4>[  246.794519]        i915_vma_destroy+0x31/0x300 [i915]
      <4>[  246.794519]        __i915_gem_free_objects+0xb8/0x4b0 [i915]
      <4>[  246.794519]        drm_file_free.part.0+0x1e6/0x290
      <4>[  246.794519]        drm_release+0xa6/0xe0
      <4>[  246.794519]        __fput+0xc2/0x250
      <4>[  246.794519]        task_work_run+0x82/0xb0
      <4>[  246.794519]        do_exit+0x35b/0xdb0
      <4>[  246.794519]        do_group_exit+0x34/0xb0
      <4>[  246.794519]        __x64_sys_exit_group+0xf/0x10
      <4>[  246.794519]        do_syscall_64+0x55/0x1c0
      <4>[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794519]
                        -> #1 (&vm->mutex){+.+.}:
      <4>[  246.794519]        i915_gem_shrinker_taints_mutex+0x6d/0xe0 [i915]
      <4>[  246.794519]        i915_address_space_init+0x9f/0x160 [i915]
      <4>[  246.794519]        i915_ggtt_init_hw+0x55/0x170 [i915]
      <4>[  246.794519]        i915_driver_probe+0xc9f/0x1620 [i915]
      <4>[  246.794519]        i915_pci_probe+0x43/0x1b0 [i915]
      <4>[  246.794519]        pci_device_probe+0x9e/0x120
      <4>[  246.794519]        really_probe+0xea/0x3d0
      <4>[  246.794519]        driver_probe_device+0x10b/0x120
      <4>[  246.794519]        device_driver_attach+0x4a/0x50
      <4>[  246.794519]        __driver_attach+0x97/0x130
      <4>[  246.794519]        bus_for_each_dev+0x74/0xc0
      <4>[  246.794519]        bus_add_driver+0x13f/0x210
      <4>[  246.794519]        driver_register+0x56/0xe0
      <4>[  246.794519]        do_one_initcall+0x58/0x300
      <4>[  246.794519]        do_init_module+0x56/0x1f6
      <4>[  246.794519]        load_module+0x25bd/0x2a40
      <4>[  246.794519]        __se_sys_finit_module+0xd3/0xf0
      <4>[  246.794519]        do_syscall_64+0x55/0x1c0
      <4>[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  246.794519]
                        -> #0 (&dev->struct_mutex/1){+.+.}:
      <4>[  246.794519]        __lock_acquire+0x15d8/0x1e90
      <4>[  246.794519]        lock_acquire+0xa6/0x1c0
      <4>[  246.794519]        __mutex_lock+0x9d/0x9b0
      <4>[  246.794519]        userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
      <4>[  246.794519]        __mmu_notifier_invalidate_range_start+0x85/0x110
      <4>[  246.794519]        try_to_unmap_one+0x76b/0x860
      <4>[  246.794519]        rmap_walk_anon+0x104/0x280
      <4>[  246.794519]        try_to_unmap+0xc0/0xf0
      <4>[  246.794519]        shrink_page_list+0x561/0xc10
      <4>[  246.794519]        shrink_inactive_list+0x220/0x440
      <4>[  246.794519]        shrink_node_memcg+0x36e/0x740
      <4>[  246.794519]        shrink_node+0xcb/0x490
      <4>[  246.794519]        balance_pgdat+0x241/0x580
      <4>[  246.794519]        kswapd+0x16c/0x530
      <4>[  246.794519]        kthread+0x119/0x130
      <4>[  246.794519]        ret_from_fork+0x24/0x50
      <4>[  246.794519]
                        other info that might help us debug this:
      
      <4>[  246.794519] Chain exists of:
                          &dev->struct_mutex/1 --> &mapping->i_mmap_rwsem --> &anon_vma->rwsem
      
      <4>[  246.794519]  Possible unsafe locking scenario:
      
      <4>[  246.794519]        CPU0                    CPU1
      <4>[  246.794519]        ----                    ----
      <4>[  246.794519]   lock(&anon_vma->rwsem);
      <4>[  246.794519]                                lock(&mapping->i_mmap_rwsem);
      <4>[  246.794519]                                lock(&anon_vma->rwsem);
      <4>[  246.794519]   lock(&dev->struct_mutex/1);
      <4>[  246.794519]
                         *** DEADLOCK ***
      
      v2: Say no to mmap_ioctl
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111744
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111870Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190928082546.3473-1-chris@chris-wilson.co.uk
      a4311745
  15. 28 9月, 2019 1 次提交
  16. 27 9月, 2019 1 次提交
  17. 11 9月, 2019 2 次提交
  18. 07 9月, 2019 3 次提交
  19. 24 8月, 2019 2 次提交