1. 01 7月, 2020 1 次提交
  2. 23 6月, 2020 1 次提交
    • J
      drm/i915/params: switch to device specific parameters · 8a25c4be
      Jani Nikula 提交于
      Start using device specific parameters instead of module parameters for
      most things. The module parameters become the immutable initial values
      for i915 parameters. The device specific parameters in i915->params
      start life as a copy of i915_modparams. Any later changes are only
      reflected in the debugfs.
      
      The stragglers are:
      
      * i915.force_probe and i915.modeset. Needed before dev_priv is
        available. This is fine because the parameters are read-only and never
        modified.
      
      * i915.verbose_state_checks. Passing dev_priv to I915_STATE_WARN and
        I915_STATE_WARN_ON would result in massive and ugly churn. This is
        handled by not exposing the parameter via debugfs, and leaving the
        parameter writable in sysfs. This may be fixed up in follow-up work.
      
      * i915.inject_probe_failure. Only makes sense in terms of the module,
        not the device. This is handled by not exposing the parameter via
        debugfs.
      
      v2: Fix uc i915 lookup code (Michał Winiarski)
      
      Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
      Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Acked-by: NMichał Winiarski <michal.winiarski@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20200618150402.14022-1-jani.nikula@intel.com
      8a25c4be
  3. 17 6月, 2020 1 次提交
  4. 10 6月, 2020 2 次提交
  5. 08 6月, 2020 1 次提交
  6. 06 6月, 2020 1 次提交
  7. 05 6月, 2020 1 次提交
    • C
      drm/i915/gem: Async GPU relocations only · 9e0f9464
      Chris Wilson 提交于
      Reduce the 3 relocation paths down to the single path that accommodates
      all. The primary motivation for this is to guard the relocations with a
      natural fence (derived from the i915_request used to write the
      relocation from the GPU).
      
      The tradeoff in using async gpu relocations is that it increases latency
      over using direct CPU relocations, for the cases where the target is
      idle and accessible by the CPU. The benefit is greatly reduced lock
      contention and improved concurrency by pipelining.
      
      Note that forcing the async gpu relocations does reveal a few issues
      they have. Firstly, is that they are visible as writes to gem_busy,
      causing to mark some buffers are being to written to by the GPU even
      though userspace only reads. Secondly is that, in combination with the
      cmdparser, they can cause priority inversions. This should be the case
      where the work is being put into a common workqueue losing our priority
      information and so being executed in FIFO from the worker, denying us
      the opportunity to reorder the requests afterwards.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200604211457.19696-1-chris@chris-wilson.co.uk
      9e0f9464
  8. 04 6月, 2020 3 次提交
  9. 03 6月, 2020 3 次提交
    • C
      drm/i915: Drop i915_request.i915 backpointer · 5a833995
      Chris Wilson 提交于
      We infrequently use the direct i915 backpointer from the i915_request,
      so do we really need to waste the space in the struct for it? 8 bytes
      from the most frequently allocated struct vs an 3 bytes and pointer
      chasing in using rq->engine->i915?
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200602220953.21178-1-chris@chris-wilson.co.uk
      5a833995
    • C
      mm: remove the prot argument from vm_map_ram · d4efd79a
      Christoph Hellwig 提交于
      This is always PAGE_KERNEL - for long term mappings with other properties
      vmap should be used.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-19-hch@lst.deSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d4efd79a
    • L
      gup: document and work around "COW can break either way" issue · 17839856
      Linus Torvalds 提交于
      Doing a "get_user_pages()" on a copy-on-write page for reading can be
      ambiguous: the page can be COW'ed at any time afterwards, and the
      direction of a COW event isn't defined.
      
      Yes, whoever writes to it will generally do the COW, but if the thread
      that did the get_user_pages() unmapped the page before the write (and
      that could happen due to memory pressure in addition to any outright
      action), the writer could also just take over the old page instead.
      
      End result: the get_user_pages() call might result in a page pointer
      that is no longer associated with the original VM, and is associated
      with - and controlled by - another VM having taken it over instead.
      
      So when doing a get_user_pages() on a COW mapping, the only really safe
      thing to do would be to break the COW when getting the page, even when
      only getting it for reading.
      
      At the same time, some users simply don't even care.
      
      For example, the perf code wants to look up the page not because it
      cares about the page, but because the code simply wants to look up the
      physical address of the access for informational purposes, and doesn't
      really care about races when a page might be unmapped and remapped
      elsewhere.
      
      This adds logic to force a COW event by setting FOLL_WRITE on any
      copy-on-write mapping when FOLL_GET (or FOLL_PIN) is used to get a page
      pointer as a result.
      
      The current semantics end up being:
      
       - __get_user_pages_fast(): no change. If you don't ask for a write,
         you won't break COW. You'd better know what you're doing.
      
       - get_user_pages_fast(): the fast-case "look it up in the page tables
         without anything getting mmap_sem" now refuses to follow a read-only
         page, since it might need COW breaking.  Which happens in the slow
         path - the fast path doesn't know if the memory might be COW or not.
      
       - get_user_pages() (including the slow-path fallback for gup_fast()):
         for a COW mapping, turn on FOLL_WRITE for FOLL_GET/FOLL_PIN, with
         very similar semantics to FOLL_FORCE.
      
      If it turns out that we want finer granularity (ie "only break COW when
      it might actually matter" - things like the zero page are special and
      don't need to be broken) we might need to push these semantics deeper
      into the lookup fault path.  So if people care enough, it's possible
      that we might end up adding a new internal FOLL_BREAK_COW flag to go
      with the internal FOLL_COW flag we already have for tracking "I had a
      COW".
      
      Alternatively, if it turns out that different callers might want to
      explicitly control the forced COW break behavior, we might even want to
      make such a flag visible to the users of get_user_pages() instead of
      using the above default semantics.
      
      But for now, this is mostly commentary on the issue (this commit message
      being a lot bigger than the patch, and that patch in turn is almost all
      comments), with that minimal "enable COW breaking early" logic using the
      existing FOLL_WRITE behavior.
      
      [ It might be worth noting that we've always had this ambiguity, and it
        could arguably be seen as a user-space issue.
      
        You only get private COW mappings that could break either way in
        situations where user space is doing cooperative things (ie fork()
        before an execve() etc), but it _is_ surprising and very subtle, and
        fork() is supposed to give you independent address spaces.
      
        So let's treat this as a kernel issue and make the semantics of
        get_user_pages() easier to understand. Note that obviously a true
        shared mapping will still get a page that can change under us, so this
        does _not_ mean that get_user_pages() somehow returns any "stable"
        page ]
      Reported-by: NJann Horn <jannh@google.com>
      Tested-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NKirill Shutemov <kirill@shutemov.name>
      Acked-by: NJan Kara <jack@suse.cz>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      17839856
  10. 30 5月, 2020 2 次提交
  11. 25 5月, 2020 3 次提交
  12. 22 5月, 2020 3 次提交
  13. 21 5月, 2020 1 次提交
    • C
      drm: Restore the NULL check for drm_gem_object_put() · 0e799e84
      Chris Wilson 提交于
      Some users want to pass NULL to drm_gem_object_put(), but those using
      __drm_gem_object_put() did not. Compromise, have both and let the
      compiler sort it out.
      
      drm_gem_fb_destroy() calls drm_gem_object_put() with NULL obj causing:
      [   11.584209] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [   11.584213] #PF: supervisor write access in kernel mode
      [   11.584215] #PF: error_code(0x0002) - not-present page
      [   11.584216] PGD 0 P4D 0
      [   11.584220] Oops: 0002 [#1] SMP NOPTI
      [   11.584223] CPU: 7 PID: 1571 Comm: gnome-shell Tainted: G            E     5.7.0-rc1-1-default+ #27
      [   11.584225] Hardware name: Micro-Star International Co., Ltd. MS-7A31/X370 XPOWER GAMING TITANIUM (MS-7A31), BIOS 1.MR 12/03/2019
      [   11.584237] RIP: 0010:drm_gem_fb_destroy+0x28/0x70 [drm_kms_helper]
      <snip>
      [   11.584256] Call Trace:
      [   11.584279]  drm_mode_rmfb+0x189/0x1c0 [drm]
      [   11.584299]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
      [   11.584314]  drm_ioctl_kernel+0xaa/0xf0 [drm]
      [   11.584329]  drm_ioctl+0x1ff/0x3b0 [drm]
      [   11.584347]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
      [   11.584421]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
      [   11.584427]  ksys_ioctl+0x87/0xc0
      [   11.584430]  __x64_sys_ioctl+0x16/0x20
      [   11.584434]  do_syscall_64+0x5f/0x240
      [   11.584438]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   11.584440] RIP: 0033:0x7f0ef80f7227
      Reported-by: NNirmoy Das <nirmoy.das@amd.com>
      Fixes: b5d25074 ("drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Nirmoy Das <nirmoy.das@amd.com>
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Cc: Christian König <christian.koenig@amd.com>.
      Acked-by: NNirmoy Das <nirmoy.das@amd.com>
      Reviewed-by: NEmil Velikov <emil.velikov@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200520142347.29060-1-chris@chris-wilson.co.uk
      0e799e84
  14. 20 5月, 2020 2 次提交
  15. 19 5月, 2020 1 次提交
  16. 16 5月, 2020 1 次提交
  17. 14 5月, 2020 2 次提交
  18. 11 5月, 2020 2 次提交
  19. 09 5月, 2020 1 次提交
  20. 08 5月, 2020 1 次提交
    • C
      drm/i915: Remove wait priority boosting · eec39e44
      Chris Wilson 提交于
      Upon waiting a request (when asked), we gave that request a small
      priority boost, not enough for it to cause preemption, but enough for it
      to be scheduled next before all equals. We also used that bit to give
      new clients a small priority boost, similar to FQ_CODEL, such that we
      favoured short interactive tasks ahead of long running streams.
      
      However, this is causing lots of complications with timeslicing where we
      both want to honour the boost and yet ignore it. Those complications
      cause unexpected user behaviour (tasks not being timesliced and run
      concurrently as epxected), and the easiest way to resolve that is to
      remove the boost. Hopefully, we can find a compromise again if we need
      to, but in theory timeslicing itself and future more advanced schedulers
      should give us the interactivity boost we seek.
      
      Testcase: igt/gem_exec_schedule/lateslice
      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/20200507152338.7452-3-chris@chris-wilson.co.uk
      eec39e44
  21. 07 5月, 2020 1 次提交
    • C
      drm/i915/gem: Remove object_is_locked assertion from unpin_from_display_plane · 47bf7b7a
      Chris Wilson 提交于
      Since moving the obj->vma.list to a spin_lock, and the vm->bound_list to
      its vm->mutex, along with tracking shrinkable status under its own
      spinlock, we no long require the object to be locked by the caller.
      
      This is fortunate as it appears we can be called with the lock along an
      error path in flipping:
      
      <4> [139.942851] WARN_ON(debug_locks && !lock_is_held(&(&((obj)->base.resv)->lock.base)->dep_map))
      <4> [139.943242] WARNING: CPU: 0 PID: 1203 at drivers/gpu/drm/i915/gem/i915_gem_domain.c:405 i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915]
      <4> [139.943263] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_realtek snd_hda_codec_generic coretemp snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core r8169 lpc_ich snd_pcm realtek prime_numbers [last unloaded: i915]
      <4> [139.943347] CPU: 0 PID: 1203 Comm: kms_flip Tainted: G     U            5.6.0-gd0fda5c2cf3f1-drmtip_474+ #1
      <4> [139.943363] Hardware name:  /D510MO, BIOS MOPNV10J.86A.0311.2010.0802.2346 08/02/2010
      <4> [139.943589] RIP: 0010:i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915]
      <4> [139.943589] Code: 85 28 01 00 00 be ff ff ff ff 48 8d 78 60 e8 d7 9b f0 e2 85 c0 75 b9 48 c7 c6 50 b9 38 c0 48 c7 c7 e9 48 3c c0 e8 20 d4 e9 e2 <0f> 0b eb a2 48 c7 c1 08 bb 38 c0 ba 0a 01 00 00 48 c7 c6 88 a3 35
      <4> [139.943589] RSP: 0018:ffffb774c0603b48 EFLAGS: 00010282
      <4> [139.943589] RAX: 0000000000000000 RBX: ffff9a142fa36e80 RCX: 0000000000000006
      <4> [139.943589] RDX: 000000000000160d RSI: ffff9a142c1a88f8 RDI: ffffffffa434a64d
      <4> [139.943589] RBP: ffff9a1410a513c0 R08: ffff9a142c1a88f8 R09: 0000000000000000
      <4> [139.943589] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9a1436ee94b8
      <4> [139.943589] R13: 0000000000000001 R14: 00000000ffffffff R15: ffff9a1410960000
      <4> [139.943589] FS:  00007fc73a744e40(0000) GS:ffff9a143da00000(0000) knlGS:0000000000000000
      <4> [139.943589] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [139.943589] CR2: 00007fc73997e098 CR3: 000000002f5fe000 CR4: 00000000000006f0
      <4> [139.943589] Call Trace:
      <4> [139.943589]  intel_pin_and_fence_fb_obj+0x1c9/0x1f0 [i915]
      <4> [139.943589]  intel_plane_pin_fb+0x3f/0xd0 [i915]
      <4> [139.943589]  intel_prepare_plane_fb+0x13b/0x5c0 [i915]
      <4> [139.943589]  drm_atomic_helper_prepare_planes+0x85/0x110
      <4> [139.943589]  intel_atomic_commit+0xda/0x390 [i915]
      <4> [139.943589]  drm_atomic_helper_page_flip+0x9c/0xd0
      <4> [139.943589]  ? drm_event_reserve_init+0x46/0x60
      <4> [139.943589]  drm_mode_page_flip_ioctl+0x587/0x5d0
      
      This completes the symmetry lost in commit 8b1c78e0 ("drm/i915: Avoid
      calling i915_gem_object_unbind holding object lock").
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1743
      Fixes: 8b1c78e0 ("drm/i915: Avoid calling i915_gem_object_unbind holding object lock")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Andi Shyti <andi.shyti@intel.com>
      Cc: <stable@vger.kernel.org> # v5.6+
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200420125356.26614-1-chris@chris-wilson.co.uk
      (cherry picked from commit a95f3ac2)
      (cherry picked from commit 2208b85fa1766ee4821a9435d548578b67090531)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      47bf7b7a
  22. 04 5月, 2020 3 次提交
  23. 02 5月, 2020 3 次提交