1. 13 5月, 2018 1 次提交
  2. 11 5月, 2018 2 次提交
  3. 04 5月, 2018 2 次提交
  4. 03 5月, 2018 1 次提交
    • C
      drm/i915: Move timeline from GTT to ring · 65fcb806
      Chris Wilson 提交于
      In the future, we want to move a request between engines. To achieve
      this, we first realise that we have two timelines in effect here. The
      first runs through the GTT is required for ordering vma access, which is
      tracked currently by engine. The second is implied by sequential
      execution of commands inside the ringbuffer. This timeline is one that
      maps to userspace's expectations when submitting requests (i.e. given the
      same context, batch A is executed before batch B). As the rings's
      timelines map to userspace and the GTT timeline an implementation
      detail, move the timeline from the GTT into the ring itself (per-context
      in logical-ring-contexts/execlists, or a global per-engine timeline for
      the shared ringbuffers in legacy submission.
      
      The two timelines are still assumed to be equivalent at the moment (no
      migrating requests between engines yet) and so we can simply move from
      one to the other without adding extra ordering.
      
      v2: Reinforce that one isn't allowed to mix the engine execution
      timeline with the client timeline from userspace (on the ring).
      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/20180502163839.3248-1-chris@chris-wilson.co.uk
      65fcb806
  5. 22 2月, 2018 1 次提交
  6. 16 2月, 2018 1 次提交
  7. 13 2月, 2018 1 次提交
  8. 10 2月, 2018 1 次提交
  9. 01 2月, 2018 4 次提交
    • C
      drm/i915/ppgtt: Pin page directories before allocation · 751b01cb
      Chris Wilson 提交于
      Commit e2b763ca ("drm/i915: Remove bitmap tracking for used-pdpes")
      believed that because it did not insert its freshly allocated page
      directory into the pd tree, it was safe from the shrinker. I failed to
      heed the lesson learnt from commit dd19674b ("drm/i915: Remove bitmap
      tracking for used-ptes") that we need to pin all the levels in the tree
      before hitting the shrinker or else the shrinker may free an upper layer
      as we proceed to allocate the tree. Thus leaving dangling pointers
      everywhere and a GPF should we hit direct reclaim at just the wrong
      moment.
      
      CPU: 0 PID: 7374 Comm: chromium Tainted: P           O    4.14.13-1-ARCH #1
      Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, BIOS MBP121.88Z.0167.B33.1706181928 06/18/2017
      task: ffff994f696c2c40 task.stack: ffffb1a789d4c000
      RIP: 0010:gen8_ppgtt_set_pde.isra.40+0x48/0x70 [i915]
      RSP: 0018:ffffb1a789d4f940 EFLAGS: 00010206
      RAX: 81c1788cc4f68138 RBX: ffff994f54db8000 RCX: ffff994f696c2c40
      RDX: 000000023bc73003 RSI: ffff994d598b6b80 RDI: ffff994f54db8000
      RBP: ffff994d598b6b80 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffb1a789d4f550 R11: ffff994eaf3c3208 R12: 0000000000000027
      R13: 0000000000005000 R14: 0000000004e8f000 R15: ffff994f54dba000
      FS:  00007f585886aa00(0000) GS:ffff994faec00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004ac8e8 CR3: 00000002552c8004 CR4: 00000000003606f0
      Call Trace:
       gen8_ppgtt_alloc_pdp+0x178/0x320 [i915]
       gen8_ppgtt_alloc_4lvl+0x5f/0x150 [i915]
       ppgtt_bind_vma+0x30/0x70 [i915]
       i915_vma_bind+0x68/0xd0 [i915]
       __i915_vma_do_pin+0x2d6/0x3a0 [i915]
       eb_lookup_vmas+0x7a2/0xb50 [i915]
       i915_gem_do_execbuffer+0x4d7/0x10e0 [i915]
       ? sock_wfree+0x34/0x60
       ? unix_stream_read_generic+0x1f9/0x7e0
       ? import_iovec+0x37/0xd0
       ? i915_gem_execbuffer2+0x5d/0x390 [i915]
       i915_gem_execbuffer2+0x1b7/0x390 [i915]
       ? i915_gem_execbuffer+0x2d0/0x2d0 [i915]
       drm_ioctl_kernel+0x59/0xb0 [drm]
       drm_ioctl+0x2d5/0x370 [drm]
       ? i915_gem_execbuffer+0x2d0/0x2d0 [i915]
       ? __seccomp_filter+0x3b/0x260
       do_vfs_ioctl+0xa1/0x610
       ? syscall_trace_enter+0xdb/0x2b0
       SyS_ioctl+0x74/0x80
       do_syscall_64+0x55/0x110
       entry_SYSCALL64_slow_path+0x25/0x25
      RIP: 0033:0x7f584fa82d27
      RSP: 002b:00007ffee14a7828 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 000003b0126a1030 RCX: 00007f584fa82d27
      RDX: 00007ffee14a7870 RSI: 0000000040406469 RDI: 0000000000000080
      RBP: 00007ffee14a7870 R08: 0000000000000002 R09: 0000000000000077
      R10: 00007f5839f2b780 R11: 0000000000000246 R12: 0000000040406469
      R13: 0000000000000080 R14: 00007f5842b00040 R15: 0000000000000000
      Code: 01 00 83 81 58 0a 00 00 01 48 2b 05 13 9d fd c9 48 c1 f8 06 48 c1 e0 0c 48 8d 04 d0 48 8b 56 08 48 03 05 0c 9d fd c9 48 83 ca 03 <48> 89 10 83 a9 58 0a 00 00 01 65 ff 0d 37 03 fb 3e 74 02 f3 c3
      RIP: gen8_ppgtt_set_pde.isra.40+0x48/0x70 [i915] RSP: ffffb1a789d4f940
      Reported-by: NEric Blau <eblau@eblau.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104773
      Fixes: e2b763ca ("drm/i915: Remove bitmap tracking for used-pdpes")
      References: dd19674b ("drm/i915: Remove bitmap tracking for used-ptes")
      Testcase: igt/drv_selftest/live_gtt (igt_ppgtt_shrink_boom)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180131214440.7141-1-chris@chris-wilson.co.ukReviewed-by: NMatthew Auld <matthew.auld@intel.com>
      (cherry picked from commit b715a2f0)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      751b01cb
    • C
      drm/i915: Protect WC stash allocation against direct reclaim · 124804c4
      Chris Wilson 提交于
      As we attempt to allocate pages for use in a new WC stash, direct
      reclaim may run underneath us and fill up the WC stash. We have to be
      careful then not to overflow the pvec.
      
      Fixes: 66df1014 ("drm/i915: Keep a small stash of preallocated WC pages")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103109Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180121173143.17090-1-chris@chris-wilson.co.uk
      (cherry picked from commit 073cd781)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      124804c4
    • O
      drm/i915: Stop getting the fault address from RING_FAULT_REG · 25da77f8
      Oscar Mateo 提交于
      This register does not contain it. Instead, we have to look into FAULT_TLB_DATA0 & 1
      (where, by the way, we can also get the address space).
      
      v2: Right formatting
      v3:
        - Use 12 (as per the register format) instead of PAGE_SIZE (Chris)
        - s/BITS_44_TO_47/HIGHBITS (Chris)
        - Right formatting, this time for real
      
      Fixes: b03ec3d6 ("drm/i915: There is only one fault register from GEN8 onwards")
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/1513982329-32191-1-git-send-email-oscar.mateo@intel.comReviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      (cherry picked from commit 5a3f58df)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      25da77f8
    • C
      drm/i915/ppgtt: Pin page directories before allocation · b715a2f0
      Chris Wilson 提交于
      Commit e2b763ca ("drm/i915: Remove bitmap tracking for used-pdpes")
      believed that because it did not insert its freshly allocated page
      directory into the pd tree, it was safe from the shrinker. I failed to
      heed the lesson learnt from commit dd19674b ("drm/i915: Remove bitmap
      tracking for used-ptes") that we need to pin all the levels in the tree
      before hitting the shrinker or else the shrinker may free an upper layer
      as we proceed to allocate the tree. Thus leaving dangling pointers
      everywhere and a GPF should we hit direct reclaim at just the wrong
      moment.
      
      CPU: 0 PID: 7374 Comm: chromium Tainted: P           O    4.14.13-1-ARCH #1
      Hardware name: Apple Inc. MacBookPro12,1/Mac-E43C1C25D4880AD6, BIOS MBP121.88Z.0167.B33.1706181928 06/18/2017
      task: ffff994f696c2c40 task.stack: ffffb1a789d4c000
      RIP: 0010:gen8_ppgtt_set_pde.isra.40+0x48/0x70 [i915]
      RSP: 0018:ffffb1a789d4f940 EFLAGS: 00010206
      RAX: 81c1788cc4f68138 RBX: ffff994f54db8000 RCX: ffff994f696c2c40
      RDX: 000000023bc73003 RSI: ffff994d598b6b80 RDI: ffff994f54db8000
      RBP: ffff994d598b6b80 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffb1a789d4f550 R11: ffff994eaf3c3208 R12: 0000000000000027
      R13: 0000000000005000 R14: 0000000004e8f000 R15: ffff994f54dba000
      FS:  00007f585886aa00(0000) GS:ffff994faec00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004ac8e8 CR3: 00000002552c8004 CR4: 00000000003606f0
      Call Trace:
       gen8_ppgtt_alloc_pdp+0x178/0x320 [i915]
       gen8_ppgtt_alloc_4lvl+0x5f/0x150 [i915]
       ppgtt_bind_vma+0x30/0x70 [i915]
       i915_vma_bind+0x68/0xd0 [i915]
       __i915_vma_do_pin+0x2d6/0x3a0 [i915]
       eb_lookup_vmas+0x7a2/0xb50 [i915]
       i915_gem_do_execbuffer+0x4d7/0x10e0 [i915]
       ? sock_wfree+0x34/0x60
       ? unix_stream_read_generic+0x1f9/0x7e0
       ? import_iovec+0x37/0xd0
       ? i915_gem_execbuffer2+0x5d/0x390 [i915]
       i915_gem_execbuffer2+0x1b7/0x390 [i915]
       ? i915_gem_execbuffer+0x2d0/0x2d0 [i915]
       drm_ioctl_kernel+0x59/0xb0 [drm]
       drm_ioctl+0x2d5/0x370 [drm]
       ? i915_gem_execbuffer+0x2d0/0x2d0 [i915]
       ? __seccomp_filter+0x3b/0x260
       do_vfs_ioctl+0xa1/0x610
       ? syscall_trace_enter+0xdb/0x2b0
       SyS_ioctl+0x74/0x80
       do_syscall_64+0x55/0x110
       entry_SYSCALL64_slow_path+0x25/0x25
      RIP: 0033:0x7f584fa82d27
      RSP: 002b:00007ffee14a7828 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 000003b0126a1030 RCX: 00007f584fa82d27
      RDX: 00007ffee14a7870 RSI: 0000000040406469 RDI: 0000000000000080
      RBP: 00007ffee14a7870 R08: 0000000000000002 R09: 0000000000000077
      R10: 00007f5839f2b780 R11: 0000000000000246 R12: 0000000040406469
      R13: 0000000000000080 R14: 00007f5842b00040 R15: 0000000000000000
      Code: 01 00 83 81 58 0a 00 00 01 48 2b 05 13 9d fd c9 48 c1 f8 06 48 c1 e0 0c 48 8d 04 d0 48 8b 56 08 48 03 05 0c 9d fd c9 48 83 ca 03 <48> 89 10 83 a9 58 0a 00 00 01 65 ff 0d 37 03 fb 3e 74 02 f3 c3
      RIP: gen8_ppgtt_set_pde.isra.40+0x48/0x70 [i915] RSP: ffffb1a789d4f940
      Reported-by: NEric Blau <eblau@eblau.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104773
      Fixes: e2b763ca ("drm/i915: Remove bitmap tracking for used-pdpes")
      References: dd19674b ("drm/i915: Remove bitmap tracking for used-ptes")
      Testcase: igt/drv_selftest/live_gtt (igt_ppgtt_shrink_boom)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180131214440.7141-1-chris@chris-wilson.co.ukReviewed-by: NMatthew Auld <matthew.auld@intel.com>
      b715a2f0
  10. 29 1月, 2018 1 次提交
  11. 22 1月, 2018 1 次提交
  12. 11 1月, 2018 1 次提交
  13. 05 1月, 2018 1 次提交
  14. 14 12月, 2017 1 次提交
  15. 13 12月, 2017 1 次提交
  16. 12 12月, 2017 4 次提交
  17. 08 12月, 2017 1 次提交
  18. 06 12月, 2017 1 次提交
  19. 23 11月, 2017 1 次提交
  20. 21 11月, 2017 1 次提交
  21. 16 11月, 2017 2 次提交
  22. 14 11月, 2017 1 次提交
  23. 10 11月, 2017 1 次提交
  24. 09 11月, 2017 2 次提交
    • J
      drm/i915: Disable lazy PPGTT page table optimization for vGPU · b58d4bef
      Joonas Lahtinen 提交于
      When running under virtualization (vGPU active), we must disable
      the lazy PPGTT page table initialization optimization introduced by
      commit 14826673 ("drm/i915: Only initialize partially filled
      pagetables").
      
      We must do this because GVT-g makes unduly assumptions about guest
      behaviour, which this optimization breaks. This results in following
      looking errors in the host:
      
      ERROR gvt: guest page write error -22, gfn 0x7ada8, pa 0x7ada89a8, var 0x6, len 1
      
      The real fix is to not to depend on i915 driver behaviour, but instead
      either rely on only the contracts that i915 has with the hardware, or
      add some paravirtualization. While the real fix is en route, it won't
      be finished in time for 4.15, so the best option is to disable the
      optimization for now when vGPU is active to avoid breaking 4.15 guests
      in existing VM environments.
      
      Fixes: 14826673 ("drm/i915: Only initialize partially filled pagetables")
      Suggested-by: NXiaolin Zhang <xiaolin.zhang@intel.com>
      Signed-off-by: NXiaolin Zhang <xiaolin.zhang@intel.com>
      [Joonas: Rewrote the commit message and added tags.]
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171023153209.10527-1-joonas.lahtinen@linux.intel.com
      (cherry picked from commit 22a8a4fc)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      b58d4bef
    • C
      drm/i915: Deconstruct struct sgt_dma initialiser · 423a8a94
      Chris Wilson 提交于
      gcc-4.4 complains about:
      
      	struct sgt_dma iter = {
      		.sg = vma->pages->sgl,
      		.dma = sg_dma_address(iter.sg),
      		.max = iter.dma + iter.sg->length,
      	};
      
      drivers/gpu/drm/i915/i915_gem_gtt.c: In function ‘gen8_ppgtt_insert_4lvl’:
      drivers/gpu/drm/i915/i915_gem_gtt.c:938: error: ‘iter.sg’ is used uninitialized in this function
      drivers/gpu/drm/i915/i915_gem_gtt.c:939: error: ‘iter.dma’ is used uninitialized in this function
      
      and worse generates invalid code that triggers a GPF:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
      IP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in: snd_aloop nf_conntrack_ipv6 nf_defrag_ipv6 nf_log_ipv6 ip6table_filter ip6_tables ctr ccm xt_state nf_log_ipv4
      nf_log_common xt_LOG xt_limit xt_recent xt_owner xt_addrtype iptable_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat
      nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c ip_tables dm_mod vhost_net macvtap macvlan vhost tun kvm_intel kvm
      irqbypass uas usb_storage hid_multitouch btusb btrtl uvcvideo videobuf2_v4l2 videobuf2_core videodev media videobuf2_vmalloc videobuf2_memops
      sg ppdev dell_wmi sparse_keymap mei_wdt sd_mod iTCO_wdt iTCO_vendor_support rtsx_pci_ms memstick rtsx_pci_sdmmc mmc_core dell_smm_hwmon hwmon
      dell_laptop dell_smbios dcdbas joydev input_leds hci_uart btintel btqca btbcm bluetooth parport_pc parport i2c_hid
        intel_lpss_acpi intel_lpss pcspkr wmi int3400_thermal acpi_thermal_rel dell_rbtn mei_me mei snd_hda_codec_hdmi snd_hda_codec_realtek
      snd_hda_codec_generic ahci libahci acpi_pad xhci_pci xhci_hcd snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device
      snd_pcm snd_timer snd soundcore int3403_thermal arc4 e1000e ptp pps_core i2c_i801 iwlmvm mac80211 rtsx_pci iwlwifi cfg80211 rfkill
      intel_pch_thermal processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf i915 video fjes
      CPU: 2 PID: 2408 Comm: X Not tainted 4.10.0-rc5+ #1
      Hardware name: Dell Inc. Latitude E7470/0T6HHJ, BIOS 1.11.3 11/09/2016
      task: ffff880219fe4740 task.stack: ffffc90005f98000
      RIP: 0010:gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      RSP: 0018:ffffc90005f9b8c8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8802167d8000 RCX: 0000000000000001
      RDX: 00000000ffff7000 RSI: ffff880219f94140 RDI: ffff880228444000
      RBP: ffffc90005f9b948 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000080
      R13: 0000000000000001 R14: ffffc90005f9bcd7 R15: ffff88020c9a83c0
      FS:  00007fb53e1ee920(0000) GS:ffff88024dd00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000010 CR3: 000000022ef95000 CR4: 00000000003406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        ppgtt_bind_vma+0x40/0x50 [i915]
        i915_vma_bind+0xcb/0x1c0 [i915]
        __i915_vma_do_pin+0x6e/0xd0 [i915]
        i915_gem_execbuffer_reserve_vma+0x162/0x1d0 [i915]
        i915_gem_execbuffer_reserve+0x4fc/0x510 [i915]
        ? __kmalloc+0x134/0x250
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        i915_gem_do_execbuffer+0x2df/0xa00 [i915]
        ? drm_malloc_gfp.clone.0+0x42/0x80 [i915]
        ? path_put+0x22/0x30
        ? __check_object_size+0x62/0x1f0
        ? terminate_walk+0x44/0x90
        i915_gem_execbuffer2+0x95/0x1e0 [i915]
        drm_ioctl+0x243/0x490
        ? handle_pte_fault+0x1d7/0x220
        ? i915_gem_do_execbuffer+0xa00/0xa00 [i915]
        ? handle_mm_fault+0x10d/0x2a0
        vfs_ioctl+0x18/0x30
        do_vfs_ioctl+0x14b/0x3f0
        SyS_ioctl+0x92/0xa0
        entry_SYSCALL_64_fastpath+0x1a/0xa9
      RIP: 0033:0x7fb53b4fcb77
      RSP: 002b:00007ffe0c572898 EFLAGS: 00003246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 00007fb53e17c038 RCX: 00007fb53b4fcb77
      RDX: 00007ffe0c572900 RSI: 0000000040406469 RDI: 000000000000000b
      RBP: 00007fb5376d67e0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000028 R11: 0000000000003246 R12: 0000000000000000
      R13: 0000000000000000 R14: 000055eecb314d00 R15: 000055eecb315460
      Code: 0f 84 5d ff ff ff eb a2 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 58 0f 1f 44 00 00 31 c0 89 4d b0 <4c>
      8b 60 10 44 8b 70 0c 48 89 d0 4c 8b 2e 48 c1 e8 27 25 ff 01
      RIP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915] RSP: ffffc90005f9b8c8
      CR2: 0000000000000010
      
      Recent gccs, such as 4.9, 6.3 or 7.2, do not generate the warning nor do
      they explode on use. If we manually create the struct using locals from
      the stack, this should eliminate this issue, and does not alter code
      generation with gcc-7.2.
      
      Fixes: 894ccebe ("drm/i915: Micro-optimise gen8_ppgtt_insert_entries()")
      Reported-by: NKelly French <kfrench@federalhill.net>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Kelly French <kfrench@federalhill.net>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171106211128.12538-1-chris@chris-wilson.co.ukTested-by: NKelly French <kfrench@federalhill.net>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      (cherry picked from commit 5684514b)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      423a8a94
  25. 07 11月, 2017 1 次提交
    • C
      drm/i915: Deconstruct struct sgt_dma initialiser · 5684514b
      Chris Wilson 提交于
      gcc-4.4 complains about:
      
      	struct sgt_dma iter = {
      		.sg = vma->pages->sgl,
      		.dma = sg_dma_address(iter.sg),
      		.max = iter.dma + iter.sg->length,
      	};
      
      drivers/gpu/drm/i915/i915_gem_gtt.c: In function ‘gen8_ppgtt_insert_4lvl’:
      drivers/gpu/drm/i915/i915_gem_gtt.c:938: error: ‘iter.sg’ is used uninitialized in this function
      drivers/gpu/drm/i915/i915_gem_gtt.c:939: error: ‘iter.dma’ is used uninitialized in this function
      
      and worse generates invalid code that triggers a GPF:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
      IP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in: snd_aloop nf_conntrack_ipv6 nf_defrag_ipv6 nf_log_ipv6 ip6table_filter ip6_tables ctr ccm xt_state nf_log_ipv4
      nf_log_common xt_LOG xt_limit xt_recent xt_owner xt_addrtype iptable_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat
      nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c ip_tables dm_mod vhost_net macvtap macvlan vhost tun kvm_intel kvm
      irqbypass uas usb_storage hid_multitouch btusb btrtl uvcvideo videobuf2_v4l2 videobuf2_core videodev media videobuf2_vmalloc videobuf2_memops
      sg ppdev dell_wmi sparse_keymap mei_wdt sd_mod iTCO_wdt iTCO_vendor_support rtsx_pci_ms memstick rtsx_pci_sdmmc mmc_core dell_smm_hwmon hwmon
      dell_laptop dell_smbios dcdbas joydev input_leds hci_uart btintel btqca btbcm bluetooth parport_pc parport i2c_hid
        intel_lpss_acpi intel_lpss pcspkr wmi int3400_thermal acpi_thermal_rel dell_rbtn mei_me mei snd_hda_codec_hdmi snd_hda_codec_realtek
      snd_hda_codec_generic ahci libahci acpi_pad xhci_pci xhci_hcd snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device
      snd_pcm snd_timer snd soundcore int3403_thermal arc4 e1000e ptp pps_core i2c_i801 iwlmvm mac80211 rtsx_pci iwlwifi cfg80211 rfkill
      intel_pch_thermal processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf i915 video fjes
      CPU: 2 PID: 2408 Comm: X Not tainted 4.10.0-rc5+ #1
      Hardware name: Dell Inc. Latitude E7470/0T6HHJ, BIOS 1.11.3 11/09/2016
      task: ffff880219fe4740 task.stack: ffffc90005f98000
      RIP: 0010:gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      RSP: 0018:ffffc90005f9b8c8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8802167d8000 RCX: 0000000000000001
      RDX: 00000000ffff7000 RSI: ffff880219f94140 RDI: ffff880228444000
      RBP: ffffc90005f9b948 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000080
      R13: 0000000000000001 R14: ffffc90005f9bcd7 R15: ffff88020c9a83c0
      FS:  00007fb53e1ee920(0000) GS:ffff88024dd00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000010 CR3: 000000022ef95000 CR4: 00000000003406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        ppgtt_bind_vma+0x40/0x50 [i915]
        i915_vma_bind+0xcb/0x1c0 [i915]
        __i915_vma_do_pin+0x6e/0xd0 [i915]
        i915_gem_execbuffer_reserve_vma+0x162/0x1d0 [i915]
        i915_gem_execbuffer_reserve+0x4fc/0x510 [i915]
        ? __kmalloc+0x134/0x250
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        i915_gem_do_execbuffer+0x2df/0xa00 [i915]
        ? drm_malloc_gfp.clone.0+0x42/0x80 [i915]
        ? path_put+0x22/0x30
        ? __check_object_size+0x62/0x1f0
        ? terminate_walk+0x44/0x90
        i915_gem_execbuffer2+0x95/0x1e0 [i915]
        drm_ioctl+0x243/0x490
        ? handle_pte_fault+0x1d7/0x220
        ? i915_gem_do_execbuffer+0xa00/0xa00 [i915]
        ? handle_mm_fault+0x10d/0x2a0
        vfs_ioctl+0x18/0x30
        do_vfs_ioctl+0x14b/0x3f0
        SyS_ioctl+0x92/0xa0
        entry_SYSCALL_64_fastpath+0x1a/0xa9
      RIP: 0033:0x7fb53b4fcb77
      RSP: 002b:00007ffe0c572898 EFLAGS: 00003246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 00007fb53e17c038 RCX: 00007fb53b4fcb77
      RDX: 00007ffe0c572900 RSI: 0000000040406469 RDI: 000000000000000b
      RBP: 00007fb5376d67e0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000028 R11: 0000000000003246 R12: 0000000000000000
      R13: 0000000000000000 R14: 000055eecb314d00 R15: 000055eecb315460
      Code: 0f 84 5d ff ff ff eb a2 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 58 0f 1f 44 00 00 31 c0 89 4d b0 <4c>
      8b 60 10 44 8b 70 0c 48 89 d0 4c 8b 2e 48 c1 e8 27 25 ff 01
      RIP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915] RSP: ffffc90005f9b8c8
      CR2: 0000000000000010
      
      Recent gccs, such as 4.9, 6.3 or 7.2, do not generate the warning nor do
      they explode on use. If we manually create the struct using locals from
      the stack, this should eliminate this issue, and does not alter code
      generation with gcc-7.2.
      
      Fixes: 894ccebe ("drm/i915: Micro-optimise gen8_ppgtt_insert_entries()")
      Reported-by: NKelly French <kfrench@federalhill.net>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Kelly French <kfrench@federalhill.net>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171106211128.12538-1-chris@chris-wilson.co.ukTested-by: NKelly French <kfrench@federalhill.net>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      5684514b
  26. 01 11月, 2017 1 次提交
  27. 25 10月, 2017 1 次提交
  28. 17 10月, 2017 1 次提交
  29. 12 10月, 2017 1 次提交
  30. 11 10月, 2017 1 次提交