Skip to contentSkip to conversation

i915 pvmmio to improve GVTg performance

PATCH Superseded Xiaolin Zhang 5 participants 15 messages Nov 13, 2018 – Nov 19, 2018

Subsystems (3)

v3 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v3 cover i915 pvmmio to improve GVTg performance

To improve GVTg performance, it could reduce the mmio access trap numbers within guest driver in some certain scenarios since mmio access trap will introuduce vm exit/vm enter cost.

the solution in this patch set is to setup a shared memory region which accessed both by guest and GVTg without trap cost. the shared memory region is allocated by guest driver and guest driver will pass the region's memory guest physical address to GVTg through PVINFO register and later GVTg can access this region directly without trap cost to achieve data exchange purpose between guest and GVTg.

in this patch set, 2 kind of pvmmio optimization implemented which is controlled by pvmmio_caps PVINO register with different level flag.
1. workload submission (context submission): reduce 4 traps to 1 trap.
2. ppgtt update: eliminate the cost of ppgtt write protection.

based on the experiment, the performance was gained 4 percent (average) improvment with regard to both media and 3D workload benchmarks.

based on the pvmmio framework, it could achive more sceneario optimization such as globle GTT update, display plane and water mark update with guest.

v0: RFC patch set
v1: addressed RFC review comments
v2: addressed v1 review comments, added pv callbacks for pv operations v3:
1. addressed v2 review comments, removed pv callbacks code duplication in v2 and unified pv calls under g2v notification register. different g2v pv notifications defined.
2. dropped pv master irq feature due to hard conflict with recnet i915 change and take time to rework.

Xiaolin Zhang (8):
drm/i915: introduced pv capability for vgpu
drm/i915: get ready of memory for pvmmio
drm/i915: context submission pvmmio optimization drm/i915: ppgtt update pvmmio optimization drm/i915/gvt: GVTg handle pvmmio_caps PVINFO register drm/i915/gvt: GVTg handle shared_page setup drm/i915/gvt: GVTg support context submission pvmmio optimization drm/i915/gvt: GVTg support ppgtt pvmmio optimization

 drivers/gpu/drm/i915/gvt/gtt.c          | 318 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/gvt/gtt.h          |   9 +
 drivers/gpu/drm/i915/gvt/gvt.h          |  12 +-
 drivers/gpu/drm/i915/gvt/handlers.c     |  94 +++++++++-
 drivers/gpu/drm/i915/gvt/vgpu.c         |  31 ++++
 drivers/gpu/drm/i915/i915_drv.c         |   2 +
 drivers/gpu/drm/i915/i915_drv.h         |  15 +-
 drivers/gpu/drm/i915/i915_gem.c         |   3 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c     |  67 +++++++
 drivers/gpu/drm/i915/i915_pvinfo.h      |  47 ++++-
 drivers/gpu/drm/i915/i915_vgpu.c        |  48 ++++-
 drivers/gpu/drm/i915/intel_lrc.c        |  33 +++-
 drivers/gpu/drm/i915/intel_ringbuffer.h |   3 +
 13 files changed, 668 insertions(+), 14 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v3 1/8 drm/i915: introduced pv capability for vgpu

both u32 pv_caps field and pvmmio_caps are used to control the different level pvmmio feature for MMIO emulation in both guest and GVT.

These fields are default zero, no pvmmio feature enabled.

it also adds VGT_CAPS_PVMMIO capability BIT for guest to check GVTg can support PV feature or not.

v0: RFC, introudced enable_pvmmio module parameter.
v1: addressed RFC comment to remove enable_pvmmio module parameter by pv capability check.
v2: rebase
v3: distinct pv caps from guest and host. renamed enable_pvmmio to pvmmio_caps which is used for host pv caps.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc He Min <[email protected]>
Cc Jiang Fei <[email protected]>
Cc Gong Zhipeng <[email protected]>
Cc Yuan Hang <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.h    | 11 +++++++++++
 drivers/gpu/drm/i915/i915_pvinfo.h | 16 +++++++++++++++-
 drivers/gpu/drm/i915/i915_vgpu.c   | 23 +++++++++++++++++++++--
 3 files changed, 47 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +11 -0
index 3017ef0..7b2d7cb 100644
@@ -56,6 +56,7 @@
 
 #include "i915_params.h"
 #include "i915_reg.h"
+#include "i915_pvinfo.h"
 #include "i915_utils.h"
 
 #include "intel_bios.h"
@@ -1343,6 +1344,7 @@ struct i915_workarounds {
 struct i915_virtual_gpu {
 	bool active;
 	u32 caps;
+	u32 pv_caps;
 };
 
 /* used in computing the new watermarks state */
@@ -2853,6 +2855,11 @@ static inline bool intel_vgpu_active(struct drm_i915_private *dev_priv)
 	return dev_priv->vgpu.active;
 }
 
+static inline bool intel_vgpu_has_pvmmio(struct drm_i915_private *dev_priv)
+{
+	return dev_priv->vgpu.caps & VGT_CAPS_PVMMIO;
+}
+
 u32 i915_pipestat_enable_mask(struct drm_i915_private *dev_priv,
 			      enum pipe pipe);
 void
@@ -3878,4 +3885,8 @@ static inline int intel_hws_csb_write_index(struct drm_i915_private *i915)
 		return I915_HWS_CSB_WRITE_INDEX;
 }
 
+#define PVMMIO_LEVEL_ENABLE(dev_priv, level)	\
+	(intel_vgpu_active(dev_priv) && intel_vgpu_has_pvmmio(dev_priv) \
+			&& (dev_priv->vgpu.pv_caps & level))
+
 #endif
drivers/gpu/drm/i915/i915_pvinfo.h +15 -1
index eeaa3d5..78a4b9c 100644
@@ -55,6 +55,18 @@ enum vgt_g2v_type {
 #define VGT_CAPS_FULL_48BIT_PPGTT	BIT(2)
 #define VGT_CAPS_HWSP_EMULATION		BIT(3)
 #define VGT_CAPS_HUGE_GTT		BIT(4)
+#define VGT_CAPS_PVMMIO		BIT(5)
+
+/*
+ * define different levels of PVMMIO optimization
+ */
+enum pvmmio_levels {
+	PVMMIO_ELSP_SUBMIT = 0x1,
+	PVMMIO_PLANE_UPDATE = 0x2,
+	PVMMIO_PLANE_WM_UPDATE = 0x4,
+	PVMMIO_MASTER_IRQ = 0x8,
+	PVMMIO_PPGTT_UPDATE = 0x10,
+};
 
 struct vgt_if {
 	u64 magic;		/* VGT_MAGIC */
@@ -107,7 +119,9 @@ struct vgt_if {
 	u32 execlist_context_descriptor_lo;
 	u32 execlist_context_descriptor_hi;
 
-	u32  rsv7[0x200 - 24];    /* pad to one page */
+	u32 pvmmio_caps;
+
+	u32  rsv7[0x200 - 25];    /* pad to one page */
 } __packed;
 
 #define vgtif_reg(x) \
drivers/gpu/drm/i915/i915_vgpu.c +21 -2
index 869cf4a..219c7c0 100644
@@ -62,6 +62,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 {
 	u64 magic;
 	u16 version_major;
+	u32 gvt_caps;
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
@@ -76,9 +77,27 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	}
 
 	dev_priv->vgpu.caps = __raw_i915_read32(dev_priv, vgtif_reg(vgt_caps));
-
 	dev_priv->vgpu.active = true;
-	DRM_INFO("Virtual GPU for Intel GVT-g detected.\n");
+
+	if (!intel_vgpu_has_pvmmio(dev_priv)) {
+		DRM_INFO("Virtual GPU for Intel GVT-g detected\n");
+		return;
+	}
+
+	/* If guest wants to enable pvmmio, it needs to enable it explicitly
+	 * through vgt_if interface, and then read back the enable state from
+	 * gvt layer.
+	 */
+	gvt_caps = __raw_i915_read32(dev_priv, vgtif_reg(pvmmio_caps));
+	dev_priv->vgpu.pv_caps &= gvt_caps;
+	__raw_i915_write32(dev_priv, vgtif_reg(pvmmio_caps),
+			dev_priv->vgpu.pv_caps);
+	if (!dev_priv->vgpu.pv_caps)
+		return;
+
+
+	DRM_INFO("Virtual GPU for Intel GVT-g detected with pvmmio 0x%x\n",
+			dev_priv->vgpu.pv_caps);
 }
 
 bool intel_vgpu_has_full_48bit_ppgtt(struct drm_i915_private *dev_priv)
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v3 2/8 drm/i915: get ready of memory for pvmmio

In reply to Xiaolin Zhang

To enable pvmmio feature, we need to prepare one 4K shared page which will be accessed by both guest and backend i915 driver used for data exchagne.

the layout of shared_page also defined as well in this patch.

guest i915 will allocate one page memory and then pass this page's physical address to backend i915 driver through PVINFO register so that backend i915 driver can access this shared page without hypeviser trap cost for shared data exchagne via hyperviser read_gpa functionality.

v0: RFC
v1: addressed RFC comment to move both shared_page_lock and shared_page to i915_virtual_gpu structure
v2: packed i915_virtual_gpu structure
v3: added SHARED_PAGE_SETUP g2v notification for pv shared_page setup

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc He Min <[email protected]>
Cc Jiang Fei <[email protected]>
Cc Gong Zhipeng <[email protected]>
Cc Yuan Hang <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.c    |  2 ++
 drivers/gpu/drm/i915/i915_drv.h    |  4 +++-
 drivers/gpu/drm/i915/i915_pvinfo.h | 29 ++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/i915_vgpu.c   | 23 +++++++++++++++++++++++
 4 files changed, 56 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -0
index baac35f..557ab67 100644
@@ -987,6 +987,8 @@ static void i915_mmio_cleanup(struct drm_i915_private *dev_priv)
 
 	intel_teardown_mchbar(dev_priv);
 	pci_iounmap(pdev, dev_priv->regs);
+	if (intel_vgpu_active(dev_priv) && dev_priv->vgpu.shared_page)
+		free_page((unsigned long)dev_priv->vgpu.shared_page);
 }
 
 /**
drivers/gpu/drm/i915/i915_drv.h +3 -1
index 7b2d7cb..d7a972f 100644
@@ -1345,7 +1345,9 @@ struct i915_virtual_gpu {
 	bool active;
 	u32 caps;
 	u32 pv_caps;
-};
+	spinlock_t shared_page_lock;
+	struct gvt_shared_page *shared_page;
+} __packed;
 
 /* used in computing the new watermarks state */
 struct intel_wm_config {
drivers/gpu/drm/i915/i915_pvinfo.h +28 -1
index 78a4b9c..aa5eebc 100644
@@ -24,6 +24,8 @@
 #ifndef _I915_PVINFO_H_
 #define _I915_PVINFO_H_
 
+#include "i915_gem.h"
+
 /* The MMIO offset of the shared info between guest and host emulator */
 #define VGT_PVINFO_PAGE	0x78000
 #define VGT_PVINFO_SIZE	0x1000
@@ -46,9 +48,29 @@ enum vgt_g2v_type {
 	VGT_G2V_PPGTT_L4_PAGE_TABLE_DESTROY,
 	VGT_G2V_EXECLIST_CONTEXT_CREATE,
 	VGT_G2V_EXECLIST_CONTEXT_DESTROY,
+	VGT_G2V_SHARED_PAGE_SETUP,
 	VGT_G2V_MAX,
 };
 
+struct pv_ppgtt_update {
+	u64 pdp;
+	u64 start;
+	u64 length;
+	u32 cache_level;
+};
+
+/*
+ * shared page(4KB) between gvt and VM, could be allocated by guest driver
+ * or a fixed location in PCI bar 0 region
+ */
+struct gvt_shared_page {
+	u32 reg_addr;
+	u32 elsp_data[I915_NUM_ENGINES * 4];
+	u32 ring_id;
+	u32 disable_irq;
+	struct pv_ppgtt_update pv_ppgtt;
+};
+
 /*
  * VGT capabilities type
  */
@@ -121,7 +143,12 @@ struct vgt_if {
 
 	u32 pvmmio_caps;
 
-	u32  rsv7[0x200 - 25];    /* pad to one page */
+	struct {
+		u32 lo;
+		u32 hi;
+	} shared_page_gpa;
+
+	u32  rsv7[0x200 - 27];    /* pad to one page */
 } __packed;
 
 #define vgtif_reg(x) \
drivers/gpu/drm/i915/i915_vgpu.c +23 -0
index 219c7c0..63f70bf 100644
@@ -63,6 +63,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	u64 magic;
 	u16 version_major;
 	u32 gvt_caps;
+	u64 gpa;
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
@@ -95,6 +96,28 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	if (!dev_priv->vgpu.pv_caps)
 		return;
 
+	dev_priv->vgpu.shared_page =  (struct gvt_shared_page *)
+			get_zeroed_page(GFP_KERNEL);
+	if (!dev_priv->vgpu.shared_page) {
+		DRM_ERROR("out of memory for shared page memory\n");
+		return;
+	}
+	gpa = __pa(dev_priv->vgpu.shared_page);
+	__raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.lo),
+			lower_32_bits(gpa));
+	__raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.hi),
+			upper_32_bits(gpa));
+	if (gpa != __raw_i915_read64(dev_priv,
+			vgtif_reg(shared_page_gpa))) {
+		DRM_ERROR("vgpu: passed shared_page_gpa failed\n");
+		free_page((unsigned long)dev_priv->vgpu.shared_page);
+		dev_priv->vgpu.pv_caps = 0;
+		__raw_i915_write32(dev_priv, vgtif_reg(pvmmio_caps), 0);
+		return;
+	}
+	__raw_i915_write32(dev_priv, vgtif_reg(g2v_notify),
+			VGT_G2V_SHARED_PAGE_SETUP);
+	spin_lock_init(&dev_priv->vgpu.shared_page_lock);
 
 	DRM_INFO("Virtual GPU for Intel GVT-g detected with pvmmio 0x%x\n",
 			dev_priv->vgpu.pv_caps);
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH v3 2/8] drm/i915: get ready of memory for pvmmio

Quoted 87 lines · Xiaolin Zhang

To enable pvmmio feature, we need to prepare one 4K shared page which will be accessed by both guest and backend i915 driver used for data exchagne.

the layout of shared_page also defined as well in this patch.

guest i915 will allocate one page memory and then pass this page's physical address to backend i915 driver through PVINFO register so that backend i915 driver can access this shared page without hypeviser trap cost for shared data exchagne via hyperviser read_gpa functionality.

v0: RFC
v1: addressed RFC comment to move both shared_page_lock and shared_page to i915_virtual_gpu structure
v2: packed i915_virtual_gpu structure
v3: added SHARED_PAGE_SETUP g2v notification for pv shared_page setup

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc He Min <[email protected]>
Cc Jiang Fei <[email protected]>
Cc Gong Zhipeng <[email protected]>
Cc Yuan Hang <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.c    |  2 ++
 drivers/gpu/drm/i915/i915_drv.h    |  4 +++-
 drivers/gpu/drm/i915/i915_pvinfo.h | 29 ++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/i915_vgpu.c   | 23 +++++++++++++++++++++++
 4 files changed, 56 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -0
index baac35f..557ab67 100644
@@ -987,6 +987,8 @@ static void i915_mmio_cleanup(struct drm_i915_private *dev_priv)
 
 	intel_teardown_mchbar(dev_priv);
 	pci_iounmap(pdev, dev_priv->regs);
+	if (intel_vgpu_active(dev_priv) && dev_priv->vgpu.shared_page)
+		free_page((unsigned long)dev_priv->vgpu.shared_page);
 }
 
 /**
drivers/gpu/drm/i915/i915_drv.h +3 -1
index 7b2d7cb..d7a972f 100644
@@ -1345,7 +1345,9 @@ struct i915_virtual_gpu {
 	bool active;
 	u32 caps;
 	u32 pv_caps;
-};
+	spinlock_t shared_page_lock;
+	struct gvt_shared_page *shared_page;
+} __packed;
 
 /* used in computing the new watermarks state */
 struct intel_wm_config {
drivers/gpu/drm/i915/i915_pvinfo.h +7 -0
index 78a4b9c..aa5eebc 100644
@@ -24,6 +24,8 @@
 #ifndef _I915_PVINFO_H_
 #define _I915_PVINFO_H_
 
+#include "i915_gem.h"
+
 /* The MMIO offset of the shared info between guest and host emulator */
 #define VGT_PVINFO_PAGE	0x78000
 #define VGT_PVINFO_SIZE	0x1000
@@ -46,9 +48,29 @@ enum vgt_g2v_type {
 	VGT_G2V_PPGTT_L4_PAGE_TABLE_DESTROY,
 	VGT_G2V_EXECLIST_CONTEXT_CREATE,
 	VGT_G2V_EXECLIST_CONTEXT_DESTROY,
+	VGT_G2V_SHARED_PAGE_SETUP,
 	VGT_G2V_MAX,
 };
 
+struct pv_ppgtt_update {
+	u64 pdp;
+	u64 start;
+	u64 length;

drivers/gpu/drm/i915/i915_pvinfo.h enum vgt_g2v_type { · line 68

Quoted 10 lines
drivers/gpu/drm/i915/i915_pvinfo.h +10 -0
+	u32 cache_level;
+};
+
+/*
+ * shared page(4KB) between gvt and VM, could be allocated by guest driver
+ * or a fixed location in PCI bar 0 region
+ */
+struct gvt_shared_page {
+	u32 reg_addr;
+	u32 elsp_data[I915_NUM_ENGINES * 4];

You can't rely on I915_NUM_ENGINES, which may be changed so that would cause incompatibility in shared page definition.

Quoted 70 lines
drivers/gpu/drm/i915/i915_pvinfo.h +11 -1
+	u32 ring_id;
+	u32 disable_irq;
+	struct pv_ppgtt_update pv_ppgtt;
+};
+
 /*
  * VGT capabilities type
  */
@@ -121,7 +143,12 @@ struct vgt_if {
 
 	u32 pvmmio_caps;
 
-	u32  rsv7[0x200 - 25];    /* pad to one page */
+	struct {
+		u32 lo;
+		u32 hi;
+	} shared_page_gpa;
+
+	u32  rsv7[0x200 - 27];    /* pad to one page */
 } __packed;
 
 #define vgtif_reg(x) \
drivers/gpu/drm/i915/i915_vgpu.c +23 -0
index 219c7c0..63f70bf 100644
@@ -63,6 +63,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	u64 magic;
 	u16 version_major;
 	u32 gvt_caps;
+	u64 gpa;
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
@@ -95,6 +96,28 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	if (!dev_priv->vgpu.pv_caps)
 		return;
 
+	dev_priv->vgpu.shared_page =  (struct gvt_shared_page *)
+			get_zeroed_page(GFP_KERNEL);
+	if (!dev_priv->vgpu.shared_page) {
+		DRM_ERROR("out of memory for shared page memory\n");
+		return;
+	}
+	gpa = __pa(dev_priv->vgpu.shared_page);
+	__raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.lo),
+			lower_32_bits(gpa));
+	__raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.hi),
+			upper_32_bits(gpa));
+	if (gpa != __raw_i915_read64(dev_priv,
+			vgtif_reg(shared_page_gpa))) {
+		DRM_ERROR("vgpu: passed shared_page_gpa failed\n");
+		free_page((unsigned long)dev_priv->vgpu.shared_page);
+		dev_priv->vgpu.pv_caps = 0;
+		__raw_i915_write32(dev_priv, vgtif_reg(pvmmio_caps), 0);
+		return;
+	}
+	__raw_i915_write32(dev_priv, vgtif_reg(g2v_notify),
+			VGT_G2V_SHARED_PAGE_SETUP);
+	spin_lock_init(&dev_priv->vgpu.shared_page_lock);
 
 	DRM_INFO("Virtual GPU for Intel GVT-g detected with pvmmio 0x%x\n",
 			dev_priv->vgpu.pv_caps);
Signature · 6 lines
2.7.4

_______________________________________________
intel-gvt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
Signature · 3 lines
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH v3 3/8 drm/i915: context submission pvmmio optimization

In reply to Xiaolin Zhang

It is performance optimization to reduce mmio trap numbers from 4 to 1 durning ELSP porting writing (context submission).

When context subission, to cache elsp_data[4] values in the shared page, the last elsp_data[0] port writing will be trapped to gvt for real context submission.

Use PVMMIO_ELSP_SUBMIT to control this level of pvmmio optimization.

v0: RFC
v1: rebase
v2: added pv ops for pv context submission. to maximize code resuse, introduced 2 more ops (submit_ports & preempt_context) instead of 1 op (set_default_submission) in engine structure. pv version of submit_ports and preempt_context implemented.
v3:
1. to reduce more code duplication, code refactor and replaced 2 ops "submit_ports & preempt_contex" from v2 by 1 ops "write_desc" in engine structure. pv version of write_des implemented.
2. added VGT_G2V_ELSP_SUBMIT for g2v pv notification.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc He Min <[email protected]>
Cc Jiang Fei <[email protected]>
Cc Gong Zhipeng <[email protected]>
Cc Yuan Hang <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/i915_pvinfo.h      |  1 +
 drivers/gpu/drm/i915/i915_vgpu.c        |  2 ++
 drivers/gpu/drm/i915/intel_lrc.c        | 33 +++++++++++++++++++++++++++++----
 drivers/gpu/drm/i915/intel_ringbuffer.h |  3 +++
 4 files changed, 35 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_pvinfo.h +1 -0
index aa5eebc..3da644d 100644
@@ -49,6 +49,7 @@ enum vgt_g2v_type {
 	VGT_G2V_EXECLIST_CONTEXT_CREATE,
 	VGT_G2V_EXECLIST_CONTEXT_DESTROY,
 	VGT_G2V_SHARED_PAGE_SETUP,
+	VGT_G2V_ELSP_SUBMIT,
 	VGT_G2V_MAX,
 };
 
drivers/gpu/drm/i915/i915_vgpu.c +2 -0
index 63f70bf..82120f6 100644
@@ -85,6 +85,8 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 		return;
 	}
 
+	dev_priv->vgpu.pv_caps = PVMMIO_ELSP_SUBMIT;
+
 	/* If guest wants to enable pvmmio, it needs to enable it explicitly
 	 * through vgt_if interface, and then read back the enable state from
 	 * gvt layer.
drivers/gpu/drm/i915/intel_lrc.c +29 -4
index ff0e2b3..660e24c 100644
@@ -391,8 +391,10 @@ static u64 execlists_update_context(struct i915_request *rq)
 	return ce->lrc_desc;
 }
 
-static inline void write_desc(struct intel_engine_execlists *execlists, u64 desc, u32 port)
+static inline void write_desc(struct intel_engine_cs *engine,
+			u64 desc, u32 port)
 {
+	struct intel_engine_execlists *execlists = &engine->execlists;
 	if (execlists->ctrl_reg) {
 		writel(lower_32_bits(desc), execlists->submit_reg + port * 2);
 		writel(upper_32_bits(desc), execlists->submit_reg + port * 2 + 1);
@@ -402,6 +404,24 @@ static inline void write_desc(struct intel_engine_execlists *execlists, u64 desc
 	}
 }
 
+static inline void write_desc_pv(struct intel_engine_cs *engine,
+			u64 desc, u32 port)
+{
+	struct drm_i915_private *dev_priv = engine->i915;
+	u32 *elsp_data;
+
+	spin_lock(&engine->i915->vgpu.shared_page_lock);
+	elsp_data = engine->i915->vgpu.shared_page->elsp_data;
+	elsp_data[engine->id * 4 + port * 2] = upper_32_bits(desc);
+	elsp_data[engine->id * 4 + port * 2 + 1] = lower_32_bits(desc);
+	if (port == 0) {
+		engine->i915->vgpu.shared_page->ring_id = engine->id;
+		__raw_i915_write32(dev_priv, vgtif_reg(g2v_notify),
+				VGT_G2V_ELSP_SUBMIT);
+	}
+	spin_unlock(&engine->i915->vgpu.shared_page_lock);
+}
+
 static void execlists_submit_ports(struct intel_engine_cs *engine)
 {
 	struct intel_engine_execlists *execlists = &engine->execlists;
@@ -450,7 +470,7 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
 			desc = 0;
 		}
 
-		write_desc(execlists, desc, n);
+		engine->write_desc(engine, desc, n);
 	}
 
 	/* we need to manually load the submit queue */
@@ -504,9 +524,9 @@ static void inject_preempt_context(struct intel_engine_cs *engine)
 	 */
 	GEM_TRACE("%s\n", engine->name);
 	for (n = execlists_num_ports(execlists); --n; )
-		write_desc(execlists, 0, n);
+		engine->write_desc(engine, 0, n);
 
-	write_desc(execlists, ce->lrc_desc, n);
+	engine->write_desc(engine, ce->lrc_desc, n);
 
 	/* we need to manually load the submit queue */
 	if (execlists->ctrl_reg)
@@ -2134,6 +2154,11 @@ void intel_execlists_set_default_submission(struct intel_engine_cs *engine)
 
 	engine->reset.prepare = execlists_reset_prepare;
 
+	engine->write_desc = write_desc;
+
+	if (PVMMIO_LEVEL_ENABLE(engine->i915, PVMMIO_ELSP_SUBMIT))
+		engine->write_desc = write_desc_pv;
+
 	engine->park = NULL;
 	engine->unpark = NULL;
 
drivers/gpu/drm/i915/intel_ringbuffer.h +3 -0
index f6ec48a..b752aab 100644
@@ -523,6 +523,9 @@ struct intel_engine_cs {
 	void		(*irq_seqno_barrier)(struct intel_engine_cs *engine);
 	void		(*cleanup)(struct intel_engine_cs *engine);
 
+	void		(*write_desc)(struct intel_engine_cs *engine,
+					u64 desc, u32 port);
+
 	/* GEN8 signal/wait table - never trust comments!
 	 *	  signal to	signal to    signal to   signal to      signal to
 	 *	    RCS		   VCS          BCS        VECS		 VCS2
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH v3 4/8 drm/i915: ppgtt update pvmmio optimization

In reply to Xiaolin Zhang

This patch extends g2v notification to notify host GVT-g of ppgtt update from guest, including alloc_4lvl, clear_4lv4 and insert_4lvl. It uses shared page to pass the additional params. This patch also add one new pvmmio level to control ppgtt update.

Use PVMMIO_PPGTT_UPDATE to control this level of pvmmio optimization.

v0: RFC
v1: rebase
v2: added pv callbacks for vm.{allocate_va_range, insert_entries, clear_range} within ppgtt.
v3: rebase, disable huge page ppgtt support when using PVMMIO ppgtt update due to complex and performance impact.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc He Min <[email protected]>
Cc Jiang Fei <[email protected]>
Cc Gong Zhipeng <[email protected]>
Cc Yuan Hang <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c     |  3 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c | 67 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_pvinfo.h  |  3 ++
 drivers/gpu/drm/i915/i915_vgpu.c    |  2 +-
 4 files changed, 73 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +2 -1
index 93d0928..beb3f70 100644
@@ -5496,7 +5496,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
 	int ret;
 
 	/* We need to fallback to 4K pages if host doesn't support huge gtt. */
-	if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_huge_gtt(dev_priv))
+	if ((intel_vgpu_active(dev_priv) && !intel_vgpu_has_huge_gtt(dev_priv))
+			|| PVMMIO_LEVEL_ENABLE(dev_priv, PVMMIO_PPGTT_UPDATE))
 		mkwrite_device_info(dev_priv)->page_sizes =
 			I915_GTT_PAGE_SIZE_4K;
 
drivers/gpu/drm/i915/i915_gem_gtt.c +67 -0

91 lines not on this page · raw message

drivers/gpu/drm/i915/i915_pvinfo.h +3 -0
index 3da644d..f458caa 100644
@@ -50,6 +50,9 @@ enum vgt_g2v_type {
 	VGT_G2V_EXECLIST_CONTEXT_DESTROY,
 	VGT_G2V_SHARED_PAGE_SETUP,
 	VGT_G2V_ELSP_SUBMIT,
+	VGT_G2V_PPGTT_L4_ALLOC,
+	VGT_G2V_PPGTT_L4_CLEAR,
+	VGT_G2V_PPGTT_L4_INSERT,
 	VGT_G2V_MAX,
 };
 
drivers/gpu/drm/i915/i915_vgpu.c +1 -1
index 82120f6..33e5b94 100644
@@ -85,7 +85,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 		return;
 	}
 
-	dev_priv->vgpu.pv_caps = PVMMIO_ELSP_SUBMIT;
+	dev_priv->vgpu.pv_caps = PVMMIO_ELSP_SUBMIT | PVMMIO_PPGTT_UPDATE;
 
 	/* If guest wants to enable pvmmio, it needs to enable it explicitly
 	 * through vgt_if interface, and then read back the enable state from
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v3 5/8 drm/i915/gvt: GVTg handle pvmmio_caps PVINFO register

In reply to Xiaolin Zhang

implement enable_pvmmio PVINFO register handler in GVTg to control different level pvmmio optimization within guest.

report VGT_CAPS_PVMMIO capability in pvinfo page for guest.

v0: RFC
v1: rebase
v2: rebase
v3: renamed enable_pvmmio to pvmmio_caps which is used for host pv caps.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Min He <[email protected]>
Cc Fei Jiang <[email protected]>
Cc Zhipeng Gong <[email protected]>
Cc Hang Yuan <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/gvt/gvt.h      | 3 +++
 drivers/gpu/drm/i915/gvt/handlers.c | 7 ++++---
 drivers/gpu/drm/i915/gvt/vgpu.c     | 4 ++++
 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/gvt.h +3 -0
index 31f6cdb..5f6b2d5 100644
@@ -52,6 +52,9 @@
 
 #define GVT_MAX_VGPU 8
 
+#define _vgtif_reg(x) \
+	(VGT_PVINFO_PAGE + offsetof(struct vgt_if, x))
+
 enum {
 	INTEL_GVT_HYPERVISOR_XEN = 0,
 	INTEL_GVT_HYPERVISOR_KVM,
drivers/gpu/drm/i915/gvt/handlers.c +4 -3
index d262587..6cb139f 100644
@@ -1145,9 +1145,6 @@ static int sbi_ctl_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 	return 0;
 }
 
-#define _vgtif_reg(x) \
-	(VGT_PVINFO_PAGE + offsetof(struct vgt_if, x))
-
 static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,
 		void *p_data, unsigned int bytes)
 {
@@ -1168,6 +1165,7 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,
 		break;
 	case 0x78010:	/* vgt_caps */
 	case 0x7881c:
+	case _vgtif_reg(pvmmio_caps):
 		break;
 	default:
 		invalid_read = true;
@@ -1241,6 +1239,9 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 	case _vgtif_reg(g2v_notify):
 		ret = handle_g2v_notification(vgpu, data);
 		break;
+	case _vgtif_reg(pvmmio_caps):
+		DRM_INFO("vgpu id=%d pvmmio caps =0x%x\n", vgpu->id, data);
+		break;
 	/* add xhot and yhot to handled list to avoid error log */
 	case _vgtif_reg(cursor_x_hot):
 	case _vgtif_reg(cursor_y_hot):
drivers/gpu/drm/i915/gvt/vgpu.c +4 -0
index a4e8e3c..84244ab 100644
@@ -47,6 +47,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) = VGT_CAPS_FULL_48BIT_PPGTT;
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HWSP_EMULATION;
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HUGE_GTT;
+	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_PVMMIO;
 
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.base)) =
 		vgpu_aperture_gmadr_base(vgpu);
@@ -62,6 +63,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(cursor_x_hot)) = UINT_MAX;
 	vgpu_vreg_t(vgpu, vgtif_reg(cursor_y_hot)) = UINT_MAX;
 
+
 	gvt_dbg_core("Populate PVINFO PAGE for vGPU %d\n", vgpu->id);
 	gvt_dbg_core("aperture base [GMADR] 0x%llx size 0x%llx\n",
 		vgpu_aperture_gmadr_base(vgpu), vgpu_aperture_sz(vgpu));
@@ -524,6 +526,7 @@ void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr,
 	struct intel_gvt *gvt = vgpu->gvt;
 	struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
 	unsigned int resetting_eng = dmlr ? ALL_ENGINES : engine_mask;
+	int pvmmio_caps = vgpu_vreg(vgpu, _vgtif_reg(pvmmio_caps));
 
 	gvt_dbg_core("------------------------------------------\n");
 	gvt_dbg_core("resseting vgpu%d, dmlr %d, engine_mask %08x\n",
@@ -555,6 +558,7 @@ void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr,
 
 		intel_vgpu_reset_mmio(vgpu, dmlr);
 		populate_pvinfo_page(vgpu);
+		vgpu_vreg(vgpu, _vgtif_reg(pvmmio_caps)) = pvmmio_caps;
 		intel_vgpu_reset_display(vgpu);
 
 		if (dmlr) {
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v3 6/8 drm/i915/gvt: GVTg handle shared_page setup

In reply to Xiaolin Zhang

GVTg implemented shared_page setup operation and read_shared_page functionality based on hypervisor_read_gpa().

the shared_page_gpa was passed from guest driver through PVINFO shared_page_gpa register.

v0: RFC
v1: rebase
v2: rebase
v3: added shared_page_gpa check and if read_gpa failure, return zero memory and handle VGT_G2V_SHARED_PAGE_SETUP g2v notification

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Min He <[email protected]>
Cc Fei Jiang <[email protected]>
Cc Zhipeng Gong <[email protected]>
Cc Hang Yuan <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/gvt/gvt.h      |  5 ++++-
 drivers/gpu/drm/i915/gvt/handlers.c | 39 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/gvt/vgpu.c     | 24 +++++++++++++++++++++++
 3 files changed, 67 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gvt.h +4 -1
index 5f6b2d5..e013962 100644
@@ -235,6 +235,8 @@ struct intel_vgpu {
 	struct completion vblank_done;
 
 	u32 scan_nonprivbb;
+	u64 shared_page_gpa;
+	bool shared_page_enabled;
 };
 
 /* validating GM healthy status*/
@@ -693,7 +695,8 @@ int intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu);
 void intel_gvt_debugfs_remove_vgpu(struct intel_vgpu *vgpu);
 int intel_gvt_debugfs_init(struct intel_gvt *gvt);
 void intel_gvt_debugfs_clean(struct intel_gvt *gvt);
-
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+		unsigned int offset, void *buf, unsigned long len);
 
 #include "trace.h"
 #include "mpt.h"
drivers/gpu/drm/i915/gvt/handlers.c +39 -0
index 6cb139f..16ef41b 100644
@@ -1166,6 +1166,8 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,
 	case 0x78010:	/* vgt_caps */
 	case 0x7881c:
 	case _vgtif_reg(pvmmio_caps):
+	case _vgtif_reg(shared_page_gpa.lo):
+	case _vgtif_reg(shared_page_gpa.hi):
 		break;
 	default:
 		invalid_read = true;
@@ -1183,6 +1185,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 	intel_gvt_gtt_type_t root_entry_type = GTT_TYPE_PPGTT_ROOT_L4_ENTRY;
 	struct intel_vgpu_mm *mm;
 	u64 *pdps;
+	unsigned long gfn;
 
 	pdps = (u64 *)&vgpu_vreg64_t(vgpu, vgtif_reg(pdp[0]));
 
@@ -1196,6 +1199,11 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 	case VGT_G2V_PPGTT_L3_PAGE_TABLE_DESTROY:
 	case VGT_G2V_PPGTT_L4_PAGE_TABLE_DESTROY:
 		return intel_vgpu_put_ppgtt_mm(vgpu, pdps);
+	case VGT_G2V_SHARED_PAGE_SETUP:
+		gfn = vgpu->shared_page_gpa >> PAGE_SHIFT;
+		if (intel_gvt_hypervisor_is_valid_gfn(vgpu, gfn))
+			vgpu->shared_page_enabled = true;
+		break;
 	case VGT_G2V_EXECLIST_CONTEXT_CREATE:
 	case VGT_G2V_EXECLIST_CONTEXT_DESTROY:
 	case 1:	/* Remove this in guest driver. */
@@ -1223,6 +1231,33 @@ static int send_display_ready_uevent(struct intel_vgpu *vgpu, int ready)
 	return kobject_uevent_env(kobj, KOBJ_ADD, env);
 }
 
+static int handle_shared_page_gpa(struct intel_vgpu *vgpu,
+		unsigned int offset, unsigned int data)
+{
+	bool partial_update = false;
+	unsigned long gpa, gfn;
+
+	if (offset == _vgtif_reg(shared_page_gpa.lo)) {
+		if (vgpu_vreg_t(vgpu, vgtif_reg(shared_page_gpa.hi)) == -1U)
+			partial_update = true;
+	}
+	if (offset == _vgtif_reg(shared_page_gpa.hi)) {
+		if (vgpu_vreg_t(vgpu, vgtif_reg(shared_page_gpa.lo)) == -1U)
+			partial_update = true;
+	}
+	if (partial_update)
+		return 0;
+
+	gpa = vgpu_vreg64_t(vgpu, vgtif_reg(shared_page_gpa));
+	gfn = gpa >> PAGE_SHIFT;
+	if (!intel_gvt_hypervisor_is_valid_gfn(vgpu, gfn)) {
+		vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) = 0;
+		return 0;
+	}
+	vgpu->shared_page_gpa = gpa;
+	return 0;
+}
+
 static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 		void *p_data, unsigned int bytes)
 {
@@ -1242,6 +1277,10 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 	case _vgtif_reg(pvmmio_caps):
 		DRM_INFO("vgpu id=%d pvmmio caps =0x%x\n", vgpu->id, data);
 		break;
+	case _vgtif_reg(shared_page_gpa.lo):
+	case _vgtif_reg(shared_page_gpa.hi):
+		handle_shared_page_gpa(vgpu, offset, data);
+		break;
 	/* add xhot and yhot to handled list to avoid error log */
 	case _vgtif_reg(cursor_x_hot):
 	case _vgtif_reg(cursor_y_hot):
drivers/gpu/drm/i915/gvt/vgpu.c +24 -0
index 84244ab..40aaae8 100644
@@ -63,6 +63,8 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(cursor_x_hot)) = UINT_MAX;
 	vgpu_vreg_t(vgpu, vgtif_reg(cursor_y_hot)) = UINT_MAX;
 
+	vgpu_vreg_t(vgpu, vgtif_reg(shared_page_gpa.lo)) = -1U;
+	vgpu_vreg_t(vgpu, vgtif_reg(shared_page_gpa.hi)) = -1U;
 
 	gvt_dbg_core("Populate PVINFO PAGE for vGPU %d\n", vgpu->id);
 	gvt_dbg_core("aperture base [GMADR] 0x%llx size 0x%llx\n",
@@ -587,3 +589,25 @@ void intel_gvt_reset_vgpu(struct intel_vgpu *vgpu)
 	intel_gvt_reset_vgpu_locked(vgpu, true, 0);
 	mutex_unlock(&vgpu->vgpu_lock);
 }
+
+/**
+ * intel_gvt_read_shared_page - read content from shared page
+ */
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+		unsigned int offset, void *buf, unsigned long len)
+{
+	int ret = -EINVAL;
+	unsigned long gpa;
+
+	if (offset >= sizeof(struct gvt_shared_page))
+		goto err;
+
+	gpa = vgpu->shared_page_gpa + offset;
+	ret = intel_gvt_hypervisor_read_gpa(vgpu, gpa, buf, len);
+	if (!ret)
+		return ret;
+err:
+	gvt_vgpu_err("read shared page (offset %x) failed", offset);
+	memset(buf, 0, len);
+	return ret;
+}
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH v3 7/8 drm/i915/gvt: GVTg support context submission pvmmio optimization

In reply to Xiaolin Zhang

implemented context submission pvmmio optimizaiton with GVTg.

GVTg to read context submission data (elsp_data) from the shared_page directly without trap cost to improve guest GPU peformrnace.

v0: RFC
v1: rebase
v2: rebase
v3: report pv context submission cap and handle VGT_G2V_ELSP_SUBMIT g2v pv notification.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Min He <[email protected]>
Cc Fei Jiang <[email protected]>
Cc Zhipeng Gong <[email protected]>
Cc Hang Yuan <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/gvt/gvt.h      |  4 ++++
 drivers/gpu/drm/i915/gvt/handlers.c | 39 ++++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/gvt/vgpu.c     |  2 ++
 3 files changed, 44 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gvt.h +4 -0
index e013962..c8bd1f3 100644
@@ -55,6 +55,10 @@
 #define _vgtif_reg(x) \
 	(VGT_PVINFO_PAGE + offsetof(struct vgt_if, x))
 
+#define VGPU_PVMMIO(vgpu, level)	\
+	((vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) & level) \
+			&& vgpu->shared_page_enabled)
+
 enum {
 	INTEL_GVT_HYPERVISOR_XEN = 0,
 	INTEL_GVT_HYPERVISOR_KVM,
drivers/gpu/drm/i915/gvt/handlers.c +38 -1
index 16ef41b..1659bd1 100644
@@ -1180,12 +1180,46 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,
 	return 0;
 }
 
+static int intel_vgpu_g2v_pv_elsp_submit(struct intel_vgpu *vgpu)
+{
+	int ring_id;
+	struct intel_vgpu_execlist *execlist;
+	u32 elsp_data[4 * I915_NUM_ENGINES];
+	u32 elsp_data_off;
+	u32 ring_id_off;
+	int ret = -EINVAL;
+
+	if (!VGPU_PVMMIO(vgpu, PVMMIO_ELSP_SUBMIT))
+		return ret;
+
+	ring_id_off = offsetof(struct gvt_shared_page, ring_id);
+	if (intel_gvt_read_shared_page(vgpu, ring_id_off, &ring_id, 4))
+		return ret;
+
+	if (WARN_ON(ring_id < 0 || ring_id >= I915_NUM_ENGINES))
+		return ret;
+
+	elsp_data_off = offsetof(struct gvt_shared_page, elsp_data);
+	if (intel_gvt_read_shared_page(vgpu, elsp_data_off, &elsp_data,
+			16 * I915_NUM_ENGINES))
+		return ret;
+
+	execlist = &vgpu->submission.execlist[ring_id];
+	execlist->elsp_dwords.data[3] = elsp_data[ring_id * 4 + 2];
+	execlist->elsp_dwords.data[2] = elsp_data[ring_id * 4 + 3];
+	execlist->elsp_dwords.data[1] = elsp_data[ring_id * 4 + 0];
+	execlist->elsp_dwords.data[0] = elsp_data[ring_id * 4 + 1];
+
+	return intel_vgpu_submit_execlist(vgpu, ring_id);
+}
+
 static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 {
 	intel_gvt_gtt_type_t root_entry_type = GTT_TYPE_PPGTT_ROOT_L4_ENTRY;
 	struct intel_vgpu_mm *mm;
 	u64 *pdps;
 	unsigned long gfn;
+	int ret = 0;
 
 	pdps = (u64 *)&vgpu_vreg64_t(vgpu, vgtif_reg(pdp[0]));
 
@@ -1204,6 +1238,9 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 		if (intel_gvt_hypervisor_is_valid_gfn(vgpu, gfn))
 			vgpu->shared_page_enabled = true;
 		break;
+	case VGT_G2V_ELSP_SUBMIT:
+		ret = intel_vgpu_g2v_pv_elsp_submit(vgpu);
+		break;
 	case VGT_G2V_EXECLIST_CONTEXT_CREATE:
 	case VGT_G2V_EXECLIST_CONTEXT_DESTROY:
 	case 1:	/* Remove this in guest driver. */
@@ -1211,7 +1248,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 	default:
 		gvt_vgpu_err("Invalid PV notification %d\n", notification);
 	}
-	return 0;
+	return ret;
 }
 
 static int send_display_ready_uevent(struct intel_vgpu *vgpu, int ready)
drivers/gpu/drm/i915/gvt/vgpu.c +2 -0
index 40aaae8..f98b591 100644
@@ -49,6 +49,8 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HUGE_GTT;
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_PVMMIO;
 
+	vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) = PVMMIO_ELSP_SUBMIT;
+
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.base)) =
 		vgpu_aperture_gmadr_base(vgpu);
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.size)) =
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH v3 7/8] drm/i915/gvt: GVTg support context submission pvmmio optimization

Quoted 71 lines · Xiaolin Zhang

implemented context submission pvmmio optimizaiton with GVTg.

GVTg to read context submission data (elsp_data) from the shared_page directly without trap cost to improve guest GPU peformrnace.

v0: RFC
v1: rebase
v2: rebase
v3: report pv context submission cap and handle VGT_G2V_ELSP_SUBMIT g2v pv notification.

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Min He <[email protected]>
Cc Fei Jiang <[email protected]>
Cc Zhipeng Gong <[email protected]>
Cc Hang Yuan <[email protected]>
Cc Zhiyuan Lv <[email protected]>

---

drivers/gpu/drm/i915/gvt/gvt.h      |  4 ++++
drivers/gpu/drm/i915/gvt/handlers.c | 39 ++++++++++++++++++++++++++++++++++++-
drivers/gpu/drm/i915/gvt/vgpu.c     |  2 ++
3 files changed, 44 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gvt.h +4 -0
index e013962..c8bd1f3 100644
@@ -55,6 +55,10 @@
 #define _vgtif_reg(x) \
 	(VGT_PVINFO_PAGE + offsetof(struct vgt_if, x))
 
+#define VGPU_PVMMIO(vgpu, level)	\
+	((vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) & level) \
+			&& vgpu->shared_page_enabled)
+
 enum {
 	INTEL_GVT_HYPERVISOR_XEN = 0,
 	INTEL_GVT_HYPERVISOR_KVM,
drivers/gpu/drm/i915/gvt/handlers.c +19 -0
index 16ef41b..1659bd1 100644
@@ -1180,12 +1180,46 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,
 	return 0;
 }
 
+static int intel_vgpu_g2v_pv_elsp_submit(struct intel_vgpu *vgpu)
+{
+	int ring_id;
+	struct intel_vgpu_execlist *execlist;
+	u32 elsp_data[4 * I915_NUM_ENGINES];
+	u32 elsp_data_off;
+	u32 ring_id_off;
+	int ret = -EINVAL;
+
+	if (!VGPU_PVMMIO(vgpu, PVMMIO_ELSP_SUBMIT))
+		return ret;
+
+	ring_id_off = offsetof(struct gvt_shared_page, ring_id);
+	if (intel_gvt_read_shared_page(vgpu, ring_id_off, &ring_id, 4))
+		return ret;
+
+	if (WARN_ON(ring_id < 0 || ring_id >= I915_NUM_ENGINES))
+		return ret;
+

drivers/gpu/drm/i915/gvt/handlers.c static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset, · line 1211

Quoted 10 lines
drivers/gpu/drm/i915/gvt/handlers.c +10 -0
+	elsp_data_off = offsetof(struct gvt_shared_page, elsp_data);
+	if (intel_gvt_read_shared_page(vgpu, elsp_data_off, &elsp_data,
+			16 * I915_NUM_ENGINES))
+		return ret;
+
+	execlist = &vgpu->submission.execlist[ring_id];
+	execlist->elsp_dwords.data[3] = elsp_data[ring_id * 4 + 2];
+	execlist->elsp_dwords.data[2] = elsp_data[ring_id * 4 + 3];
+	execlist->elsp_dwords.data[1] = elsp_data[ring_id * 4 + 0];
+	execlist->elsp_dwords.data[0] = elsp_data[ring_id * 4 + 1];

It wold be nice to have a named macro to express the intent behind this word swapping. It’s probably not the only place where this happens?

Quoted 53 lines
drivers/gpu/drm/i915/gvt/handlers.c +9 -1
+
+	return intel_vgpu_submit_execlist(vgpu, ring_id);
+}
+
 static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 {
 	intel_gvt_gtt_type_t root_entry_type = GTT_TYPE_PPGTT_ROOT_L4_ENTRY;
 	struct intel_vgpu_mm *mm;
 	u64 *pdps;
 	unsigned long gfn;
+	int ret = 0;
 
 	pdps = (u64 *)&vgpu_vreg64_t(vgpu, vgtif_reg(pdp[0]));
 
@@ -1204,6 +1238,9 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 		if (intel_gvt_hypervisor_is_valid_gfn(vgpu, gfn))
 			vgpu->shared_page_enabled = true;
 		break;
+	case VGT_G2V_ELSP_SUBMIT:
+		ret = intel_vgpu_g2v_pv_elsp_submit(vgpu);
+		break;
 	case VGT_G2V_EXECLIST_CONTEXT_CREATE:
 	case VGT_G2V_EXECLIST_CONTEXT_DESTROY:
 	case 1:	/* Remove this in guest driver. */
@@ -1211,7 +1248,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 	default:
 		gvt_vgpu_err("Invalid PV notification %d\n", notification);
 	}
-	return 0;
+	return ret;
 }
 
 static int send_display_ready_uevent(struct intel_vgpu *vgpu, int ready)
drivers/gpu/drm/i915/gvt/vgpu.c +2 -0
index 40aaae8..f98b591 100644
@@ -49,6 +49,8 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HUGE_GTT;
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_PVMMIO;
 
+	vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) = PVMMIO_ELSP_SUBMIT;
+
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.base)) =
 		vgpu_aperture_gmadr_base(vgpu);
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.size)) =
Signature · 6 lines
2.7.4

_______________________________________________
intel-gvt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw

PATCH v3 8/8 drm/i915/gvt: GVTg support ppgtt pvmmio optimization

In reply to Xiaolin Zhang

This patch handles ppgtt update from g2v notification.

It read out ppgtt pte entries from guest pte tables page and convert them to host pfns.

It creates local ppgtt tables and insert the content pages into the local ppgtt tables directly, which does not track the usage of guest page table and removes the cost of write protection from the original shadow page mechansim.

v0: RFC
v1: rebase
v2: rebase
v3: report pv pggtt cap to guest

Cc Zhenyu Wang <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Min He <[email protected]>
Cc Fei Jiang <[email protected]>
Cc Zhipeng Gong <[email protected]>
Cc Hang Yuan <[email protected]>
Cc Zhiyuan Lv <[email protected]>
---
 drivers/gpu/drm/i915/gvt/gtt.c      | 318 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/gvt/gtt.h      |   9 +
 drivers/gpu/drm/i915/gvt/handlers.c |   9 +
 drivers/gpu/drm/i915/gvt/vgpu.c     |   3 +-
 4 files changed, 338 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gtt.c +318 -0
index 2402395..4a0a221 100644
@@ -1744,6 +1744,26 @@ static int ppgtt_handle_guest_write_page_table_bytes(
 	return 0;
 }
 
+static void invalidate_mm_pv(struct intel_vgpu_mm *mm)
+{
+	struct intel_vgpu *vgpu = mm->vgpu;
+	struct intel_gvt *gvt = vgpu->gvt;
+	struct intel_gvt_gtt *gtt = &gvt->gtt;
+	struct intel_gvt_gtt_pte_ops *ops = gtt->pte_ops;
+	struct intel_gvt_gtt_entry se;
+
+	i915_ppgtt_close(&mm->ppgtt->vm);
+	i915_ppgtt_put(mm->ppgtt);
+
+	ppgtt_get_shadow_root_entry(mm, &se, 0);
+	if (!ops->test_present(&se))
+		return;
+	se.val64 = 0;
+	ppgtt_set_shadow_root_entry(mm, &se, 0);
+
+	mm->ppgtt_mm.shadowed  = false;
+}
+
 static void invalidate_ppgtt_mm(struct intel_vgpu_mm *mm)
 {
 	struct intel_vgpu *vgpu = mm->vgpu;
@@ -1756,6 +1776,11 @@ static void invalidate_ppgtt_mm(struct intel_vgpu_mm *mm)
 	if (!mm->ppgtt_mm.shadowed)
 		return;
 
+	if (VGPU_PVMMIO(mm->vgpu, PVMMIO_PPGTT_UPDATE)) {
+		invalidate_mm_pv(mm);
+		return;
+	}
+
 	for (index = 0; index < ARRAY_SIZE(mm->ppgtt_mm.shadow_pdps); index++) {
 		ppgtt_get_shadow_root_entry(mm, &se, index);
 
@@ -1773,6 +1798,26 @@ static void invalidate_ppgtt_mm(struct intel_vgpu_mm *mm)
 	mm->ppgtt_mm.shadowed = false;
 }
 
+static int shadow_mm_pv(struct intel_vgpu_mm *mm)
+{
+	struct intel_vgpu *vgpu = mm->vgpu;
+	struct intel_gvt *gvt = vgpu->gvt;
+	struct intel_gvt_gtt_entry se;
+
+	mm->ppgtt = i915_ppgtt_create(gvt->dev_priv, NULL);
+	if (IS_ERR(mm->ppgtt)) {
+		gvt_vgpu_err("fail to create ppgtt for pdp 0x%llx\n",
+				px_dma(&mm->ppgtt->pml4));
+		return PTR_ERR(mm->ppgtt);
+	}
+
+	se.type = GTT_TYPE_PPGTT_ROOT_L4_ENTRY;
+	se.val64 = px_dma(&mm->ppgtt->pml4);
+	ppgtt_set_shadow_root_entry(mm, &se, 0);
+	mm->ppgtt_mm.shadowed  = true;
+
+	return 0;
+}
 
 static int shadow_ppgtt_mm(struct intel_vgpu_mm *mm)
 {
@@ -1787,6 +1832,9 @@ static int shadow_ppgtt_mm(struct intel_vgpu_mm *mm)
 	if (mm->ppgtt_mm.shadowed)
 		return 0;
 
+	if (VGPU_PVMMIO(mm->vgpu, PVMMIO_PPGTT_UPDATE))
+		return shadow_mm_pv(mm);
+
 	mm->ppgtt_mm.shadowed = true;
 
 	for (index = 0; index < ARRAY_SIZE(mm->ppgtt_mm.guest_pdps); index++) {
@@ -2766,3 +2814,273 @@ void intel_vgpu_reset_gtt(struct intel_vgpu *vgpu)
 	intel_vgpu_destroy_all_ppgtt_mm(vgpu);
 	intel_vgpu_reset_ggtt(vgpu, true);
 }
+
+int intel_vgpu_g2v_pv_ppgtt_alloc_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[])
+{
+	struct intel_vgpu_mm *mm;
+	int ret = 0;
+	u32 offset;
+	struct pv_ppgtt_update pv_ppgtt;
+
+	offset = offsetof(struct gvt_shared_page, pv_ppgtt);
+	intel_gvt_read_shared_page(vgpu, offset, &pv_ppgtt, sizeof(pv_ppgtt));
+
+	mm = intel_vgpu_find_ppgtt_mm(vgpu, &pv_ppgtt.pdp);
+	if (!mm) {
+		gvt_vgpu_err("failed to find pdp 0x%llx\n", pv_ppgtt.pdp);
+		ret = -EINVAL;
+	} else {
+		ret = mm->ppgtt->vm.allocate_va_range(&mm->ppgtt->vm,
+			pv_ppgtt.start, pv_ppgtt.length);
+		if (ret)
+			gvt_vgpu_err("failed to alloc %llx\n", pv_ppgtt.pdp);
+	}
+
+	return ret;
+}
+
+int intel_vgpu_g2v_pv_ppgtt_clear_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[])
+{
+	struct intel_vgpu_mm *mm;
+	int ret = 0;
+	u32 offset;
+	struct pv_ppgtt_update pv_ppgtt;
+
+	offset = offsetof(struct gvt_shared_page, pv_ppgtt);
+	intel_gvt_read_shared_page(vgpu, offset, &pv_ppgtt, sizeof(pv_ppgtt));
+	mm = intel_vgpu_find_ppgtt_mm(vgpu, &pv_ppgtt.pdp);
+	if (!mm) {
+		gvt_vgpu_err("failed to find pdp 0x%llx\n", pv_ppgtt.pdp);
+		ret = -EINVAL;
+	} else {
+		mm->ppgtt->vm.clear_range(&mm->ppgtt->vm,
+			pv_ppgtt.start, pv_ppgtt.length);
+	}
+
+	return ret;
+}
+
+#define GEN8_PML4E_SIZE		(1UL << GEN8_PML4E_SHIFT)
+#define GEN8_PML4E_SIZE_MASK	(~(GEN8_PML4E_SIZE - 1))
+#define GEN8_PDPE_SIZE		(1UL << GEN8_PDPE_SHIFT)
+#define GEN8_PDPE_SIZE_MASK	(~(GEN8_PDPE_SIZE - 1))
+#define GEN8_PDE_SIZE		(1UL << GEN8_PDE_SHIFT)
+#define GEN8_PDE_SIZE_MASK	(~(GEN8_PDE_SIZE - 1))
+
+#define pml4_addr_end(addr, end)					\
+({	unsigned long __boundary = \
+			((addr) + GEN8_PML4E_SIZE) & GEN8_PML4E_SIZE_MASK; \
+	(__boundary < (end)) ? __boundary : (end);		\
+})
+
+#define pdp_addr_end(addr, end)						\
+({	unsigned long __boundary = \
+			((addr) + GEN8_PDPE_SIZE) & GEN8_PDPE_SIZE_MASK; \
+	(__boundary < (end)) ? __boundary : (end);		\
+})
+
+#define pd_addr_end(addr, end)						\
+({	unsigned long __boundary = \
+			((addr) + GEN8_PDE_SIZE) & GEN8_PDE_SIZE_MASK;	\
+	(__boundary < (end)) ? __boundary : (end);		\
+})
+
+struct ppgtt_walk {
+	unsigned long *mfns;
+	int mfn_index;
+	unsigned long *pt;
+};
+
+static int walk_pt_range(struct intel_vgpu *vgpu, u64 pt,
+				u64 start, u64 end, struct ppgtt_walk *walk)
+{
+	const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
+	struct intel_gvt_gtt_gma_ops *gma_ops = vgpu->gvt->gtt.gma_ops;
+	unsigned long start_index, end_index;
+	int ret;
+	int i;
+	unsigned long mfn, gfn;
+
+	start_index = gma_ops->gma_to_pte_index(start);
+	end_index = ((end - start) >> PAGE_SHIFT) + start_index;
+
+	ret = intel_gvt_hypervisor_read_gpa(vgpu,
+		(pt & PAGE_MASK) + (start_index << info->gtt_entry_size_shift),
+		walk->pt + start_index,
+		(end_index - start_index) << info->gtt_entry_size_shift);
+	if (ret) {
+		gvt_vgpu_err("fail to read gpa %llx\n", pt);
+		return ret;
+	}
+
+	for (i = start_index; i < end_index; i++) {
+		gfn = walk->pt[i] >> PAGE_SHIFT;
+		mfn = intel_gvt_hypervisor_gfn_to_mfn(vgpu, gfn);
+		if (mfn == INTEL_GVT_INVALID_ADDR) {
+			gvt_vgpu_err("fail to translate gfn: 0x%lx\n", gfn);
+			return -ENXIO;
+		}
+		walk->mfns[walk->mfn_index++] = mfn << PAGE_SHIFT;
+	}
+
+	return 0;
+}
+
+
+static int walk_pd_range(struct intel_vgpu *vgpu, u64 pd,
+				u64 start, u64 end, struct ppgtt_walk *walk)
+{
+	const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
+	struct intel_gvt_gtt_gma_ops *gma_ops = vgpu->gvt->gtt.gma_ops;
+	unsigned long index;
+	u64 pt, next;
+	int ret  = 0;
+
+	do {
+		index = gma_ops->gma_to_pde_index(start);
+
+		ret = intel_gvt_hypervisor_read_gpa(vgpu,
+			(pd & PAGE_MASK) + (index <<
+			info->gtt_entry_size_shift), &pt, 8);
+		if (ret)
+			return ret;
+		next = pd_addr_end(start, end);
+		walk_pt_range(vgpu, pt, start, next, walk);
+
+		start = next;
+	} while (start != end);
+
+	return ret;
+}
+
+
+static int walk_pdp_range(struct intel_vgpu *vgpu, u64 pdp,
+				  u64 start, u64 end, struct ppgtt_walk *walk)
+{
+	const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
+	struct intel_gvt_gtt_gma_ops *gma_ops = vgpu->gvt->gtt.gma_ops;
+	unsigned long index;
+	u64 pd, next;
+	int ret  = 0;
+
+	do {
+		index = gma_ops->gma_to_l4_pdp_index(start);
+
+		ret = intel_gvt_hypervisor_read_gpa(vgpu,
+			(pdp & PAGE_MASK) + (index <<
+			info->gtt_entry_size_shift), &pd, 8);
+		if (ret)
+			return ret;
+		next = pdp_addr_end(start, end);
+		walk_pd_range(vgpu, pd, start, next, walk);
+		start = next;
+	} while (start != end);
+
+	return ret;
+}
+
+
+static int walk_pml4_range(struct intel_vgpu *vgpu, u64 pml4,
+				u64 start, u64 end, struct ppgtt_walk *walk)
+{
+	const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
+	struct intel_gvt_gtt_gma_ops *gma_ops = vgpu->gvt->gtt.gma_ops;
+	unsigned long index;
+	u64 pdp, next;
+	int ret  = 0;
+
+	do {
+		index = gma_ops->gma_to_pml4_index(start);
+		ret = intel_gvt_hypervisor_read_gpa(vgpu,
+			(pml4 & PAGE_MASK) + (index <<
+			info->gtt_entry_size_shift), &pdp, 8);
+		if (ret)
+			return ret;
+		next = pml4_addr_end(start, end);
+		walk_pdp_range(vgpu, pdp, start, next, walk);
+		start = next;
+	} while (start != end);
+
+	return ret;
+}
+
+int intel_vgpu_g2v_pv_ppgtt_insert_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[])
+{
+	struct intel_vgpu_mm *mm;
+	u64 pml4, start, length;
+	u32 cache_level;
+	int ret = 0;
+	struct sg_table st;
+	struct scatterlist *sg = NULL;
+	int num_pages;
+	struct i915_vma vma;
+	struct ppgtt_walk walk;
+	int i;
+	u32 offset;
+	struct pv_ppgtt_update pv_ppgtt;
+
+	offset = offsetof(struct gvt_shared_page, pv_ppgtt);
+	intel_gvt_read_shared_page(vgpu, offset, &pv_ppgtt, sizeof(pv_ppgtt));
+	pml4 = pv_ppgtt.pdp;
+	start = pv_ppgtt.start;
+	length = pv_ppgtt.length;
+	cache_level = pv_ppgtt.cache_level;
+	num_pages = length >> PAGE_SHIFT;
+
+	mm = intel_vgpu_find_ppgtt_mm(vgpu, &pml4);
+	if (!mm) {
+		gvt_vgpu_err("fail to find mm for pml4 0x%llx\n", pml4);
+		return -EINVAL;
+	}
+
+	walk.mfn_index = 0;
+	walk.mfns = NULL;
+	walk.pt = NULL;
+
+	walk.mfns = kmalloc_array(num_pages,
+			sizeof(unsigned long), GFP_KERNEL);
+	if (!walk.mfns) {
+		ret = -ENOMEM;
+		goto fail;
+	}
+
+	walk.pt = (unsigned long *)__get_free_pages(GFP_KERNEL, 0);
+	if (!walk.pt) {
+		ret = -ENOMEM;
+		goto fail;
+	}
+
+	if (sg_alloc_table(&st, num_pages, GFP_KERNEL)) {
+		ret = -ENOMEM;
+		goto fail;
+	}
+
+	ret = walk_pml4_range(vgpu, pml4, start, start + length, &walk);
+	if (ret)
+		goto fail_free_sg;
+
+	WARN_ON(num_pages != walk.mfn_index);
+
+	for_each_sg(st.sgl, sg, num_pages, i) {
+		sg->offset = 0;
+		sg->length = PAGE_SIZE;
+		sg_dma_address(sg) = walk.mfns[i];
+		sg_dma_len(sg) = PAGE_SIZE;
+	}
+
+	memset(&vma, 0, sizeof(vma));
+	vma.node.start = start;
+	vma.pages = &st;
+	mm->ppgtt->vm.insert_entries(&mm->ppgtt->vm, &vma, cache_level, 0);
+
+fail_free_sg:
+	sg_free_table(&st);
+fail:
+	kfree(walk.mfns);
+	free_page((unsigned long)walk.pt);
+
+	return ret;
+}
drivers/gpu/drm/i915/gvt/gtt.h +9 -0
index 7a9b361..b25510f 100644
@@ -135,6 +135,7 @@ enum intel_gvt_mm_type {
 
 struct intel_vgpu_mm {
 	enum intel_gvt_mm_type type;
+	struct i915_hw_ppgtt *ppgtt;
 	struct intel_vgpu *vgpu;
 
 	struct kref ref;
@@ -272,4 +273,12 @@ int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu,
 int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,
 	unsigned int off, void *p_data, unsigned int bytes);
 
+int intel_vgpu_g2v_pv_ppgtt_alloc_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[]);
+
+int intel_vgpu_g2v_pv_ppgtt_clear_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[]);
+
+int intel_vgpu_g2v_pv_ppgtt_insert_4lvl(struct intel_vgpu *vgpu,
+		u64 pdps[]);
 #endif /* _GVT_GTT_H_ */
drivers/gpu/drm/i915/gvt/handlers.c +9 -0
index 1659bd1..bdde67c 100644
@@ -1241,6 +1241,15 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)
 	case VGT_G2V_ELSP_SUBMIT:
 		ret = intel_vgpu_g2v_pv_elsp_submit(vgpu);
 		break;
+	case VGT_G2V_PPGTT_L4_ALLOC:
+		ret = intel_vgpu_g2v_pv_ppgtt_alloc_4lvl(vgpu, pdps);
+			break;
+	case VGT_G2V_PPGTT_L4_INSERT:
+		ret = intel_vgpu_g2v_pv_ppgtt_insert_4lvl(vgpu, pdps);
+		break;
+	case VGT_G2V_PPGTT_L4_CLEAR:
+		ret = intel_vgpu_g2v_pv_ppgtt_clear_4lvl(vgpu, pdps);
+		break;
 	case VGT_G2V_EXECLIST_CONTEXT_CREATE:
 	case VGT_G2V_EXECLIST_CONTEXT_DESTROY:
 	case 1:	/* Remove this in guest driver. */
drivers/gpu/drm/i915/gvt/vgpu.c +2 -1
index f98b591..2b84dbb 100644
@@ -49,7 +49,8 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_HUGE_GTT;
 	vgpu_vreg_t(vgpu, vgtif_reg(vgt_caps)) |= VGT_CAPS_PVMMIO;
 
-	vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) = PVMMIO_ELSP_SUBMIT;
+	vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) = PVMMIO_ELSP_SUBMIT |
+			PVMMIO_PPGTT_UPDATE;
 
 	vgpu_vreg_t(vgpu, vgtif_reg(avail_rs.mappable_gmadr.base)) =
 		vgpu_aperture_gmadr_base(vgpu);
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

✗ Fi.CI.CHECKPATCH: warning for i915 pvmmio to improve GVTg performance

In reply to Xiaolin Zhang
== Series Details ==

== Series Details ==

Series: i915 pvmmio to improve GVTg performance
URL : https://patchwork.freedesktop.org/series/52410/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
9c2f6b34b1d3 drm/i915: introduced pv capability for vgpu
-:68: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'dev_priv' - possible side-effects?
#68: FILE: drivers/gpu/drm/i915/i915_drv.h:3877:
+#define PVMMIO_LEVEL_ENABLE(dev_priv, level)	\
+	(intel_vgpu_active(dev_priv) && intel_vgpu_has_pvmmio(dev_priv) \
+			&& (dev_priv->vgpu.pv_caps & level))

-:68: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'level' may be better as '(level)' to avoid precedence issues #68: FILE: drivers/gpu/drm/i915/i915_drv.h:3877:
+#define PVMMIO_LEVEL_ENABLE(dev_priv, level) \
+ (intel_vgpu_active(dev_priv) && intel_vgpu_has_pvmmio(dev_priv) \
+ && (dev_priv->vgpu.pv_caps & level))

-:70: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #70: FILE: drivers/gpu/drm/i915/i915_drv.h:3879:
+ (intel_vgpu_active(dev_priv) && intel_vgpu_has_pvmmio(dev_priv) \
+ && (dev_priv->vgpu.pv_caps & level))

-:139: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #139: FILE: drivers/gpu/drm/i915/i915_vgpu.c:94:
+ __raw_i915_write32(dev_priv, vgtif_reg(pvmmio_caps),
+ dev_priv->vgpu.pv_caps);

-:143: CHECK:LINE_SPACING: Please don't use multiple blank lines #143: FILE: drivers/gpu/drm/i915/i915_vgpu.c:98:
+
+

-:145: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #145: FILE: drivers/gpu/drm/i915/i915_vgpu.c:100:
+ DRM_INFO("Virtual GPU for Intel GVT-g detected with pvmmio 0x%x\n",
+ dev_priv->vgpu.pv_caps);

total: 0 errors, 0 warnings, 6 checks, 97 lines checked 26121d00d625 drm/i915: get ready of memory for pvmmio
-:56: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #56: FILE: drivers/gpu/drm/i915/i915_drv.h:1356:
+ spinlock_t shared_page_lock;

-:143: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #143: FILE: drivers/gpu/drm/i915/i915_vgpu.c:107:
+ __raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.lo),
+ lower_32_bits(gpa));

-:145: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #145: FILE: drivers/gpu/drm/i915/i915_vgpu.c:109:
+ __raw_i915_write32(dev_priv, vgtif_reg(shared_page_gpa.hi),
+ upper_32_bits(gpa));

-:147: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #147: FILE: drivers/gpu/drm/i915/i915_vgpu.c:111:
+ if (gpa != __raw_i915_read64(dev_priv,
+ vgtif_reg(shared_page_gpa))) {

-:155: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #155: FILE: drivers/gpu/drm/i915/i915_vgpu.c:119:
+ __raw_i915_write32(dev_priv, vgtif_reg(g2v_notify),
+ VGT_G2V_SHARED_PAGE_SETUP);

total: 0 errors, 0 warnings, 5 checks, 103 lines checked 544deaecea2e drm/i915: context submission pvmmio optimization -:73: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #73: FILE: drivers/gpu/drm/i915/intel_lrc.c:407:
+static inline void write_desc(struct intel_engine_cs *engine,
+ u64 desc, u32 port)

-:84: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #84: FILE: drivers/gpu/drm/i915/intel_lrc.c:420:
+static inline void write_desc_pv(struct intel_engine_cs *engine,
+ u64 desc, u32 port)

-:96: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #96: FILE: drivers/gpu/drm/i915/intel_lrc.c:432:
+ __raw_i915_write32(dev_priv, vgtif_reg(g2v_notify),
+ VGT_G2V_ELSP_SUBMIT);

-:146: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #146: FILE: drivers/gpu/drm/i915/intel_ringbuffer.h:527:
+ void (*write_desc)(struct intel_engine_cs *engine,
+ u64 desc, u32 port);

total: 0 errors, 0 warnings, 4 checks, 89 lines checked
2f13c56ed4a4 drm/i915: ppgtt update pvmmio optimization
-:41: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #41: FILE: drivers/gpu/drm/i915/i915_gem.c:5538:
+ if ((intel_vgpu_active(dev_priv) && !intel_vgpu_has_huge_gtt(dev_priv))
+ || PVMMIO_LEVEL_ENABLE(dev_priv, PVMMIO_PPGTT_UPDATE))

-:54: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #54: FILE: drivers/gpu/drm/i915/i915_gem_gtt.c:956:
+static void gen8_ppgtt_clear_4lvl_pv(struct i915_address_space *vm,
+ u64 start, u64 length)

-:80: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #80: FILE: drivers/gpu/drm/i915/i915_gem_gtt.c:1216:
+static void gen8_ppgtt_insert_4lvl_pv(struct i915_address_space *vm,
+ struct i915_vma *vma,

-:106: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #106: FILE: drivers/gpu/drm/i915/i915_gem_gtt.c:1532:
+static int gen8_ppgtt_alloc_4lvl_pv(struct i915_address_space *vm,
+ u64 start, u64 length)

total: 0 errors, 0 warnings, 4 checks, 117 lines checked a10129739054 drm/i915/gvt: GVTg handle pvmmio_caps PVINFO register -:88: CHECK:LINE_SPACING: Please don't use multiple blank lines #88: FILE: drivers/gpu/drm/i915/gvt/vgpu.c:66:

+

total: 0 errors, 0 warnings, 1 checks, 62 lines checked
94f6273822da drm/i915/gvt: GVTg handle shared_page setup
-:36: CHECK:BOOL_MEMBER: Avoid using bool structure members because of possible alignment issues - see: https://lkml.org/lkml/2017/11/21/384
#36: FILE: drivers/gpu/drm/i915/gvt/gvt.h:239:
+ bool shared_page_enabled;

-:46: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #46: FILE: drivers/gpu/drm/i915/gvt/gvt.h:699:
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len);

-:88: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #88: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1235:
+static int handle_shared_page_gpa(struct intel_vgpu *vgpu,
+ unsigned int offset, unsigned int data)

-:150: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #150: FILE: drivers/gpu/drm/i915/gvt/vgpu.c:598:
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len)

total: 0 errors, 0 warnings, 4 checks, 119 lines checked 19f7d5f0f66d drm/i915/gvt: GVTg support context submission pvmmio optimization -:35: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'vgpu' - possible side-effects? #35: FILE: drivers/gpu/drm/i915/gvt/gvt.h:58:
+#define VGPU_PVMMIO(vgpu, level) \
+ ((vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) & level) \
+ && vgpu->shared_page_enabled)

-:35: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'level' may be better as '(level)' to avoid precedence issues #35: FILE: drivers/gpu/drm/i915/gvt/gvt.h:58:
+#define VGPU_PVMMIO(vgpu, level) \
+ ((vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) & level) \
+ && vgpu->shared_page_enabled)

-:37: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #37: FILE: drivers/gpu/drm/i915/gvt/gvt.h:60:
+ ((vgpu_vreg_t(vgpu, vgtif_reg(pvmmio_caps)) & level) \
+ && vgpu->shared_page_enabled)

-:71: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #71: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1204:
+ if (intel_gvt_read_shared_page(vgpu, elsp_data_off, &elsp_data,
+ 16 * I915_NUM_ENGINES))

total: 0 errors, 0 warnings, 4 checks, 81 lines checked c3aa9b70d559 drm/i915/gvt: GVTg support ppgtt pvmmio optimization -:86: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #86: FILE: drivers/gpu/drm/i915/gvt/gtt.c:1810:
+ gvt_vgpu_err("fail to create ppgtt for pdp 0x%llx\n",
+ px_dma(&mm->ppgtt->pml4));

-:116: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #116: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2820:
+int intel_vgpu_g2v_pv_ppgtt_alloc_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[])

-:141: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #141: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2845:
+int intel_vgpu_g2v_pv_ppgtt_clear_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[])

-:169: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'end' - possible side-effects? #169: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2873:
+#define pml4_addr_end(addr, end) \
+({ unsigned long __boundary = \
+ ((addr) + GEN8_PML4E_SIZE) & GEN8_PML4E_SIZE_MASK; \
+ (__boundary < (end)) ? __boundary : (end); \
+})

-:175: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'end' - possible side-effects? #175: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2879:
+#define pdp_addr_end(addr, end) \
+({ unsigned long __boundary = \
+ ((addr) + GEN8_PDPE_SIZE) & GEN8_PDPE_SIZE_MASK; \
+ (__boundary < (end)) ? __boundary : (end); \
+})

-:181: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'end' - possible side-effects? #181: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2885:
+#define pd_addr_end(addr, end) \
+({ unsigned long __boundary = \
+ ((addr) + GEN8_PDE_SIZE) & GEN8_PDE_SIZE_MASK; \
+ (__boundary < (end)) ? __boundary : (end); \
+})

-:194: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #194: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2898:
+static int walk_pt_range(struct intel_vgpu *vgpu, u64 pt,
+ u64 start, u64 end, struct ppgtt_walk *walk)

-:207: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #207: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2911:
+ ret = intel_gvt_hypervisor_read_gpa(vgpu,
+ (pt & PAGE_MASK) + (start_index << info->gtt_entry_size_shift),

-:228: CHECK:LINE_SPACING: Please don't use multiple blank lines #228: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2932:
+
+

-:230: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #230: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2934:
+static int walk_pd_range(struct intel_vgpu *vgpu, u64 pd,
+ u64 start, u64 end, struct ppgtt_walk *walk)

-:242: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #242: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2946:
+ ret = intel_gvt_hypervisor_read_gpa(vgpu,
+ (pd & PAGE_MASK) + (index <<

-:255: CHECK:LINE_SPACING: Please don't use multiple blank lines #255: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2959:
+
+

-:257: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #257: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2961:
+static int walk_pdp_range(struct intel_vgpu *vgpu, u64 pdp,
+ u64 start, u64 end, struct ppgtt_walk *walk)

-:269: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #269: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2973:
+ ret = intel_gvt_hypervisor_read_gpa(vgpu,
+ (pdp & PAGE_MASK) + (index <<

-:281: CHECK:LINE_SPACING: Please don't use multiple blank lines #281: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2985:
+
+

-:283: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #283: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2987:
+static int walk_pml4_range(struct intel_vgpu *vgpu, u64 pml4,
+ u64 start, u64 end, struct ppgtt_walk *walk)

-:294: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #294: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2998:
+ ret = intel_gvt_hypervisor_read_gpa(vgpu,
+ (pml4 & PAGE_MASK) + (index <<

-:307: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #307: FILE: drivers/gpu/drm/i915/gvt/gtt.c:3011:
+int intel_vgpu_g2v_pv_ppgtt_insert_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[])

-:341: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #341: FILE: drivers/gpu/drm/i915/gvt/gtt.c:3045:
+ walk.mfns = kmalloc_array(num_pages,
+ sizeof(unsigned long), GFP_KERNEL);

-:401: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #401: FILE: drivers/gpu/drm/i915/gvt/gtt.h:281:
+int intel_vgpu_g2v_pv_ppgtt_alloc_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[]);

-:404: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #404: FILE: drivers/gpu/drm/i915/gvt/gtt.h:284:
+int intel_vgpu_g2v_pv_ppgtt_clear_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[]);

-:407: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #407: FILE: drivers/gpu/drm/i915/gvt/gtt.h:287:
+int intel_vgpu_g2v_pv_ppgtt_insert_4lvl(struct intel_vgpu *vgpu,
+ u64 pdps[]);

total: 0 errors, 0 warnings, 22 checks, 388 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

✗ Fi.CI.SPARSE: warning for i915 pvmmio to improve GVTg performance

In reply to Xiaolin Zhang
== Series Details ==

== Series Details ==

Series: i915 pvmmio to improve GVTg performance
URL : https://patchwork.freedesktop.org/series/52410/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Sparse version: v0.5.2
Commit: drm/i915: introduced pv capability for vgpu
-drivers/gpu/drm/i915/selftests/../i915_drv.h:3714:16: warning: expression using sizeof(void)
+drivers/gpu/drm/i915/selftests/../i915_drv.h:3721:16: warning: expression using sizeof(void)

Commit: drm/i915: get ready of memory for pvmmio -drivers/gpu/drm/i915/selftests/../i915_drv.h:3721:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_drv.h:3723:16: warning: expression using sizeof(void)

Commit: drm/i915: context submission pvmmio optimization Okay!

Commit: drm/i915: ppgtt update pvmmio optimization Okay!

Commit: drm/i915/gvt: GVTg handle pvmmio_caps PVINFO register Okay!

Commit: drm/i915/gvt: GVTg handle shared_page setup Okay!

Commit: drm/i915/gvt: GVTg support context submission pvmmio optimization Okay!

Commit: drm/i915/gvt: GVTg support ppgtt pvmmio optimization +./include/linux/slab.h:665:13: error: undefined identifier '__builtin_mul_overflow' +./include/linux/slab.h:665:13: warning: call with no type!

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw
In reply to Xiaolin Zhang

Quoting Xiaolin Zhang (2018-11-13 08:35:12)

Quoted 3 lines

To improve GVTg performance, it could reduce the mmio access trap numbers within guest driver in some certain scenarios since mmio access trap will introuduce vm exit/vm enter cost.

This still looks merely like a proof-of-concept, and does not look like a complete proposal for a protocol to a shared micro-controller. Nor does it look like it will be extensible into such a protocol. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

✗ Fi.CI.BAT: failure for i915 pvmmio to improve GVTg performance

In reply to Xiaolin Zhang
== Series Details ==

== Series Details ==

Series: i915 pvmmio to improve GVTg performance
URL : https://patchwork.freedesktop.org/series/52410/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_5127 -> Patchwork_10811 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_10811 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_10811, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52410/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_10811:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_close_race@basic-threads:
      fi-bsw-n3050:       PASS -> INCOMPLETE

== Known issues ==

Here are the changes found in Patchwork_10811 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_contexts:
      fi-icl-u:           NOTRUN -> DMESG-FAIL (fdo#108569)

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191)

    igt@kms_pipe_crc_basic@read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     PASS -> INCOMPLETE (fdo#102657)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload-inject:
      fi-glk-dsi:         FAIL (fdo#108721) -> PASS +1

    igt@gem_exec_suspend@basic-s4-devices:
      fi-glk-dsi:         FAIL -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#107362) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-glk-dsi:         FAIL (fdo#103375) -> PASS +3
      fi-icl-u:           INCOMPLETE (fdo#107713) -> PASS

    igt@pm_rpm@module-reload:
      fi-glk-dsi:         INCOMPLETE (k.org#198133, fdo#103359) -> PASS +1

fdo#102657 https://bugs.freedesktop.org/show_bug.cgi?id=102657
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107713 https://bugs.freedesktop.org/show_bug.cgi?id=107713
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#108569 https://bugs.freedesktop.org/show_bug.cgi?id=108569
fdo#108721 https://bugs.freedesktop.org/show_bug.cgi?id=108721
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (51 -> 46) ==

Missing (5): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

== Build changes ==

* Linux: CI_DRM_5127 -> Patchwork_10811

CI_DRM_5127: 31b5aaa2364ba86baf1293c69c5dcab446ef3a0e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10811: c3aa9b70d559e5edb4923aec38ed8c85fcbf10ec @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

c3aa9b70d559 drm/i915/gvt: GVTg support ppgtt pvmmio optimization 19f7d5f0f66d drm/i915/gvt: GVTg support context submission pvmmio optimization 94f6273822da drm/i915/gvt: GVTg handle shared_page setup a10129739054 drm/i915/gvt: GVTg handle pvmmio_caps PVINFO register 2f13c56ed4a4 drm/i915: ppgtt update pvmmio optimization 544deaecea2e drm/i915: context submission pvmmio optimization 26121d00d625 drm/i915: get ready of memory for pvmmio 9c2f6b34b1d3 drm/i915: introduced pv capability for vgpu

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10811/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx