1. 17 6月, 2019 1 次提交
    • W
      drm/i915/gvt: ignore unexpected pvinfo write · 971afec3
      Weinan Li 提交于
      There is pvinfo writing come from vgpu might be unexpected, like
      writing to one unknown address, GVT-g should do as reserved register
      to discard any invalid write. Now GVT-g lets it write to the vreg
      without prompt error message, should ignore the unexpected pvinfo
      write access and leave the vreg as the default value.
      
      For possible guest query GVT-g host feature, this returned proper
      value instead of wrong guest setting.
      
      v2: ignore unexpected pvinfo write instead of return predefined value
      
      Fixes: e39c5add ("drm/i915/gvt: vGPU MMIO virtualization")
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      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>
      971afec3
  2. 03 6月, 2019 1 次提交
    • W
      drm/i915/gvt: add F_CMD_ACCESS flag for wa regs · 3fcb01f8
      Weinan Li 提交于
      Instead of updating by MMIO write, all of the wa regs are initialized by
      wa_ctx. From host side, it should make this behavior as expected, add
      'F_CMD_ACCESS' flag to these regs and allow access by commands.
      
      [  123.557608] gvt: vgpu 2: srm access to non-render register (b11c)
      [  123.563728] gvt: vgpu 2: MI_STORE_REGISTER_MEM handler error
      [  123.569409] gvt: vgpu 2: cmd parser error
      [  123.573424] 0x0
      [  123.573425] 0x24
      
      [  123.578686] gvt: vgpu 2: scan workload error
      [  123.582958] GVT Internal error  for the guest
      [  123.587317] Now vgpu 2 will enter failsafe mode.
      [  123.591938] gvt: vgpu 2: failed to submit desc 0
      [  123.596557] gvt: vgpu 2: fail submit workload on ring 0
      [  123.601786] gvt: vgpu 2: fail to emulate MMIO write 00002230 len 4
      Acked-by: NYan Zhao <yan.y.zhao@intel.com>
      Signed-off-by: NWeinan Li <weinan.z.li@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      3fcb01f8
  3. 30 5月, 2019 3 次提交
  4. 21 5月, 2019 1 次提交
  5. 29 4月, 2019 1 次提交
  6. 25 4月, 2019 1 次提交
  7. 02 4月, 2019 1 次提交
  8. 29 3月, 2019 2 次提交
  9. 27 3月, 2019 1 次提交
  10. 11 3月, 2019 1 次提交
  11. 06 3月, 2019 1 次提交
  12. 20 2月, 2019 1 次提交
  13. 23 1月, 2019 1 次提交
  14. 14 1月, 2019 1 次提交
  15. 10 1月, 2019 3 次提交
  16. 07 12月, 2018 1 次提交
  17. 31 10月, 2018 1 次提交
    • L
      drm/i915/gvt: Handle values of EDP_PSR_IMR and EDP_PSR_IIR · 5e7154ff
      Longhe Zheng 提交于
      GVT-g only simulates DP port for guest and leaves EDP_PSR_IMR
      and EDP_PSR_IIR registers as default MMIO read/write.
      So guest won't get expected initial values of these registers when
      initializing the gpu driver, which results in following warning and logs.
      
      --------
      Interrupt register 0x64838 is not zero: 0xffffffff
      WARNING: CPU: 1 PID: 157 at drivers/gpu/drm/i915/i915_irq.c:177
      gen3_assert_iir_is_zero+0x38/0xa0
      
      Call Trace:
      gen8_de_irq_postinstall+0xa7/0x400
      gen8_irq_postinstall+0x27/0x80
      drm_irq_install+0xbc/0x140
      i915_driver_load+0xa9d/0xd50
      --------
      Because GVT-g does not handle EDP(embedded DP) simulation for guests,
      always set EDP_PSR_IMR and EDP_PSR_IIR to value 0.
      Signed-off-by: NLonghe Zheng <longhe.zheng@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      5e7154ff
  18. 18 9月, 2018 1 次提交
  19. 30 8月, 2018 3 次提交
    • C
      drm/i915/gvt: Handle GEN9_WM_CHICKEN3 with F_CMD_ACCESS. · b9b824a5
      Colin Xu 提交于
      Recent patch introduce strict check on scanning cmd:
      Commit 8d458ea0 ("drm/i915/gvt: return error on cmd access")
      
      Before 8d458ea0, if cmd_reg_handler() checks that a cmd access a mmio
      that not marked as F_CMD_ACCESS, it simply returns 0 and log an error.
      Now it will return -EBADRQC which will cause the workload fail to submit.
      
      On BXT, i915 applies WaClearHIZ_WM_CHICKEN3 which will program
      GEN9_WM_CHICKEN3 by LRI when init wa ctx. If it has no F_CMD_ACCESS flag,
      vgpu will fail to start. Also add F_MODE_MASK since it's mode mask reg.
      
      v2: Refresh commit message to elaborate issue symptom in detail.
      v3: Make SKL_PLUS share same handling since GEN9_WM_CHICKEN3 should be
          F_CMD_ACCESS from HW aspect. (yan, zhenyu)
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Acked-by: NZhao Yan <yan.y.zhao@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      b9b824a5
    • C
      drm/i915/gvt: Make correct handling to vreg BXT_PHY_CTL_FAMILY · c8ab5ac3
      Colin Xu 提交于
      Guest kernel will write to BXT_PHY_CTL_FAMILY to reset DDI PHY
      and pull BXT_PHY_CTL to check PHY status. Previous handling will
      set/reset BXT_PHY_CTL of all PHYs at same time on receiving vreg
      write to some BXT_PHY_CTL_FAMILY. If some BXT_PHY_CTL is already
      enabled, following reset to another BXT_PHY_CTL_FAMILY will clear
      the enabled BXT_PHY_CTL, which result in guest kernel print:
      
      -----------------------------------
      [drm:intel_ddi_get_hw_state [i915]]
      *ERROR* Port B enabled but PHY powered down? (PHY_CTL 00000000)
      -----------------------------------
      
      The correct handling should operate BXT_PHY_CTL_FAMILY and
      BXT_PHY_CTL on the same DDI.
      
      v2: Use correct reg define. The naming looks confusing, however
          current i915_reg.h bind DPIO_PHY0 to _PHY_CTL_FAMILY_DDI and
          bind DPIO_PHY1 to _PHY_CTL_FAMILY_EDP, pairing to
          _BXT_PHY_CTL_DDI_A and _BXT_PHY_CTL_DDI_B respectively.
      v3: v2 incorrectly map _PHY_CTL_FAMILY_EDP to _BXT_PHY_CTL_DDI_A.
          BXT_PHY_CTL() looks up DDI using PORTx but not PHYx. Based on
          DPIO_PHY to DDI mapping, make correct vreg handle to BXT_PHY_CTL
          on receiving vreg write to BXT_PHY_CTL_FAMILY. (He, Min)
      
      Current mapping according to bxt_power_wells:
      dpio-common-a:
          >>> DPIO_PHY1
          >>> BXT_DPIO_CMN_A_POWER_DOMAINS
          >>> POWER_DOMAIN_PORT_DDI_A_LANES
          >>> PORT_A
      
      dpio-common-bc:
          >>> DPIO_PHY0
          >>> BXT_DPIO_CMN_BC_POWER_DOMAINS
          >>> POWER_DOMAIN_PORT_DDI_B_LANES | POWER_DOMAIN_PORT_DDI_C_LANES
          >>> PORT_B or PORT_C
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Reviewed-by: NHe, Min <min.he@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      c8ab5ac3
    • X
      drm/i915/gvt: emulate gen9 dbuf ctl register access · 9174c1d6
      Xiaolin Zhang 提交于
      there is below call track at boot time when booting guest
      with kabylake vgpu with specifal configuration and this try to fix it.
      
      [drm:gen9_dbuf_enable [i915]] *ERROR* DBuf power enable timeout
      ------------[ cut here ]------------
      WARNING: gen9_dc_off_power_well_enable+0x224/0x230 [i915]
      Unexpected DBuf power power state (0x8000000a)
      Hardware name: Red Hat KVM, BIOS 1.11.0-2.el7 04/01/2014
      Call Trace:
       [<ffffffff99d24408>] dump_stack+0x19/0x1b
       [<ffffffff996926d8>] __warn+0xd8/0x100
       [<ffffffff9969275f>] warn_slowpath_fmt+0x5f/0x80
       [<ffffffffc07bbae4>] gen9_dc_off_power_well_enable+0x224/0x230 [i915]
       [<ffffffffc07ba9d2>] intel_power_well_enable+0x42/0x50 [i915]
       [<ffffffffc07baa6a>] __intel_display_power_get_domain+0x8a/0xb0 [i915]
       [<ffffffffc07bdb93>] intel_display_power_get+0x33/0x50 [i915]
       [<ffffffffc07bdf95>] intel_display_set_init_power+0x45/0x50 [i915]
       [<ffffffffc07be003>] intel_power_domains_init_hw+0x63/0x8a0 [i915]
       [<ffffffffc07995c3>] i915_driver_load+0xae3/0x1760 [i915]
       [<ffffffff99bd6580>] ? nvmem_register+0x500/0x500
       [<ffffffffc07a476c>] i915_pci_probe+0x2c/0x50 [i915]
       [<ffffffff9999cfea>] local_pci_probe+0x4a/0xb0
       [<ffffffff9999e729>] pci_device_probe+0x109/0x160
       [<ffffffff99a79aa5>] driver_probe_device+0xc5/0x3e0
       [<ffffffff99a79ea3>] __driver_attach+0x93/0xa0
       [<ffffffff99a79e10>] ? __device_attach+0x50/0x50
       [<ffffffff99a77645>] bus_for_each_dev+0x75/0xc0
       [<ffffffff99a7941e>] driver_attach+0x1e/0x20
       [<ffffffff99a78ec0>] bus_add_driver+0x200/0x2d0
       [<ffffffff99a7a534>] driver_register+0x64/0xf0
       [<ffffffff9999df65>] __pci_register_driver+0xa5/0xc0
       [<ffffffffc0929000>] ? 0xffffffffc0928fff
       [<ffffffffc0929059>] i915_init+0x59/0x5c [i915]
       [<ffffffff9960210a>] do_one_initcall+0xba/0x240
       [<ffffffff9971108c>] load_module+0x272c/0x2bc0
       [<ffffffff9997b990>] ? ddebug_proc_write+0xf0/0xf0
       [<ffffffff997115e5>] SyS_init_module+0xc5/0x110
       [<ffffffff99d36795>] system_call_fastpath+0x1c/0x21
      Signed-off-by: NXiaolin Zhang <xiaolin.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      9174c1d6
  20. 17 8月, 2018 1 次提交
  21. 08 8月, 2018 1 次提交
    • I
      drm/i915/ddi: Use power well CTL IDX instead of ID · 75e39688
      Imre Deak 提交于
      Similarly to the previous patch use a separate request/status HW flag
      index defined right after the corresponding control registers instead of
      depending for this on the power well IDs. Since the set of
      control/status registers varies among the different power wells (on a
      single platform), also add a new i915_power_well_registers struct that
      we populate and assign to each DDI power well as needed.
      
      Also clarify a bit the code comment describing the function and layout
      of the control registers.
      
      This also fixes a problem on ICL, where we incorrectly read the KVMR
      control register in hsw_power_well_requesters() even for DDI and AUX
      power wells.
      
      v2:
      - Clarify platform range tags in code comments. (Paulo)
      - Fix line over 80 chars checkpatch warning.
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180806095843.13294-7-imre.deak@intel.com
      75e39688
  22. 07 8月, 2018 1 次提交
  23. 09 7月, 2018 2 次提交
  24. 05 7月, 2018 1 次提交
  25. 13 6月, 2018 2 次提交
  26. 18 5月, 2018 1 次提交
    • 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
  27. 16 5月, 2018 1 次提交
    • T
      drm/i915/gvt: Deliver guest cursor hotspot info · 1c6ccad8
      Tina Zhang 提交于
      Guest OS driver uses PV info registers to deliver cursor hotspot info
      to host. This patch is used to get cursor hotspot info from virtual
      registers and deliver it to host userspace.
      
      v4->v5:
      - remove CI warning.
      
      v3->v4:
      - return UINT_MAX when x_hot/y_hot is invalid. (Zhenyu)
      - correct version.
      
      v2->v3:
      - add validate_hotspot(). (Zhenyu)
      
      v1->v2:
      - name as cursor_x_hot/cursor_y_hot. (Zhenyu)
      - use i915_reg_t definition instead of magic numbers. (Zhenyu)
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      1c6ccad8
  28. 14 5月, 2018 3 次提交
  29. 23 4月, 2018 1 次提交