1. 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
  2. 18 9月, 2018 1 次提交
  3. 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
  4. 17 8月, 2018 1 次提交
  5. 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
  6. 07 8月, 2018 1 次提交
  7. 09 7月, 2018 2 次提交
  8. 05 7月, 2018 1 次提交
  9. 13 6月, 2018 2 次提交
  10. 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
  11. 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
  12. 14 5月, 2018 3 次提交
  13. 23 4月, 2018 1 次提交
  14. 12 4月, 2018 1 次提交
    • C
      drm/i915/gvt: Fix the validation on size field of dp aux header · 2f24636b
      Changbin Du 提交于
      The assertion for len is wrong, so fix it. And for where to validate
      user input, we should not warn by call trace.
      
      [ 290.584739] WARNING: CPU: 0 PID: 1471 at drivers/gpu/drm/i915/gvt/handlers.c:969 dp_aux_ch_ctl_mmio_write+0x394/0x430 [i915]
      [ 290.586113] task: ffff880111fe8000 task.stack: ffffc90044a9c000
      [ 290.586192] RIP: e030:dp_aux_ch_ctl_mmio_write+0x394/0x430 [i915]
      [ 290.586258] RSP: e02b:ffffc90044a9fd88 EFLAGS: 00010282
      [ 290.586315] RAX: 0000000000000017 RBX: 0000000000000003 RCX: ffffffff82461148
      [ 290.586391] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000201
      [ 290.586468] RBP: ffffc90043ed1000 R08: 0000000000000248 R09: 00000000000003d8
      [ 290.586544] R10: ffffc90044bdd314 R11: 0000000000000011 R12: 0000000000064310
      [ 290.586621] R13: 00000000fe4003ff R14: ffffc900432d1008 R15: ffff88010fa7cb40
      [ 290.586701] FS: 0000000000000000(0000) GS:ffff880123200000(0000) knlGS:0000000000000000
      [ 290.586787] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 290.586849] CR2: 00007f67ea44e000 CR3: 0000000116078000 CR4: 0000000000042660
      [ 290.586926] Call Trace:
      [ 290.586958] ? __switch_to_asm+0x40/0x70
      [ 290.587017] intel_vgpu_mmio_reg_rw+0x1ec/0x3c0 [i915]
      [ 290.587087] intel_vgpu_emulate_mmio_write+0xa8/0x2c0 [i915]
      [ 290.587151] xengt_emulation_thread+0x501/0x7a0 [xengt]
      [ 290.587208] ? __schedule+0x3c6/0x890
      [ 290.587250] ? wait_woken+0x80/0x80
      [ 290.587290] kthread+0xfc/0x130
      [ 290.587326] ? xengt_gpa_to_va+0x1f0/0x1f0 [xengt]
      [ 290.587378] ? kthread_create_on_node+0x70/0x70
      [ 290.587429] ? do_group_exit+0x3a/0xa0
      [ 290.587471] ret_from_fork+0x35/0x40
      
      Fixes: 04d348ae ("drm/i915/gvt: vGPU display virtualization")
      Signed-off-by: NChangbin Du <changbin.du@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      2f24636b
  15. 28 3月, 2018 1 次提交
  16. 19 3月, 2018 1 次提交
  17. 06 3月, 2018 5 次提交
  18. 07 2月, 2018 2 次提交
  19. 01 2月, 2018 1 次提交
  20. 22 12月, 2017 2 次提交
  21. 06 12月, 2017 2 次提交
  22. 05 12月, 2017 2 次提交
  23. 28 11月, 2017 1 次提交
    • W
      drm/i915/gvt: remove skl_misc_ctl_write handler · bf3a26b3
      Weinan Li 提交于
      With different settings of compressed data hash mode between VMs and host
      may cause gpu issues.
      
      Commit: 1999f108 ("drm/i915/gvt: Disable compression workaround for Gen9")
      disable compression workaround of guest in gvt host to align with host.
      
      Commit: 93564044 ("drm/i915: Switch over to the LLC/eLLC hotspot avoidance
      hash mode for CCS") add compression workaround, then we can remove the
      skl_misc_ctl_write hanlder.
      
      Better solution should be always keeping same settings as host, and bypass
      the write request from VMs, but it need to fetch data from host's
      "Context".
      
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Signed-off-by: NWeinan Li <weinan.z.li@intel.com>
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      bf3a26b3
  24. 16 11月, 2017 3 次提交
    • X
      drm/i915/gvt: Limit read hw reg to active vgpu · 295764cd
      Xiong Zhang 提交于
      mmio_read_from_hw() let vgpu could read hw reg, if vgpu's workload
      is running on hw, things is good. Otherwise vgpu will get other
      vgpu's reg val, it is unsafe.
      
      This patch limit such hw access to active vgpu. If vgpu isn't
      running on hw, the reg read of this vgpu will get the last active
      val which saved at schedule_out.
      
      v2: ring timestamp is walking continuously even if the ring is idle.
          so read hw directly. (Zhenyu)
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      295764cd
    • C
      drm/i915/gvt: Add mmio iterator intel_gvt_for_each_tracked_mmio() · 7cb16018
      Changbin Du 提交于
      This patch add a function intel_gvt_for_each_tracked_mmio() to
      iterate each tracked mmio. The caller don't be aware of how the
      tracked mmios are presented internally.
      
      v2: remove snapshot_hw_mmio_registers().
      Signed-off-by: NChangbin Du <changbin.du@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      7cb16018
    • W
      drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP · a2ae95af
      Weinan Li 提交于
      The engine provides a mirror of the CSB and CSB write pointer in the HWSP.
      Read these status from virtual HWSP in VM can reduce CPU utilization while
      applications have much more short GPU workloads. Here we update the
      corresponding data in virtual HWSP as it in virtual MMIO.
      
      Before read these status from HWSP in GVT-g VM, please ensure the host
      support it by checking the BIT(3) of caps in PVINFO.
      
      Virtual HWSP only support GEN8+ platform, since the HWSP MMIO may change
      follow the platform update, please add the corresponding MMIO emulation
      when enable new platforms in GVT-g.
      
      v3 : Add address audit in HWSP address update.
      
      v4 :
           Separate this patch with enalbe virtual HWSP in VM.
           Use intel_gvt_render_mmio_to_ring_id() to determine ring_id by offset.
      
      v5 : Remove unnessary check about Gen8, GVT-g only support Gen8+.
      Signed-off-by: NWeinan Li <weinan.z.li@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      a2ae95af