1. 28 5月, 2019 2 次提交
  2. 21 5月, 2019 2 次提交
    • Y
      drm/i915/gvt: use cmd to restore in-context mmios to hw for gen9 platform · df2ea3c2
      Yan Zhao 提交于
      for restore-inhibit context, hardware will not load in-context mmios
      (engine context part) to hardware, but hardware will save the mmio
      values in hardware back to context image. So, in order to save correct
      values of vGPU back to context image, values of vGPU mmios have to be
      loaded into hardware first for restore-inhibit context.
      
      In this patch, the mechanism is applied to all gen9 platform.
      
      The reason excluding gen8 platforms is only because of lacking of testing
      on those platforms.
      
      v3: for mocs registers, goto in-context mmios save-restore path for skl
      platform as well (weinan li)
      v2: update vreg when scanning indirect context for inhibit context for
      gen9
      
      Cc: Weinan Li <weinan.z.li@intel.com>
      Acked-by: NWeinan Li <weinan.z.li@intel.com>
      Signed-off-by: NYan Zhao <yan.y.zhao@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      df2ea3c2
    • W
      drm/i915/gvt: emit init breadcrumb for gvt request · a8c2d5ab
      Weinan 提交于
      "To track whether a request has started on HW, we can emit a breadcrumb at
      the beginning of the request and check its timeline's HWSP to see if the
      breadcrumb has advanced past the start of this request." It means all the
      request which timeline's has_init_breadcrumb is true, then the
      emit_init_breadcrumb process must have before emitting the real commands,
      otherwise, the scheduler might get a wrong state of this request during
      reset. If the request is exactly the guilty one, the scheduler won't
      terminate it with the wrong state. To avoid this, do emit_init_breadcrumb
      for all the requests from gvt.
      
      v2: cc to stable kernel
      
      Fixes: 85474441 ("drm/i915: Identify active requests")
      Cc: stable@vger.kernel.org
      Acked-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NWeinan <weinan.z.li@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      a8c2d5ab
  3. 27 4月, 2019 3 次提交
  4. 25 4月, 2019 1 次提交
  5. 02 4月, 2019 1 次提交
  6. 29 3月, 2019 1 次提交
  7. 21 3月, 2019 1 次提交
  8. 15 3月, 2019 1 次提交
  9. 06 3月, 2019 1 次提交
  10. 04 3月, 2019 1 次提交
  11. 01 3月, 2019 2 次提交
    • Z
      drm/i915/gvt: Don't submit request for error workload dispatch · f552e7bd
      Zhenyu Wang 提交于
      As vGPU shadow ctx is loaded with guest context state, arbitrarily
      submitting request in error workload dispatch path would cause trouble.
      So don't try to submit in error path now like in previous code.
      This is to fix VM failure when GPU hang happens.
      
      Fixes: f0e99437 ("drm/i915/gvt: Fix workload request allocation before request add")
      Reviewed-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      f552e7bd
    • W
      drm/i915/gvt: stop scheduling workload when vgpu is inactive · 9f498477
      Weinan Li 提交于
      There is one corner case that workload_thread may pick and dispatch one
      workload of vgpu after it's already deactivated. Below is the scenario:
      
      1. deactive_vgpu got the vgpu_lock, it found pending workload was
      submitted, then it released the vgpu_lock and wait for vgpu idle.
      2. before deactive_vgpu got the vgpu_lock back, workload_thread might pick
      one new valid workload, then it was blocked by the vgpu_lock.
      3. deactive_vgpu got the vgpu_lock again, finished the last processes of
      deactivating, then release the vgpu_lock.
      4. workload_thread got the vgpu_lock, then it will try to dispatch the
      fetched workload. It's not expected one workload of deactivated vgpu is
      dispatched.
      
      The solution is to add condition check of the vgpu's active flag and stop
      to schedule when it's inactive.
      Reviewed-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NWeinan Li <weinan.z.li@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      9f498477
  12. 23 1月, 2019 1 次提交
  13. 15 1月, 2019 1 次提交
    • C
      drm/i915: Markup paired operations on wakerefs · 16e4dd03
      Chris Wilson 提交于
      The majority of runtime-pm operations are bounded and scoped within a
      function; these are easy to verify that the wakeref are handled
      correctly. We can employ the compiler to help us, and reduce the number
      of wakerefs tracked when debugging, by passing around cookies provided
      by the various rpm_get functions to their rpm_put counterpart. This
      makes the pairing explicit, and given the required wakeref cookie the
      compiler can verify that we pass an initialised value to the rpm_put
      (quite handy for double checking error paths).
      
      For regular builds, the compiler should be able to eliminate the unused
      local variables and the program growth should be minimal. Fwiw, it came
      out as a net improvement as gcc was able to refactor rpm_get and
      rpm_get_if_in_use together,
      
      v2: Just s/rpm_put/rpm_put_unchecked/ everywhere, leaving the manual
      mark up for smaller more targeted patches.
      v3: Mention the cookie in Returns
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190114142129.24398-2-chris@chris-wilson.co.uk
      16e4dd03
  14. 10 1月, 2019 1 次提交
  15. 09 1月, 2019 1 次提交
    • Z
      drm/i915/gvt: Fix workload request allocation before request add · f0e99437
      Zhenyu Wang 提交于
      In commit 6bb2a2af ("drm/i915/gvt: Fix crash after request->hw_context change"),
      forgot to handle workload scan path in ELSP handler case which was to
      optimize scanning earlier instead of in gvt submission thread, so request
      alloc and add was splitting then which is against right process.
      
      This trys to do a partial revert of that commit which still has workload
      request alloc helper and make sure shadow state population is handled after
      request alloc for target state buffer.
      
      v3: Fix missed workload status setting in request alloc error path
      v2: Fix dispatch workload err path that should add request after alloc anyway.
      
      Fixes: 6bb2a2af ("drm/i915/gvt: Fix crash after request->hw_context change")
      Cc: Bin Yang <bin.yang@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Tested-by: NBin Yang <bin.yang@intel.com>
      Reviewed-by: NXiaolin Zhang <xiaolin.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      f0e99437
  16. 07 12月, 2018 1 次提交
  17. 19 10月, 2018 1 次提交
    • X
      drm/i915: Add ppgtt to GVT GEM context · 4f15665c
      Xiong Zhang 提交于
      Currently the guest couldn't boot up under GVT-g environment as the
      following call trace exists:
      [  272.504762] BUG: unable to handle kernel NULL pointer dereference at 0000000000000100
      [  272.504834] Call Trace:
      [  272.504852]  execlists_context_pin+0x2b2/0x520 [i915]
      [  272.504869]  intel_gvt_scan_and_shadow_workload+0x50/0x4d0 [i915]
      [  272.504887]  intel_vgpu_create_workload+0x3e2/0x570 [i915]
      [  272.504901]  intel_vgpu_submit_execlist+0xc0/0x2a0 [i915]
      [  272.504916]  elsp_mmio_write+0xc7/0x130 [i915]
      [  272.504930]  intel_vgpu_mmio_reg_rw+0x24a/0x4c0 [i915]
      [  272.504944]  intel_vgpu_emulate_mmio_write+0xac/0x240 [i915]
      [  272.504947]  intel_vgpu_rw+0x22d/0x270 [kvmgt]
      [  272.504949]  intel_vgpu_write+0x164/0x1f0 [kvmgt]
      
      GVT GEM context is created by i915_gem_context_create_gvt() which
      doesn't allocate ppgtt. So GVT GEM context structure doesn't have
      a valid i915_hw_ppgtt.
      
      This patch create ppgtt table at GVT GEM context creation, then assign
      shadow ppgtt's root table address to this ppgtt when shadow ppgtt will
      be used on GPU. So GVT GEM context has valid ppgtt address. But note
      that this ppgtt only contain valid ppgtt root table address, the table
      entry in this ppgtt structure are invalid.
      
      Fixes:4a3d3f67("drm/i915: Match code to comment and enforce ppgtt for execlists")
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Reviewed-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/1539841231-3157-1-git-send-email-xiong.y.zhang@intel.com
      4f15665c
  18. 13 8月, 2018 1 次提交
  19. 07 8月, 2018 1 次提交
  20. 02 8月, 2018 1 次提交
  21. 07 7月, 2018 1 次提交
  22. 13 6月, 2018 1 次提交
  23. 11 6月, 2018 1 次提交
  24. 21 5月, 2018 1 次提交
  25. 18 5月, 2018 4 次提交
    • C
      drm/i915: Store a pointer to intel_context in i915_request · 1fc44d9b
      Chris Wilson 提交于
      To ease the frequent and ugly pointer dance of
      &request->gem_context->engine[request->engine->id] during request
      submission, store that pointer as request->hw_context. One major
      advantage that we will exploit later is that this decouples the logical
      context state from the engine itself.
      
      v2: Set mock_context->ops so we don't crash and burn in selftests.
          Cleanups from Tvrtko.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Acked-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-3-chris@chris-wilson.co.uk
      1fc44d9b
    • C
      drm/i915: Move request->ctx aside · 4e0d64db
      Chris Wilson 提交于
      In the next patch, we want to store the intel_context pointer inside
      i915_request, as it is frequently access via a convoluted dance when
      submitting the request to hw. Having two context pointers inside
      i915_request leads to confusion so first rename the existing
      i915_gem_context pointer to i915_request.gem_context.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-1-chris@chris-wilson.co.uk
      4e0d64db
    • C
      drm/i915/gvt: Use sched_lock to protect gvt scheduler logic. · 9a512e23
      Colin Xu 提交于
      The scheduler lock(gvt->sched_lock) is used to protect gvt
      scheduler logic, including the gvt scheduler structure(gvt->scheduler
      and per vgpu schedule data(vgpu->sched_data, vgpu->sched_ctl).
      
      v9:
        - Change commit author since the patches are improved a lot compared
          with original version.
          Original author: Pei Zhang <pei.zhang@intel.com>
        - Rebase to latest gvt-staging.
      v8:
        - Correct coding wqstyle.
        - Rebase to latest gvt-staging.
      v7:
        - Remove gtt_lock since already proteced by gvt_lock and vgpu_lock.
      v6:
        - Rebase to latest gvt-staging.
      v5:
        - Rebase to latest gvt-staging.
      v4:
        - Rebase to latest gvt-staging.
      v3: update to latest code base
      Signed-off-by: NPei Zhang <pei.zhang@intel.com>
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      9a512e23
    • C
      drm/i915/gvt: Use vgpu_lock to protect per vgpu access · f25a49ab
      Colin Xu 提交于
      The patch set splits out 2 small locks from the original big gvt lock:
        - vgpu_lock protects per-vGPU data and logic, especially the vGPU
          trap emulation path.
        - sched_lock protects gvt scheudler structure, context schedule logic
          and vGPU's schedule data.
      
      Use vgpu_lock to replace the gvt big lock. By doing this, the
      mmio read/write trap path, vgpu virtual event emulation and other
      vgpu related process, would be protected under per vgpu_lock.
      
      v9:
        - Change commit author since the patches are improved a lot compared
          with original version.
          Original author: Pei Zhang <pei.zhang@intel.com>
        - Rebase to latest gvt-staging.
      v8:
        - Correct coding and comment style.
        - Rebase to latest gvt-staging.
      v7:
        - Remove gtt_lock since already proteced by gvt_lock and vgpu_lock.
        - Fix a typo in intel_gvt_deactivate_vgpu, unlock the wrong lock.
      v6:
        - Rebase to latest gvt-staging.
      v5:
        - Rebase to latest gvt-staging.
        - intel_vgpu_page_track_handler should use vgpu_lock.
      v4:
        - Rebase to latest gvt-staging.
        - Protect vgpu->active access with vgpu_lock.
        - Do not wait gpu idle in vgpu_lock.
      v3: update to latest code base
      v2: add gvt->lock in function gvt_check_vblank_emulation
      
      Performance comparison on Kabylake platform.
        - Configuration:
          Host: Ubuntu 16.04.
          Guest 1 & 2: Ubuntu 16.04.
      
      glmark2 score comparison:
        - Configuration:
          Host: glxgears.
          Guests: glmark2.
      +--------------------------------+-----------------+
      | Setup                          | glmark2 score   |
      +--------------------------------+-----------------+
      | unified lock, iommu=on         | 58~62 (avg. 60) |
      +--------------------------------+-----------------+
      | unified lock, iommu=igfx_off   | 57~61 (avg. 59) |
      +--------------------------------+-----------------+
      | per-logic lock, iommu=on       | 60~68 (avg. 64) |
      +--------------------------------+-----------------+
      | per-logic lock, iommu=igfx_off | 61~67 (avg. 64) |
      +--------------------------------+-----------------+
      
      lock_stat comparison:
        - Configuration:
          Stop lock stat immediately after boot up.
          Boot 2 VM Guests.
          Run glmark2 in guests.
          Start perf lock_stat for 20 seconds and stop again.
        - Legend: c - contentions; w - waittime-avg
      +------------+-----------------+-----------+---------------+------------+
      |            | gvt_lock        |sched_lock | vgpu_lock     | gtt_lock   |
      + lock type; +-----------------+-----------+---------------+------------+
      | iommu set  | c     | w       | c  | w    | c    | w      | c   | w    |
      +------------+-------+---------+----+------+------+--------+-----+------+
      | unified;   | 20697 | 839     |N/A | N/A  | N/A  | N/A    | N/A | N/A  |
      | on         |       |         |    |      |      |        |     |      |
      +------------+-------+---------+----+------+------+--------+-----+------+
      | unified;   | 21838 | 658.15  |N/A | N/A  | N/A  | N/A    | N/A | N/A  |
      | igfx_off   |       |         |    |      |      |        |     |      |
      +------------+-------+---------+----+------+------+--------+-----+------+
      | per-logic; | 1553  | 1599.96 |9458|429.97| 5846 | 274.33 | 0   | 0.00 |
      | on         |       |         |    |      |      |        |     |      |
      +------------+-------+---------+----+------+------+--------+-----+------+
      | per-logic; | 1911  | 1678.32 |8335|445.16| 5451 | 244.80 | 0   | 0.00 |
      | igfx_off   |       |         |    |      |      |        |     |      |
      +------------+-------+---------+----+------+------+--------+-----+------+
      Signed-off-by: NPei Zhang <pei.zhang@intel.com>
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      f25a49ab
  26. 14 5月, 2018 1 次提交
  27. 30 4月, 2018 1 次提交
  28. 23 4月, 2018 2 次提交
  29. 19 4月, 2018 1 次提交
  30. 19 3月, 2018 2 次提交