1. 31 10月, 2018 3 次提交
  2. 08 10月, 2018 1 次提交
  3. 18 9月, 2018 4 次提交
    • Z
      drm/i915/gvt: clear ggtt entries when destroy vgpu · 7759ca3a
      Zhipeng Gong 提交于
      When one vgpu is destroyed, its ggtt entries are not cleared.
      This patch clears ggtt entries to avoid information leak.
      
      v2: add 'Fixes' tag (Zhenyu)
      
      Fixes: 2707e444 ("drm/i915/gvt: vGPU graphics memory virtualization")
      Signed-off-by: NZhipeng Gong <zhipeng.gong@intel.com>
      Reviewed-by: NHang Yuan <hang.yuan@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      7759ca3a
    • W
      drm/i915/gvt: request srcu_read_lock before checking if one gfn is valid · a1ac5f09
      Weinan Li 提交于
      Fix the suspicious RCU usage issue in intel_vgpu_emulate_mmio_write.
      Here need to request the srcu read lock of kvm->srcu before doing
      gfn_to_memslot(). The detailed log is as below:
      [  218.710688] =============================
      [  218.710690] WARNING: suspicious RCU usage
      [  218.710693] 4.14.15-dd+ #314 Tainted: G     U
      [  218.710695] -----------------------------
      [  218.710697] ./include/linux/kvm_host.h:575 suspicious rcu_dereference_check() usage!
      [  218.710699]
                     other info that might help us debug this:
      
      [  218.710702]
                     rcu_scheduler_active = 2, debug_locks = 1
      [  218.710704] 1 lock held by qemu-system-x86/2144:
      [  218.710706]  #0:  (&gvt->lock){+.+.}, at: [<ffffffff816a1eea>] intel_vgpu_emulate_mmio_write+0x5a/0x2d0
      [  218.710721]
                     stack backtrace:
      [  218.710724] CPU: 0 PID: 2144 Comm: qemu-system-x86 Tainted: G     U 4.14.15-dd+ #314
      [  218.710727] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.1.1 10/07/2015
      [  218.710729] Call Trace:
      [  218.710734]  dump_stack+0x7c/0xb3
      [  218.710739]  gfn_to_memslot+0x15f/0x170
      [  218.710743]  kvm_is_visible_gfn+0xa/0x30
      [  218.710746]  intel_vgpu_emulate_gtt_mmio_write+0x267/0x3c0
      [  218.710751]  ? __mutex_unlock_slowpath+0x3b/0x260
      [  218.710754]  intel_vgpu_emulate_mmio_write+0x182/0x2d0
      [  218.710759]  intel_vgpu_rw+0xba/0x170 [kvmgt]
      [  218.710763]  intel_vgpu_write+0x14d/0x1a0 [kvmgt]
      [  218.710767]  __vfs_write+0x23/0x130
      [  218.710770]  vfs_write+0xb0/0x1b0
      [  218.710774]  SyS_pwrite64+0x73/0x90
      [  218.710777]  entry_SYSCALL_64_fastpath+0x25/0x9c
      [  218.710780] RIP: 0033:0x7f33e8a91da3
      [  218.710783] RSP: 002b:00007f33dddc8700 EFLAGS: 00000293
      
      v2: add 'Fixes' tag, refine log format.(Zhenyu)
      Fixes: cc753fbe ("drm/i915/gvt: validate gfn before set shadow page")
      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>
      a1ac5f09
    • C
      drm/i915/gvt: Add GEN9_CLKGATE_DIS_4 to default BXT mmio handler · d817de3b
      Colin Xu 提交于
      Host prints lots of untracked MMIO at 0x4653c when creating linux guest.
      "gvt: vgpu 2: untracked MMIO 0004653c len 4"
      
      GEN9_CLKGATE_DIS_4 (0x4653c) is accessed by i915 for gmbus clockgating.
      However vgpu doesn't support any clockgating powergating operations
      on related mmio access trap so need add it to default handler.
      GEN9_CLKGATE_DIS_4 is accessed in bxt_gmbus_clock_gating() which only
      applies to GEN9_LP so doens't show the warning on other platforms.
      
      The solution is to add it to default handler init_bxt_mmio_info().
      Reviewed-by: NHe, Min <min.he@intel.com>
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      d817de3b
    • C
      drm/i915/gvt: Init PHY related registers for BXT · db7c8f1e
      Colin Xu 提交于
      Recent patch fixed the call trace
      "ERROR Port B enabled but PHY powered down? (PHY_CTL 00000000)".
      but introduced another similar call trace shown as:
      "ERROR Port C enabled but PHY powered down? (PHY_CTL 00000200)".
      The call trace will appear when host and guest enabled different ports,
      i.e. host using PORT C or neither PORT is enabled, while guest is always
      using PORT B as simulated by gvt. The issue is actually covered previously
      before the commit and reverals now when the commit do the right thing.
      
      On BXT, some PHY registers are initialized by vbios, before i915 loaded.
      Later i915 will re-program some, or skip some based on the implementation.
      The initialized mmio for guest i915 is done by gvt, based on the snapshot
      taken from host. If host and guest have different PORT enabled, some
      DPIO PHY mmios that gvt initialized for guest i915 will not match the
      simualted monitor for guest, which leads to guest i915 print the calltrace
      when it's trying to enable PHY and PORT.
      
      The solution is to init these DPIO PHY registers to default value, then
      guest i915 will program them to reasonable value based on the default
      powerwell table and enabled PORT. Together with the old patch, all similar
      call trace in guest kernel on BXT can be resolved.
      
      v2: Move PHY register init to intel_vgpu_reset_mmio (Min)
      v3: Do not delete empty line in issue fix patch. (zhenyu)
      
      Fixes: c8ab5ac3 ("drm/i915/gvt: Make correct handling to vreg
      BXT_PHY_CTL_FAMILY")
      Reviewed-by: NHe, Min <min.he@intel.com>
      Signed-off-by: NColin Xu <colin.xu@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      db7c8f1e
  4. 06 9月, 2018 1 次提交
  5. 04 9月, 2018 1 次提交
    • Z
      drm/i915/gvt: Fix life cycle reference on KVM mm · 0a1b60d7
      Zhenyu Wang 提交于
      Handle guest mm access life cycle properly with mmget()/mmput().
      As noted by Linus, use_mm() depends on valid live page table but
      KVM's mmgrab() doesn't guarantee that. As vGPU usage depends on
      guest VM life cycle, need to make sure to use mmget()/mmput() to
      guarantee VM address access.
      
      v3: fix build
      
      v2: v1 caused a weird dependence issue which failed for vfio
      device release, which result invalid mdev vgpu and kvm state
      without proper release taken. This trys to put right reference
      around VM address space access instead.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Reviewed-by: NZhi Wang <zhi.a.wang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      0a1b60d7
  6. 03 9月, 2018 1 次提交
    • Z
      drm/i915/gvt: Give new born vGPU higher scheduling chance · 54ff01fd
      Zhenyu Wang 提交于
      This trys to give new born vGPU with higher scheduling chance
      not only with adding to sched list head and also have higher
      priority for workload sched for 2 seconds after starting to
      schedule it. In order for fast GPU execution during VM boot,
      and ensure guest driver setup with required state given in time.
      
      This fixes recent failure seen on one VM with multiple linux VMs
      running on kernel with commit 2621cefa("drm/i915: Provide a timeout to i915_gem_wait_for_idle() on setup"),
      which had shorter setup timeout that caused context state init failed.
      
      v2: change to 2s for higher scheduling period
      
      Cc: Yuan Hang <hang.yuan@intel.com>
      Reviewed-by: NHang Yuan <hang.yuan@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      54ff01fd
  7. 30 8月, 2018 8 次提交
    • Z
      drm/i915/gvt: Fix drm_format_mod value for vGPU plane · b244ffa1
      Zhenyu Wang 提交于
      Physical plane's tiling mode value is given directly as
      drm_format_mod for plane query, which is not correct fourcc
      code. Fix it by using correct intel tiling fourcc mod definition.
      
      Current qemu seems also doesn't correctly utilize drm_format_mod
      for plane object setting. Anyway this is required to fix the usage.
      
      v3: use DRM_FORMAT_MOD_LINEAR, fix comment
      
      v2: Fix missed old 'tiled' use for stride calculation
      
      Fixes: e546e281 ("drm/i915/gvt: Dmabuf support for GVT-g")
      Cc: Tina Zhang <tina.zhang@intel.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Colin Xu <Colin.Xu@intel.com>
      Reviewed-by: NColin Xu <Colin.Xu@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      b244ffa1
    • H
      drm/i915/gvt: move intel_runtime_pm_get out of spin_lock in stop_schedule · b2b599fb
      Hang Yuan 提交于
      pm_runtime_get_sync in intel_runtime_pm_get might sleep if i915
      device is not active. When stop vgpu schedule, the device may be
      inactive. So need to move runtime_pm_get out of spin_lock/unlock.
      
      Fixes: b24881e0("drm/i915/gvt: Add runtime_pm_get/put into gvt_switch_mmio
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHang Yuan <hang.yuan@linux.intel.com>
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      b2b599fb
    • 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
    • C
      drm/i915/audio: Hook up component bindings even if displays are disabled · 80ab3169
      Chris Wilson 提交于
      If the display has been disabled by modparam, we still want to connect
      together the HW bits and bobs with the associated drivers so that we can
      continue to manage their runtime power gating.
      
      Fixes: 10810944 ("drm/i915: Check num_pipes before initializing audio component")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Elaine Wang <elaine.wang@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180817100241.4628-1-chris@chris-wilson.co.uk
      (cherry picked from commit 35a5fd9ebfa93758ca579e30f337b6c9126d995b)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      80ab3169
    • F
      drm/i915: Increase LSPCON timeout · 299c2a90
      Fredrik Schön 提交于
      100 ms is not enough time for the LSPCON adapter on Intel NUC devices to
      settle. This causes dropped display modes at boot or screen reconfiguration.
      Empirical testing can reproduce the error up to a timeout of 190 ms. Basic
      boot and stress testing at 200 ms has not (yet) failed.
      
      Increase timeout to 400 ms to get some margin of error.
      
      Changes from v1:
      The initial suggestion of 1000 ms was lowered due to concerns about delaying
      valid timeout cases.
      Update patch metadata.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107503
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1570392
      Fixes: 357c0ae9 ("drm/i915/lspcon: Wait for expected LSPCON mode to settle")
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: <stable@vger.kernel.org> # v4.11+
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NShashank Sharma <shashank.sharma@intel.com>
      Signed-off-by: NFredrik Schön <fredrik.schon@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180817200728.8154-1-fredrik.schon@gmail.com
      (cherry picked from commit 59f1c8ab30d6f9042562949f42cbd3f3cf69de94)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      299c2a90
    • C
      drm/i915: Stop holding a ref to the ppgtt from each vma · f013027e
      Chris Wilson 提交于
      The context owns both the ppgtt and the vma within it, and our activity
      tracking on the context ensures that we do not release active ppgtt. As
      the context fulfils our obligations for active memory tracking, we can
      relinquish the reference from the vma.
      
      This fixes a silly transient refleak from closed vma being kept alive
      until the entire system was idle, keeping all vm alive as well.
      Reported-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Testcase: igt/gem_ctx_create/files
      Fixes: 3365e226 ("drm/i915: Lazily unbind vma on close")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Tested-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180816073448.19396-1-chris@chris-wilson.co.uk
      (cherry picked from commit a4417b7b419a68540ad7945ac4efbb39d19afa63)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      f013027e
  8. 29 8月, 2018 2 次提交
  9. 24 8月, 2018 11 次提交
  10. 23 8月, 2018 8 次提交