1. 15 3月, 2018 1 次提交
    • F
      drm/i915/gvt: Correct the privilege shadow batch buffer address · ef75c685
      fred gao 提交于
      Once the ring buffer is copied to ring_scan_buffer and scanned,
      the shadow batch buffer start address is only updated into
      ring_scan_buffer, not the real ring address allocated through
      intel_ring_begin in later copy_workload_to_ring_buffer.
      
      This patch is only to set the right shadow batch buffer address
      from Ring buffer, not include the shadow_wa_ctx.
      
      v2:
      - refine some comments. (Zhenyu)
      v3:
      - fix typo in title. (Zhenyu)
      v4:
      - remove the unnecessary comments. (Zhenyu)
      - add comments in bb_start_cmd_va update. (Zhenyu)
      
      Fixes: 0a53bc07 ("drm/i915/gvt: Separate cmd scan from request allocation")
      Cc: stable@vger.kernel.org  # v4.15
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Yulei Zhang <yulei.zhang@intel.com>
      Signed-off-by: Nfred gao <fred.gao@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      ef75c685
  2. 09 3月, 2018 2 次提交
    • M
      drm/i915/gvt: keep oa config in shadow ctx · fa3dd623
      Min He 提交于
      When populating shadow ctx from guest, we should handle oa related
      registers in hw ctx, so that they will not be overlapped by guest oa
      configs. This patch made it possible to capture oa data from host for
      both host and guests.
      Signed-off-by: NMin He <min.he@intel.com>
      Signed-off-by: NZhi Wang <zhi.a.wang@intel.com>
      fa3dd623
    • X
      drm/i915/gvt: Add runtime_pm_get/put into gvt_switch_mmio · b24881e0
      Xiong Zhang 提交于
      If user continuously create vgpu, boot guest, shoutdown guest and destroy
      vgpu from remote, the following calltrace exists in dmesg sometimes:
      [ 6412.954721] RPM wakelock ref not held during HW access
      [ 6412.954795] WARNING: CPU: 7 PID: 11941 at
      linux/drivers/gpu/drm/i915/intel_drv.h:1800
      intel_uncore_forcewake_get.part.7+0x96/0xa0 [i915]
      [ 6412.954915] Call Trace:
      [ 6412.954951] intel_uncore_forcewake_get+0x18/0x20 [i915]
      [ 6412.954989] intel_gvt_switch_mmio+0x8e/0x770 [i915]
      [ 6412.954996] ? __slab_free+0x14d/0x2c0
      [ 6412.955001] ? __slab_free+0x14d/0x2c0
      [ 6412.955006] ? __slab_free+0x14d/0x2c0
      [ 6412.955041] intel_vgpu_stop_schedule+0x92/0xd0 [i915]
      [ 6412.955073] intel_gvt_deactivate_vgpu+0x48/0x60 [i915]
      [ 6412.955078] __intel_vgpu_release+0x55/0x260 [kvmgt]
      
      when this happens, gvt_switch_mmio is called at vgpu destroy, host i915 is
      idle and doesn't hold RPM wakelock, igd is in powersave mode, but
      gvt_switch_mmio require igd power on to access register, so
      intel_runtime_pm_get should be added to make sure igd power on before
      gvt_switch_mmio.
      
      v2: Move runtime_pm_get/put into gvt_switch_mmio.(Zhenyu)
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Signed-off-by: NZhi Wang <zhi.a.wang@intel.com>
      b24881e0
  3. 14 2月, 2018 3 次提交
  4. 07 2月, 2018 4 次提交
  5. 01 2月, 2018 7 次提交
  6. 08 1月, 2018 1 次提交
    • C
      drm/i915/gvt: Fix stack-out-of-bounds bug in cmd parser · 65e74392
      Changbin Du 提交于
      for_each_set_bit() only accepts variable of type unsigned long, and we can
      not cast it from smaller types.
      
      [   16.499365] ==================================================================
      [   16.506655] BUG: KASAN: stack-out-of-bounds in find_first_bit+0x1d/0x70
      [   16.513313] Read of size 8 at addr ffff8803616cf510 by task systemd-udevd/180
      [   16.521998] CPU: 0 PID: 180 Comm: systemd-udevd Tainted: G     U     O     4.15.0-rc3+ #14
      [   16.530317] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.2.8 01/26/2016
      [   16.537760] Call Trace:
      [   16.540230]  dump_stack+0x7c/0xbb
      [   16.543569]  print_address_description+0x6b/0x290
      [   16.548306]  kasan_report+0x28a/0x370
      [   16.551993]  ? find_first_bit+0x1d/0x70
      [   16.555858]  find_first_bit+0x1d/0x70
      [   16.559625]  intel_gvt_init_cmd_parser+0x127/0x3c0 [i915]
      [   16.565060]  ? __lock_is_held+0x8f/0xf0
      [   16.568990]  ? intel_gvt_clean_cmd_parser+0x10/0x10 [i915]
      [   16.574514]  ? __hrtimer_init+0x5d/0xb0
      [   16.578445]  intel_gvt_init_device+0x2c3/0x690 [i915]
      [   16.583537]  ? unregister_module_notifier+0x20/0x20
      [   16.588515]  intel_gvt_init+0x89/0x100 [i915]
      [   16.592962]  i915_driver_load+0x1992/0x1c70 [i915]
      [   16.597846]  ? __i915_printk+0x210/0x210 [i915]
      [   16.602410]  ? wait_for_completion+0x280/0x280
      [   16.606883]  ? lock_downgrade+0x2c0/0x2c0
      [   16.610923]  ? __pm_runtime_resume+0x46/0x90
      [   16.615238]  ? acpi_dev_found+0x76/0x80
      [   16.619162]  ? i915_pci_remove+0x30/0x30 [i915]
      [   16.623733]  local_pci_probe+0x74/0xe0
      [   16.627518]  pci_device_probe+0x208/0x310
      [   16.631561]  ? pci_device_remove+0x100/0x100
      [   16.635871]  ? __list_add_valid+0x29/0xa0
      [   16.639919]  driver_probe_device+0x40b/0x6b0
      [   16.644223]  ? driver_probe_device+0x6b0/0x6b0
      [   16.648696]  __driver_attach+0x11d/0x130
      [   16.652649]  bus_for_each_dev+0xe7/0x160
      [   16.656600]  ? subsys_dev_iter_exit+0x10/0x10
      [   16.660987]  ? __list_add_valid+0x29/0xa0
      [   16.665028]  bus_add_driver+0x31d/0x3a0
      [   16.668893]  driver_register+0xc6/0x170
      [   16.672758]  ? 0xffffffffc0ad8000
      [   16.676108]  do_one_initcall+0x9c/0x206
      [   16.679984]  ? initcall_blacklisted+0x150/0x150
      [   16.684545]  ? do_init_module+0x35/0x33b
      [   16.688494]  ? kasan_unpoison_shadow+0x31/0x40
      [   16.692968]  ? kasan_kmalloc+0xa6/0xd0
      [   16.696743]  ? do_init_module+0x35/0x33b
      [   16.700694]  ? kasan_unpoison_shadow+0x31/0x40
      [   16.705168]  ? __asan_register_globals+0x82/0xa0
      [   16.709819]  do_init_module+0xe7/0x33b
      [   16.713597]  load_module+0x4481/0x4ce0
      [   16.717397]  ? module_frob_arch_sections+0x20/0x20
      [   16.722228]  ? vfs_read+0x13b/0x190
      [   16.725742]  ? kernel_read+0x74/0xa0
      [   16.729351]  ? get_user_arg_ptr.isra.17+0x70/0x70
      [   16.734099]  ? SYSC_finit_module+0x175/0x1b0
      [   16.738399]  SYSC_finit_module+0x175/0x1b0
      [   16.742524]  ? SYSC_init_module+0x1e0/0x1e0
      [   16.746741]  ? __fget+0x157/0x240
      [   16.750090]  ? trace_hardirqs_on_thunk+0x1a/0x1c
      [   16.754747]  entry_SYSCALL_64_fastpath+0x23/0x9a
      [   16.759397] RIP: 0033:0x7f8fbc837499
      [   16.762996] RSP: 002b:00007ffead76c138 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [   16.770618] RAX: ffffffffffffffda RBX: 0000000000000012 RCX: 00007f8fbc837499
      [   16.777800] RDX: 0000000000000000 RSI: 000056484e67b080 RDI: 0000000000000012
      [   16.784979] RBP: 00007ffead76b140 R08: 0000000000000000 R09: 0000000000000021
      [   16.792164] R10: 0000000000000012 R11: 0000000000000246 R12: 000056484e67b460
      [   16.799345] R13: 00007ffead76b120 R14: 0000000000000005 R15: 0000000000000000
      [   16.808052] The buggy address belongs to the page:
      [   16.812876] page:00000000dc4b8c1e count:0 mapcount:0 mapping:          (null) index:0x0
      [   16.820934] flags: 0x17ffffc0000000()
      [   16.824621] raw: 0017ffffc0000000 0000000000000000 0000000000000000 00000000ffffffff
      [   16.832416] raw: ffffea000d85b3e0 ffffea000d85b3e0 0000000000000000 0000000000000000
      [   16.840208] page dumped because: kasan: bad access detected
      [   16.847318] Memory state around the buggy address:
      [   16.852143]  ffff8803616cf400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   16.859427]  ffff8803616cf480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
      [   16.866708] >ffff8803616cf500: f1 f1 04 f4 f4 f4 f3 f3 f3 f3 00 00 00 00 00 00
      [   16.873988]                          ^
      [   16.877770]  ffff8803616cf580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   16.885042]  ffff8803616cf600: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
      [   16.892312] ==================================================================
      Signed-off-by: NChangbin Du <changbin.du@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      65e74392
  7. 04 1月, 2018 1 次提交
  8. 22 12月, 2017 4 次提交
  9. 21 12月, 2017 1 次提交
  10. 18 12月, 2017 4 次提交
  11. 12 12月, 2017 1 次提交
  12. 11 12月, 2017 3 次提交
  13. 08 12月, 2017 6 次提交
  14. 06 12月, 2017 2 次提交