1. 10 11月, 2020 1 次提交
  2. 14 9月, 2020 1 次提交
  3. 29 7月, 2020 2 次提交
  4. 19 5月, 2020 1 次提交
  5. 06 3月, 2020 1 次提交
  6. 03 3月, 2020 1 次提交
  7. 24 2月, 2020 2 次提交
    • P
      drm/i915/gvt: Make WARN* drm specific where vgpu ptr is available · 12d58619
      Pankaj Bharadiya 提交于
      Drm specific drm_WARN* calls include device information in the
      backtrace, so we know what device the warnings originate from.
      
      Covert all the calls of WARN* with device specific drm_WARN*
      variants in functions where drm_device struct pointer is readily
      available.
      
      The conversion was done automatically with below coccinelle semantic
      patch. checkpatch errors/warnings are fixed manually.
      
      @@
      identifier func, T;
      @@
      func(struct intel_vgpu *T,...) {
      +struct drm_i915_private *i915 = T->gvt->dev_priv;
      <+...
      (
      -WARN(
      +drm_WARN(&i915->drm,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(&i915->drm,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(&i915->drm,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(&i915->drm,
      ...)
      )
      ...+>
      
      }
      Signed-off-by: NPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Acked-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-9-pankaj.laxminarayan.bharadiya@intel.com
      12d58619
    • T
      drm/i915/gvt: Separate display reset from ALL_ENGINES reset · 3eb55e6f
      Tina Zhang 提交于
      ALL_ENGINES reset doesn't clobber display with the current gvt-g
      supported platforms. Thus ALL_ENGINES reset shouldn't reset the
      display engine registers emulated by gvt-g.
      
      This fixes guest warning like
      
      [ 14.622026] [drm] Initialized i915 1.6.0 20200114 for 0000:00:03.0 on minor 0
      [ 14.967917] fbcon: i915drmfb (fb0) is primary device
      [ 25.100188] [drm:drm_atomic_helper_wait_for_dependencies [drm_kms_helper]] E RROR [CRTC:51:pipe A] flip_done timed out
      [ 25.100860] -----------[ cut here ]-----------
      [ 25.100861] pll on state mismatch (expected 0, found 1)
      [ 25.101024] WARNING: CPU: 1 PID: 30 at drivers/gpu/drm/i915/display/intel_dis play.c:14382 verify_single_dpll_state.isra.115+0x28f/0x320 [i915]
      [ 25.101025] Modules linked in: intel_rapl_msr intel_rapl_common kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 aesni_intel cr ypto_simd cryptd glue_helper cec rc_core video drm_kms_helper joydev drm input_l eds i2c_algo_bit serio_raw fb_sys_fops syscopyarea sysfillrect sysimgblt mac_hid qemu_fw_cfg sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 e1000 psmouse i2c_piix4 pata_acpi floppy
      [ 25.101052] CPU: 1 PID: 30 Comm: kworker/u4:1 Not tainted 5.5.0+ #1
      [ 25.101053] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1 .12.1-0-ga5cab58 04/01/2014
      [ 25.101055] Workqueue: events_unbound async_run_entry_fn
      [ 25.101092] RIP: 0010:verify_single_dpll_state.isra.115+0x28f/0x320 [i915]
      [ 25.101093] Code: e0 d9 ff e9 a3 fe ff ff 80 3d e9 c2 11 00 00 44 89 f6 48 c7 c7 c0 9d 88 c0 75 3b e8 eb df d9 ff e9 c7 fe ff ff e8 d1 e0 ae c4 <0f> 0b e9 7a fe ff ff 80 3d c0 c2 11 00 00 8d 71 41 89 c2 48 c7 c7
      [ 25.101093] RSP: 0018:ffffb1de80107878 EFLAGS: 00010286
      [ 25.101094] RAX: 0000000000000000 RBX: ffffb1de80107884 RCX: 0000000000000007
      [ 25.101095] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff94fdfdd19740
      [ 25.101095] RBP: ffffb1de80107938 R08: 0000000d6bfdc7b4 R09: 000000000000002b
      [ 25.101096] R10: ffff94fdf82dc000 R11: 0000000000000225 R12: 00000000000001f8
      [ 25.101096] R13: ffff94fdb3ca6a90 R14: ffff94fdb3ca0000 R15: 0000000000000000
      [ 25.101097] FS: 0000000000000000(0000) GS:ffff94fdfdd00000(0000) knlGS:00000 00000000000
      [ 25.101098] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 25.101098] CR2: 00007fbc3e2be9c8 CR3: 000000003339a003 CR4: 0000000000360ee0
      [ 25.101101] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 25.101101] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 25.101102] Call Trace:
      [ 25.101139] intel_atomic_commit_tail+0xde4/0x1520 [i915]
      [ 25.101141] ? flush_workqueue_prep_pwqs+0xfa/0x130
      [ 25.101142] ? flush_workqueue+0x198/0x3c0
      [ 25.101174] intel_atomic_commit+0x2ad/0x320 [i915]
      [ 25.101209] drm_atomic_commit+0x4a/0x50 [drm]
      [ 25.101220] drm_client_modeset_commit_atomic+0x1c4/0x200 [drm]
      [ 25.101231] drm_client_modeset_commit_force+0x47/0x170 [drm]
      [ 25.101250] drm_fb_helper_restore_fbdev_mode_unlocked+0x4e/0xa0 [drm_kms_hel per]
      [ 25.101255] drm_fb_helper_set_par+0x2d/0x60 [drm_kms_helper]
      [ 25.101287] intel_fbdev_set_par+0x1a/0x40 [i915]
      [ 25.101289] ? con_is_visible+0x2e/0x60
      [ 25.101290] fbcon_init+0x378/0x600
      [ 25.101292] visual_init+0xd5/0x130
      [ 25.101296] do_bind_con_driver+0x217/0x430
      [ 25.101297] do_take_over_console+0x7d/0x1b0
      [ 25.101298] do_fbcon_takeover+0x5c/0xb0
      [ 25.101299] fbcon_fb_registered+0x199/0x1a0
      [ 25.101301] register_framebuffer+0x22c/0x330
      [ 25.101306] __drm_fb_helper_initial_config_and_unlock+0x31a/0x520 [drm_kms_h elper]
      [ 25.101311] drm_fb_helper_initial_config+0x35/0x40 [drm_kms_helper]
      [ 25.101341] intel_fbdev_initial_config+0x18/0x30 [i915]
      [ 25.101342] async_run_entry_fn+0x3c/0x150
      [ 25.101343] process_one_work+0x1fd/0x3f0
      [ 25.101344] worker_thread+0x34/0x410
      [ 25.101346] kthread+0x121/0x140
      [ 25.101346] ? process_one_work+0x3f0/0x3f0
      [ 25.101347] ? kthread_park+0x90/0x90
      [ 25.101350] ret_from_fork+0x35/0x40
      [ 25.101351] --[ end trace b5b47d44cd998ba1 ]--
      
      Fixes: 6294b61b ("drm/i915/gvt: add missing display part reset for vGPU reset")
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Reviewed-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20200221023234.28635-1-tina.zhang@intel.com
      3eb55e6f
  8. 20 1月, 2020 1 次提交
  9. 11 12月, 2019 1 次提交
  10. 13 8月, 2019 1 次提交
    • G
      drm/i915/gvt: no need to check return value of debugfs_create functions · f8871ec8
      Greg Kroah-Hartman 提交于
      When calling debugfs functions, there is no need to ever check the
      return value.  The function can work or not, but the code logic should
      never do something different based on this.
      
      Because there is no need to check these functions, a number of local
      functions can be made to return void to simplify things as nothing can
      fail.
      
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Cc: intel-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      f8871ec8
  11. 02 4月, 2019 1 次提交
  12. 15 3月, 2019 1 次提交
  13. 31 1月, 2019 1 次提交
  14. 13 12月, 2018 1 次提交
  15. 18 9月, 2018 1 次提交
  16. 14 8月, 2018 1 次提交
  17. 13 8月, 2018 1 次提交
  18. 09 7月, 2018 1 次提交
  19. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  20. 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
  21. 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
  22. 19 3月, 2018 1 次提交
  23. 06 3月, 2018 1 次提交
    • C
      drm/i915/gvt: Provide generic page_track infrastructure for write-protected page · e502a2af
      Changbin Du 提交于
      This patch provide generic page_track infrastructure for write-protected
      guest page. The old page_track logic gets rewrote and now stays in a new
      standalone page_track.c. This page track infrastructure can be both used
      by vGUC and GTT shadowing.
      
      The important change is that it uses radix tree instead of hash table.
      We don't have a predictable number of pages that will be tracked.
      
      Here is some performance data (duration in us) of looking up a element:
      Before: (aka. intel_vgpu_find_tracked_page)
       0.091 0.089 0.090 ... 0.093 0.091 0.087 ... 0.292 0.285 0.292 0.291
      After: (aka. intel_vgpu_find_page_track)
       0.104 0.105 0.100 0.102 0.102 0.100 ... 0.101 0.101 0.105 0.105
      
      The hash table has good performance at beginning, but turns bad with
      more pages being tracked even no 3D applications are running. As
      expected, radix tree has stable duration and very quick.
      
      The overall benchmark (tested with Heaven Benchmark) marginally improved
      since this is not the bottleneck. What we benefit more from this change
      is scalability.
      Signed-off-by: NChangbin Du <changbin.du@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      e502a2af
  24. 07 2月, 2018 1 次提交
  25. 01 2月, 2018 1 次提交
  26. 22 12月, 2017 1 次提交
    • Z
      drm/i915/gvt: cleanup usage for typed mmio reg vs. offset · 90551a12
      Zhenyu Wang 提交于
      We had previous hack that tried to accept either i915_reg_t or offset
      value to access vGPU virtual/shadow regs which broke that purpose to
      be type safe in context. This one trys to explicitly separate the usage
      of typed mmio reg with real offset.
      
      Old vgpu_vreg(offset) helper is used only for offset now with new
      vgpu_vreg_t(reg) is used for i915_reg_t only. Convert left usage
      of that to new helper.
      
      Also fixed left KASAN warning issues caused by previous hack.
      
      v2: rebase, fixup against recent mmio switch change
      Reviewed-by: NZhi Wang <zhi.a.wang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      90551a12
  27. 04 12月, 2017 3 次提交
    • T
      drm/i915/gvt: Dmabuf support for GVT-g · e546e281
      Tina Zhang 提交于
      This patch introduces a guest's framebuffer sharing mechanism based on
      dma-buf subsystem. With this sharing mechanism, guest's framebuffer can
      be shared between guest VM and host.
      
      v17:
      - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex)
      
      v16:
      - add x_hot and y_hot. (Gerd)
      - add flag validation for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
      - rebase 4.14.0-rc6.
      
      v15:
      - add VFIO_DEVICE_GET_GFX_DMABUF ABI. (Gerd)
      - add intel_vgpu_dmabuf_cleanup() to clean up the vGPU's dmabuf. (Gerd)
      
      v14:
      - add PROBE, DMABUF and REGION flags. (Alex)
      
      v12:
      - refine the lifecycle of dmabuf.
      
      v9:
      - remove dma-buf management. (Alex)
      - track the dma-buf create and release in kernel mode. (Gerd) (Daniel)
      
      v8:
      - refine the dma-buf ioctl definition.(Alex)
      - add a lock to protect the dmabuf list. (Alex)
      
      v7:
      - release dma-buf related allocations in dma-buf's associated release
        function. (Alex)
      - refine ioctl interface for querying plane info or create dma-buf.
        (Alex)
      
      v6:
      - align the dma-buf life cycle with the vfio device. (Alex)
      - add the dma-buf related operations in a separate patch. (Gerd)
      - i915 related changes. (Chris)
      
      v5:
      - fix bug while checking whether the gem obj is gvt's dma-buf when user
        change caching mode or domains. Add a helper function to do it.
        (Xiaoguang)
      - add definition for the query plane and create dma-buf. (Xiaoguang)
      
      v4:
      - fix bug while checking whether the gem obj is gvt's dma-buf when set
        caching mode or doamins. (Xiaoguang)
      
      v3:
      - declare a new flag I915_GEM_OBJECT_IS_GVT_DMABUF in drm_i915_gem_object
        to represent the gem obj for gvt's dma-buf. The tiling mode, caching
        mode and domains can not be changed for this kind of gem object. (Alex)
      - change dma-buf related information to be more generic. So other vendor
        can use the same interface. (Alex)
      
      v2:
      - create a management fd for dma-buf operations. (Alex)
      - alloc gem object's backing storage in gem obj's get_pages() callback.
        (Chris)
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      e546e281
    • T
      drm/i915/gvt: Add opregion support · b851adea
      Tina Zhang 提交于
      Windows guest driver needs vbt in opregion, to configure the setting
      for display. Without opregion support, the display registers won't
      be set and this blocks display model to get the correct information
      of the guest display plane.
      
      This patch is to provide a virtual opregion for guest. The original
      author of this patch is Xiaoguang Chen.
      
      This patch is split from the "Dma-buf support for GVT-g" patch set,
      with being rebased to the latest gvt-staging branch.
      
      v3:
      - add checking region index during intel_vgpu_rw. (Xiong)
      
      v2:
      - refine intel_vgpu_reg_release_opregion. (Xiong)
      
      Here are the previous version comments:
      
      v18:
      - unmap vgpu's opregion when destroying vgpu.
      
      v16:
      - rebase to 4.14.0-rc6.
      Signed-off-by: NBing Niu <bing.niu@intel.com>
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Tested-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      b851adea
    • X
      drm/i915/gvt: Alloc and Init guest opregion at vgpu creation · 4dff110b
      Xiong Zhang 提交于
      Currently guest opregion is allocated and initialised when guest
      write opregion base register. This is too late for kvmgt, so
      move it to vgpu_create time.
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Tested-by: NTina Zhang <tina.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      4dff110b
  28. 16 11月, 2017 7 次提交
  29. 15 8月, 2017 1 次提交
    • T
      drm/i915/gvt: Fix guest i915 full ppgtt blocking issue · 6b3816d6
      Tina Zhang 提交于
      Guest i915 full ppgtt functionality was blocking by an issue, which would
      lead to gpu hardware hang. Guest i915 driver may update the ppgtt table
      just before this workload is going to be submitted to the hardware by
      device model. This case wasn't handled well by device model before, due
      to the small time window between removing old ppgtt entry and adding the
      new one. Errors occur when the workload is executed by hardware during
      that small time window. This patch is to remove this time window by adding
      the new ppgtt entry first and then remove the old one.
      
      Changes in v2:
      - Move VGT_CAPS_FULL_PPGTT introduction to patch 2/4. (Joonas)
      
      Changes since v2:
      - Divide the whole patch set into two separate patch series, with one
        patch in i915 side to check guest i915 full ppgtt capability and enable
        it when this capability is supported by the device model, and the other
        one in gvt side which fixs the blocking issue and enables the device
        model to provide the capability to guest. And this patch focuses on gvt
        side. (Joonas)
      - Change the title from "reorder the shadow ppgtt update process by adding
        entry first" to "Fix guest i915 full ppgtt blocking issue". (Tina)
      
      Changes since v3:
      - Rebase to the latest branch.
      
      Changes since v4:
      - Tested by Tina Zhang.
      
      Changes since v5:
      - Rebase to the latest branch.
      
      v6:
      - Update full 48bit ppgtt definition
      
      Cc: Tina Zhang <tina.zhang@intel.com>
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      6b3816d6
  30. 10 8月, 2017 1 次提交