enhanced i915 vgpu with PV feature support
cover enhanced i915 vgpu with PV feature support
This is new i915 VGPU PV design based on the last year proposal [1].
This is a new series of patch set and discontiued the old series of patch set due to this new design.
To improve vgpu performance, it could implement some PV optimizations in different gpu resource domain to reduce the data access overhead or complexity modeling.
In this patch set, PPGTT and GGTT are identifed as PV optimization from VGPU memory resource point of view and workloa submisison is identifed as PV optimization from VGPU compute resource point of view. so 3 PV features (PV PPGTT, PV GGTT and PV submisison) are designed and implemented to support VGPU model better.
To provide the mechanism for PV feature development and implementation, A simple PV framework is implemented and consisted of 3 sub items:
a. PV capability: it indicateds what kind of PV capability provided by both guest system and host GVTg subsystem.
b. PV shared memory: this memory is allocated in guest and shared between guest and host for data exchange, PV command & PV data communication. c. PV command transport protocol: on top of PV shared memory, it defines the communication protocol & channel between guest and host to circulate PV command and PV command data.
for PV PPGTT, to improve efficiency and reduce the complexity of ppgtt support, vgpu ppgtt page table operations are implemented in pv fashion with pv version of bind/unbind for ppgtt vma ops. The pv version of ppgtt vma ops use the CTB protocol to communicate pv ppgtt command along with data struct pv_vma from guest to GVT and then GVT implement command handler of PV_CMD_BIND_PPGTT and PV_CMD_UBIND_PPGTT to achieve GVA->HPA address translation.
for PV GGTT, it is similar with PV PPGGT instead to use PV_CMD_BIND_GGTT and PV_CMD_UNBIND_GGTT pv command.
for PV workload submisison, a pv version of workload submission backend implemented with engine submission data in the shared memory and meanwhile eliminating execlists csb process and context switch interrupt in submisision routine to improve efficiency and reduce complexity.
Based on the experiment, small workloads such as glmark2 and Antutu 3D benchmark can get benefit for these PV featuers at least 10% performance gain. for large workload such as media and 3D, it get some benefit, but not much.
[1]: https://patchwork.kernel.org/cover/11148059/
Xiaolin Zhang (12):
drm/i915: introduced vgpu pv capability drm/i915: vgpu shared memory setup for pv support drm/i915: vgpu pv command buffer transport protocol drm/i915: vgpu ppgtt page table pv support drm/i915: vgpu ggtt page table pv support drm/i915: vgpu workload submisison pv support drm/i915/gvt: GVTg expose pv_caps PVINFO register drm/i915/gvt: GVTg handle guest shared_page setup drm/i915/gvt: GVTg support vgpu pv CTB protocol drm/i915/gvt: GVTg support ppgtt pv operations drm/i915/gvt: GVTg support ggtt pv operations drm/i915/gvt: GVTg support pv workload submssion
drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 4 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 + drivers/gpu/drm/i915/gvt/gtt.c | 255 ++++++++++++++ drivers/gpu/drm/i915/gvt/gtt.h | 4 + drivers/gpu/drm/i915/gvt/gvt.h | 17 +- drivers/gpu/drm/i915/gvt/handlers.c | 274 ++++++++++++++- drivers/gpu/drm/i915/gvt/vgpu.c | 47 +++ drivers/gpu/drm/i915/i915_debugfs.c | 3 + drivers/gpu/drm/i915/i915_drv.c | 2 + drivers/gpu/drm/i915/i915_drv.h | 5 +- drivers/gpu/drm/i915/i915_gem.c | 4 +- drivers/gpu/drm/i915/i915_pvinfo.h | 9 +- drivers/gpu/drm/i915/i915_vgpu.c | 533 ++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 122 +++++++ drivers/gpu/drm/i915/intel_pv_submission.c | 324 ++++++++++++++++++ 16 files changed, 1599 insertions(+), 8 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_pv_submission.c
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/12 drm/i915: introduced vgpu pv capability
to enable vgpu pv feature, pv capability is introduced for guest by new pv_caps member in struct i915_virtual_gpu and for host GVT by new pv_caps register in struct vgt_if.
both of them are used to control different pv feature support in each domain and the final pv caps runtime negotiated between guest and host.
it also adds VGT_CAPS_PV capability BIT useb by guest to query host GVTg whether support any PV feature or not.
--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++- drivers/gpu/drm/i915/i915_vgpu.c | 63 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 10 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -48,6 +48,7 @@#include "i915_trace.h" #include "intel_pm.h" #include "intel_sideband.h" +#include "i915_vgpu.h" static inline struct drm_i915_private *node_to_i915 (struct drm_info_node *node) {
@@ -60,6 +61,8 @@ static int i915_capabilities(struct seq_file *m, void *data)struct drm_printer p =drm_seq_file_printer (m);seq_printf (m,"pch: %d\n" ,INTEL_PCH_TYPE (i915)); +if (intel_vgpu_active (i915)) +seq_printf (m,"vgpu pv_caps: 0x%x\n" , i915->vgpu.pv_caps);intel_device_info_print_static (INTEL_INFO (i915), &p);intel_device_info_print_runtime (RUNTIME_INFO (i915), &p);
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -808,6 +808,7 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */ bool active;u32 caps; +u32 pv_caps; };struct intel_cdclk_config {
drivers/gpu/drm/i915/i915_pvinfo.h +4 -1
@@ -57,6 +57,7 @@ enum vgt_g2v_type {#define VGT_CAPS_FULL_PPGTT BIT(2)#define VGT_CAPS_HWSP_EMULATION BIT(3)#define VGT_CAPS_HUGE_GTT BIT(4) +#define VGT_CAPS_PV BIT(5)struct vgt_if {u64 magic;/* VGT_MAGIC */
@@ -109,7 +110,9 @@ struct vgt_if {u32 execlist_context_descriptor_lo;u32 execlist_context_descriptor_hi; -u32 rsv7[0x200 -24 ];/* pad to one page */ +u32 pv_caps; + +u32 rsv7[0x200 -25 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))
drivers/gpu/drm/i915/i915_vgpu.c +62 -1
78 lines not on this page · raw message
drivers/gpu/drm/i915/i915_vgpu.h +10 -0
@@ -29,6 +29,11 @@struct drm_i915_private ;struct i915_ggtt ; +/* define different PV capabilities */ +enum pv_caps { +PV_NONE =0 , +}; +void intel_vgpu_detect (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);
@@ -39,4 +44,9 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915);int intel_vgt_balloon (struct i915_ggtt *ggtt);void intel_vgt_deballoon (struct i915_ggtt *ggtt); +/* i915 vgpu pv related functions */ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area); +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data);#endif /* _I915_VGPU_H_ */
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v1 01/12] drm/i915: introduced vgpu pv capability
Quoted 32 lines · Xiaolin Zhang
to enable vgpu pv feature, pv capability is introduced for guest by new
pv_capsmember in structi915_virtual_gpuand for host GVT by newpv_capsregister in structvgt_if.both of them are used to control different pv feature support in each domain and the final pv caps runtime negotiated between guest and host.
it also adds
VGT_CAPS_PVcapability BIT useb by guest to query host GVTg whether support any PV feature or not.Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++- drivers/gpu/drm/i915/i915_vgpu.c | 63 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 10 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +1
-0@@ -48,6 +48,7 @@#include "i915_trace.h" #include "intel_pm.h" #include "intel_sideband.h" +#include "i915_vgpu.h" static inline struct drm_i915_private *node_to_i915 (struct drm_info_node *node) {
drivers/gpu/drm/i915/i915_debugfs.c static int i915_capabilities(struct seq_file *m, void *data) · line 65
Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0@@ -60,6 +61,8 @@ static int i915_capabilities(struct seq_file *m, void *data)struct drm_printer p =drm_seq_file_printer (m);seq_printf (m,"pch: %d\n" ,INTEL_PCH_TYPE (i915)); +if (intel_vgpu_active (i915)) +seq_printf (m,"vgpu pv_caps: 0x%x\n" , i915->vgpu.pv_caps);
I think the placement here over-emphasizes the importance of the caps. Maybe you also want to print something if vgpu isn't active?
Quoted 43 lines
drivers/gpu/drm/i915/i915_debugfs.c +0
-0intel_device_info_print_static (INTEL_INFO (i915), &p);intel_device_info_print_runtime (RUNTIME_INFO (i915), &p);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -808,6 +808,7 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */ bool active;u32 caps; +u32 pv_caps; };struct intel_cdclk_config {drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -57,6 +57,7 @@ enum vgt_g2v_type {#define VGT_CAPS_FULL_PPGTT BIT(2)#define VGT_CAPS_HWSP_EMULATION BIT(3)#define VGT_CAPS_HUGE_GTT BIT(4) +#define VGT_CAPS_PV BIT(5)struct vgt_if {u64 magic;/* VGT_MAGIC */ @@ -109,7 +110,9 @@ struct vgt_if {u32 execlist_context_descriptor_lo;u32 execlist_context_descriptor_hi; -u32 rsv7[0x200 -24 ];/* pad to one page */ +u32 pv_caps; + +u32 rsv7[0x200 -25 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +0
-0
drivers/gpu/drm/i915/i915_vgpu.c void intel_vgpu_detect(struct drm_i915_private *dev_priv) · line 104
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.c +4
-1@@ -98,7 +98,13 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv) dev_priv->vgpu.active = true;mutex_init (&dev_priv->vgpu.lock); -drm_info (&dev_priv->drm,"Virtual GPU for Intel GVT-g detected.\n" ); + +if (!intel_vgpu_detect_pv_caps (dev_priv, shared_area)) { +DRM_INFO ("Virtual GPU for Intel GVT-g detected.\n" ); + goto out;
Seems clearer without the goto. It's not like one is an error path, right?
drivers/gpu/drm/i915/i915_vgpu.c void intel_vgpu_detect(struct drm_i915_private *dev_priv) · line 107
Quoted 3 lines
drivers/gpu/drm/i915/i915_vgpu.c +3
-0+ } + +DRM_INFO ("Virtual GPU for Intel GVT-g detected with PV Optimized.\n" );
Please retain use of drm_info().
drivers/gpu/drm/i915/i915_vgpu.c bool intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv) · line 144
Quoted 9 lines
drivers/gpu/drm/i915/i915_vgpu.c +2
-0out:pci_iounmap (pdev, shared_area);@@ -134,6 +140,18 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv)return dev_priv->vgpu.caps &VGT_CAPS_HUGE_GTT ; } +static bool intel_vgpu_check_pv_cap (struct drm_i915_private *dev_priv, +enum pv_caps cap)
The indentation is off here, and all over the place, as reported by checkpatch. Please address them everywhere.
Quoted 26 lines
drivers/gpu/drm/i915/i915_vgpu.c +19
-0+{ +return (dev_priv->vgpu.active && (dev_priv->vgpu.caps &VGT_CAPS_PV ) + && (dev_priv->vgpu.pv_caps & cap)); +} + +static bool intel_vgpu_has_pv_caps (struct drm_i915_private *dev_priv) +{ +return dev_priv->vgpu.caps &VGT_CAPS_PV ; +} +struct _balloon_info_ {/* * There are up to 2 regions per mappable/unmappable graphic @@ -336,3 +354,46 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)drm_err (&dev_priv->drm,"VGT balloon fail\n" );return ret; } + +/* +* i915 vgpu PV support for Linux +*/ + +/* +* Config vgpu PV ops for different PV capabilities +*/ +void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 375
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +10
-0+ enum pv_caps cap, void *data) +{ + +if (!intel_vgpu_check_pv_cap (i915, cap)) +return ; +} + +/** +* intel_vgpu_detect_pv_caps - detect virtual GPU PV capabilities +* @dev_priv: i915 device private
If you use kernel-doc, please write proper kernel-doc comments. Again, please see the report sent to you by our CI.
Quoted 29 lines
drivers/gpu/drm/i915/i915_vgpu.c +24
-0+* +* This function is called at the initialization stage, to detect VGPU +* PV capabilities +*/ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +u32 gvt_pvcaps; +u32 pvcaps =0 ; + +if (!intel_vgpu_has_pv_caps (i915)) +return false; + +/* PV capability negotiation between PV guest and GVT */ + gvt_pvcaps =readl (shared_area +vgtif_offset (pv_caps)); + pvcaps = i915->vgpu.pv_caps & gvt_pvcaps; + i915->vgpu.pv_caps = pvcaps; +writel (pvcaps, shared_area +vgtif_offset (pv_caps)); + +if (!pvcaps) +return false; + +return true; +}drivers/gpu/drm/i915/i915_vgpu.h +0
-0
drivers/gpu/drm/i915/i915_vgpu.h line 32
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.h +1
-0@@ -29,6 +29,11 @@struct drm_i915_private ;struct i915_ggtt ; +/* define different PV capabilities */
The comment adds nothing.
drivers/gpu/drm/i915/i915_vgpu.h line 33
Quoted 1 line
drivers/gpu/drm/i915/i915_vgpu.h +1
-0+enum pv_caps {
Please prefix the type name and the enumerations with intel_ or something.
Quoted 16 lines
drivers/gpu/drm/i915/i915_vgpu.h +8
-0+ PV_NONE = 0, +}; +void intel_vgpu_detect (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);@@ -39,4 +44,9 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915);int intel_vgt_balloon (struct i915_ggtt *ggtt);void intel_vgt_deballoon (struct i915_ggtt *ggtt); +/* i915 vgpu pv related functions */ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area); +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data);#endif /* _I915_VGPU_H_ */
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v1 01/12] drm/i915: introduced vgpu pv capability
Quoted 42 lines · Jani Nikula
Quoted 41 lines · Xiaolin Zhang
to enable vgpu pv feature, pv capability is introduced for guest by new
pv_capsmember in structi915_virtual_gpuand for host GVT by newpv_capsregister in structvgt_if.both of them are used to control different pv feature support in each
domain and the final pv caps runtime negotiated between guest and host.it also adds
VGT_CAPS_PVcapability BIT useb by guest to query host GVTg
whether support any PV feature or not.Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++- drivers/gpu/drm/i915/i915_vgpu.c | 63 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 10 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +1
-0@@ -48,6 +48,7 @@#include "i915_trace.h" #include "intel_pm.h" #include "intel_sideband.h" +#include "i915_vgpu.h" static inline struct drm_i915_private *node_to_i915 (struct drm_info_node *node){
drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -60,6 +61,8 @@ static int i915_capabilities(struct seq_file *m, void *data)struct drm_printer p =drm_seq_file_printer (m);
Quoted 7 lines
drivers/gpu/drm/i915/i915_debugfs.c static int i915_capabilities(struct seq_file *m, void *data)
Quoted 4 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0seq_printf (m,"pch: %d\n" ,INTEL_PCH_TYPE (i915)); +if (intel_vgpu_active (i915)) +seq_printf (m,"vgpu pv_caps: 0x%x\n" , i915- >vgpu.pv_caps);I think the placement here over-emphasizes the importance of the caps. Maybe you also want to print something if vgpu isn't active?
thanks comment. will consider how to print this.
Quoted 181 lines
Quoted 48 lines
drivers/gpu/drm/i915/i915_debugfs.c +0
-0intel_device_info_print_static (INTEL_INFO (i915), &p);drivers/gpu/drm/i915/i915_debugfs.c +0
-0intel_device_info_print_runtime (RUNTIME_INFO (i915), &p);drivers/gpu/drm/i915/i915_drv.h +0
-0@@ -808,6 +808,7 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */
drivers/gpu/drm/i915/i915_drv.h +1
-0bool active;u32 caps; +u32 pv_caps; };struct intel_cdclk_config {drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -57,6 +57,7 @@ enum vgt_g2v_type {#define VGT_CAPS_FULL_PPGTT BIT(2)#define VGT_CAPS_HWSP_EMULATION BIT(3)#define VGT_CAPS_HUGE_GTT BIT(4) +#define VGT_CAPS_PV BIT(5)struct vgt_if {u64 magic;/* VGT_MAGIC */ @@ -109,7 +110,9 @@ struct vgt_if {u32 execlist_context_descriptor_lo;u32 execlist_context_descriptor_hi; -u32 rsv7[0x200 -24 ];/* pad to one page */ +u32 pv_caps; + +u32 rsv7[0x200 -25 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +0
-0drivers/gpu/drm/i915/i915_vgpu.c void intel_vgpu_detect(struct drm_i915_private · line 106
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +4
-1@@ -98,7 +98,13 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv) dev_priv->vgpu.active = true; mutex_init(&dev_priv->vgpu.lock); - drm_info(&dev_priv->drm, "Virtual GPU for Intel GVT-g detected.\n"); + +if (!intel_vgpu_detect_pv_caps (dev_priv, shared_area)) { +DRM_INFO ("Virtual GPU for Intel GVT-g detected.\n" ); + goto out;Seems clearer without the goto. It's not like one is an error path, right?
drivers/gpu/drm/i915/i915_vgpu.c void intel_vgpu_detect(struct drm_i915_private *dev_priv)
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.c +3
-0+ } + + DRM_INFO("Virtual GPU for Intel GVT-g detected with PV Optimized.\n");Please retain use of
drm_info().drivers/gpu/drm/i915/i915_vgpu.c bool intel_vgpu_has_huge_gtt(struct · line 146
Quoted 11 lines
out:
drivers/gpu/drm/i915/i915_vgpu.c +2
-0pci_iounmap (pdev, shared_area);@@ -134,6 +140,18 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv)return dev_priv->vgpu.caps &VGT_CAPS_HUGE_GTT ; } +static bool intel_vgpu_check_pv_cap (struct drm_i915_private *dev_priv, +enum pv_caps cap)The indentation is off here, and all over the place, as reported by checkpatch. Please address them everywhere.
Quoted 28 lines
drivers/gpu/drm/i915/i915_vgpu.c +6
-0+{ +return (dev_priv->vgpu.active && (dev_priv->vgpu.caps &VGT_CAPS_PV ) + && (dev_priv->vgpu.pv_caps & cap)); +} + +static bool intel_vgpu_has_pv_caps(struct drm_i915_private
*dev_priv)drivers/gpu/drm/i915/i915_vgpu.c +13
-0+{ +return dev_priv->vgpu.caps &VGT_CAPS_PV ; +} +struct _balloon_info_ {/* * There are up to 2 regions per mappable/unmappable graphic @@ -336,3 +354,46 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)drm_err (&dev_priv->drm,"VGT balloon fail\n" );return ret; } + +/* +* i915 vgpu PV support for Linux +*/ + +/* +* Config vgpu PV ops for different PV capabilities +*/ +void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 375
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +10
-0+ enum pv_caps cap, void *data) +{ + +if (!intel_vgpu_check_pv_cap (i915, cap)) +return ; +} + +/** +* intel_vgpu_detect_pv_caps - detect virtual GPU PV capabilities +* @dev_priv: i915 device private If you use kernel-doc, please write proper kernel-doc comments. Again,
please see the report sent to you by our CI.Quoted 31 lines
drivers/gpu/drm/i915/i915_vgpu.c +2
-0+* +* This function is called at the initialization stage, to detect VGPU
+ * PV capabilities
+ */drivers/gpu/drm/i915/i915_vgpu.c +20
-0+bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +u32 gvt_pvcaps; +u32 pvcaps =0 ; + +if (!intel_vgpu_has_pv_caps (i915)) +return false; + +/* PV capability negotiation between PV guest and GVT */ + gvt_pvcaps =readl (shared_area +vgtif_offset (pv_caps)); + pvcaps = i915->vgpu.pv_caps & gvt_pvcaps; + i915->vgpu.pv_caps = pvcaps; +writel (pvcaps, shared_area +vgtif_offset (pv_caps)); + +if (!pvcaps) +return false; + +return true; +}drivers/gpu/drm/i915/i915_vgpu.h +0
-0drivers/gpu/drm/i915/i915_vgpu.h line 32
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.h +1
-0@@ -29,6 +29,11 @@struct drm_i915_private ;struct i915_ggtt ; +/* define different PV capabilities */ The comment adds nothing.
drivers/gpu/drm/i915/i915_vgpu.h line 33
Quoted 1 line
drivers/gpu/drm/i915/i915_vgpu.h +1
-0+enum pv_caps {Please prefix the type name and the enumerations with
intel_or something.Quoted 11 lines
drivers/gpu/drm/i915/i915_vgpu.h +3
-0+ PV_NONE = 0, +}; +void intel_vgpu_detect (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);@@ -39,4 +44,9 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915);int intel_vgt_balloon (struct i915_ggtt *ggtt);void intel_vgt_deballoon (struct i915_ggtt *ggtt);
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/i915_vgpu.h +5
-0+/* i915 vgpu pv related functions */ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area); +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data);#endif /* _I915_VGPU_H_ */
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v1 01/12] drm/i915: introduced vgpu pv capability
In reply to Xiaolin ZhangQuoted 24 lines · Xiaolin Zhang
to enable vgpu pv feature, pv capability is introduced for guest by new
pv_capsmember in structi915_virtual_gpuand for host GVT by newpv_capsregister in structvgt_if.both of them are used to control different pv feature support in each domain and the final pv caps runtime negotiated between guest and host.
it also adds
VGT_CAPS_PVcapability BIT useb by guest to query host GVTg whether support any PV feature or not.Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++- drivers/gpu/drm/i915/i915_vgpu.c | 63 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 10 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0
drivers/gpu/drm/i915/i915_debugfs.c line 51
Quoted 4 lines
drivers/gpu/drm/i915/i915_debugfs.c +1
-0@@ -48,6 +48,7 @@#include "i915_trace.h" #include "intel_pm.h" #include "intel_sideband.h" +#include "i915_vgpu.h"
Please keep includes sorted.
Quoted 158 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0static inline struct drm_i915_private *node_to_i915 (struct drm_info_node *node) {@@ -60,6 +61,8 @@ static int i915_capabilities(struct seq_file *m, void *data)struct drm_printer p =drm_seq_file_printer (m);seq_printf (m,"pch: %d\n" ,INTEL_PCH_TYPE (i915)); +if (intel_vgpu_active (i915)) +seq_printf (m,"vgpu pv_caps: 0x%x\n" , i915->vgpu.pv_caps);intel_device_info_print_static (INTEL_INFO (i915), &p);intel_device_info_print_runtime (RUNTIME_INFO (i915), &p);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -808,6 +808,7 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */ bool active;u32 caps; +u32 pv_caps; };struct intel_cdclk_config {drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -57,6 +57,7 @@ enum vgt_g2v_type {#define VGT_CAPS_FULL_PPGTT BIT(2)#define VGT_CAPS_HWSP_EMULATION BIT(3)#define VGT_CAPS_HUGE_GTT BIT(4) +#define VGT_CAPS_PV BIT(5)struct vgt_if {u64 magic;/* VGT_MAGIC */ @@ -109,7 +110,9 @@ struct vgt_if {u32 execlist_context_descriptor_lo;u32 execlist_context_descriptor_hi; -u32 rsv7[0x200 -24 ];/* pad to one page */ +u32 pv_caps; + +u32 rsv7[0x200 -25 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +62
-1@@ -98,7 +98,13 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv) dev_priv->vgpu.active = true;mutex_init (&dev_priv->vgpu.lock); -drm_info (&dev_priv->drm,"Virtual GPU for Intel GVT-g detected.\n" ); + +if (!intel_vgpu_detect_pv_caps (dev_priv, shared_area)) { +DRM_INFO ("Virtual GPU for Intel GVT-g detected.\n" ); + goto out; + } + +DRM_INFO ("Virtual GPU for Intel GVT-g detected with PV Optimized.\n" ); out:pci_iounmap (pdev, shared_area);@@ -134,6 +140,18 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv)return dev_priv->vgpu.caps &VGT_CAPS_HUGE_GTT ; } +static bool intel_vgpu_check_pv_cap (struct drm_i915_private *dev_priv, +enum pv_caps cap) +{ +return (dev_priv->vgpu.active && (dev_priv->vgpu.caps &VGT_CAPS_PV ) + && (dev_priv->vgpu.pv_caps & cap)); +} + +static bool intel_vgpu_has_pv_caps (struct drm_i915_private *dev_priv) +{ +return dev_priv->vgpu.caps &VGT_CAPS_PV ; +} +struct _balloon_info_ {/* * There are up to 2 regions per mappable/unmappable graphic @@ -336,3 +354,46 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)drm_err (&dev_priv->drm,"VGT balloon fail\n" );return ret; } + +/* +* i915 vgpu PV support for Linux +*/ + +/* +* Config vgpu PV ops for different PV capabilities +*/ +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data) +{ + +if (!intel_vgpu_check_pv_cap (i915, cap)) +return ; +} + +/** +* intel_vgpu_detect_pv_caps - detect virtual GPU PV capabilities +* @dev_priv: i915 device private +* +* This function is called at the initialization stage, to detect VGPU +* PV capabilities +*/ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +u32 gvt_pvcaps; +u32 pvcaps =0 ; + +if (!intel_vgpu_has_pv_caps (i915)) +return false; + +/* PV capability negotiation between PV guest and GVT */ + gvt_pvcaps =readl (shared_area +vgtif_offset (pv_caps)); + pvcaps = i915->vgpu.pv_caps & gvt_pvcaps; + i915->vgpu.pv_caps = pvcaps; +writel (pvcaps, shared_area +vgtif_offset (pv_caps)); + +if (!pvcaps) +return false; + +return true; +}drivers/gpu/drm/i915/i915_vgpu.h +10
-0@@ -29,6 +29,11 @@struct drm_i915_private ;struct i915_ggtt ; +/* define different PV capabilities */ +enum pv_caps { +PV_NONE =0 , +}; +void intel_vgpu_detect (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);@@ -39,4 +44,9 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915);int intel_vgt_balloon (struct i915_ggtt *ggtt);void intel_vgt_deballoon (struct i915_ggtt *ggtt); +/* i915 vgpu pv related functions */ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area); +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data);#endif /* _I915_VGPU_H_ */
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v1 01/12] drm/i915: introduced vgpu pv capability
Quoted 24 lines · Jani Nikula
Quoted 23 lines · Xiaolin Zhang
to enable vgpu pv feature, pv capability is introduced for guest by new
pv_capsmember in structi915_virtual_gpuand for host GVT by newpv_capsregister in structvgt_if.both of them are used to control different pv feature support in each
domain and the final pv caps runtime negotiated between guest and host.it also adds
VGT_CAPS_PVcapability BIT useb by guest to query host GVTg
whether support any PV feature or not.Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 3 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++- drivers/gpu/drm/i915/i915_vgpu.c | 63 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 10 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-)
Quoted 12 lines
drivers/gpu/drm/i915/i915_debugfs.c line 51
Quoted 10 lines
drivers/gpu/drm/i915/i915_debugfs.c +1
-0@@ -48,6 +48,7 @@#include "i915_trace.h" #include "intel_pm.h" #include "intel_sideband.h" +#include "i915_vgpu.h" Please keep includes sorted.
Sure. thanks for review.
Quoted 170 lines
Quoted 170 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0static inline struct drm_i915_private *node_to_i915 (struct drm_info_node *node) {@@ -60,6 +61,8 @@ static int i915_capabilities(struct seq_file *m, void *data)struct drm_printer p =drm_seq_file_printer (m);seq_printf (m,"pch: %d\n" ,INTEL_PCH_TYPE (i915)); +if (intel_vgpu_active (i915)) +seq_printf (m,"vgpu pv_caps: 0x%x\n" , i915- >vgpu.pv_caps);drivers/gpu/drm/i915/i915_debugfs.c +0
-0intel_device_info_print_static (INTEL_INFO (i915), &p);intel_device_info_print_runtime (RUNTIME_INFO (i915), &p);drivers/gpu/drm/i915/i915_drv.h +0
-0@@ -808,6 +808,7 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */
drivers/gpu/drm/i915/i915_drv.h +1
-0bool active;u32 caps; +u32 pv_caps; };struct intel_cdclk_config {drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -57,6 +57,7 @@ enum vgt_g2v_type {#define VGT_CAPS_FULL_PPGTT BIT(2)#define VGT_CAPS_HWSP_EMULATION BIT(3)#define VGT_CAPS_HUGE_GTT BIT(4) +#define VGT_CAPS_PV BIT(5)struct vgt_if {u64 magic;/* VGT_MAGIC */ @@ -109,7 +110,9 @@ struct vgt_if {u32 execlist_context_descriptor_lo;u32 execlist_context_descriptor_hi; -u32 rsv7[0x200 -24 ];/* pad to one page */ +u32 pv_caps; + +u32 rsv7[0x200 -25 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +7
-1@@ -98,7 +98,13 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv) dev_priv->vgpu.active = true; mutex_init(&dev_priv->vgpu.lock); - drm_info(&dev_priv->drm, "Virtual GPU for Intel GVT-g detected.\n"); + +if (!intel_vgpu_detect_pv_caps (dev_priv, shared_area)) { +DRM_INFO ("Virtual GPU for Intel GVT-g detected.\n" ); + goto out; + } + + DRM_INFO("Virtual GPU for Intel GVT-g detected with PV Optimized.\n");out:
drivers/gpu/drm/i915/i915_vgpu.c +8
-0pci_iounmap (pdev, shared_area);@@ -134,6 +140,18 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv)return dev_priv->vgpu.caps &VGT_CAPS_HUGE_GTT ; } +static bool intel_vgpu_check_pv_cap (struct drm_i915_private *dev_priv, +enum pv_caps cap) +{ +return (dev_priv->vgpu.active && (dev_priv->vgpu.caps &VGT_CAPS_PV ) + && (dev_priv->vgpu.pv_caps & cap)); +} + +static bool intel_vgpu_has_pv_caps(struct drm_i915_private
*dev_priv)drivers/gpu/drm/i915/i915_vgpu.c +25
-0+{ +return dev_priv->vgpu.caps &VGT_CAPS_PV ; +} +struct _balloon_info_ {/* * There are up to 2 regions per mappable/unmappable graphic @@ -336,3 +354,46 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)drm_err (&dev_priv->drm,"VGT balloon fail\n" );return ret; } + +/* +* i915 vgpu PV support for Linux +*/ + +/* +* Config vgpu PV ops for different PV capabilities +*/ +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data) +{ + +if (!intel_vgpu_check_pv_cap (i915, cap)) +return ; +} + +/** +* intel_vgpu_detect_pv_caps - detect virtual GPU PV capabilities +* @dev_priv: i915 device private +* +* This function is called at the initialization stage, to detect VGPU
+ * PV capabilities
+ */drivers/gpu/drm/i915/i915_vgpu.c +20
-0+bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +u32 gvt_pvcaps; +u32 pvcaps =0 ; + +if (!intel_vgpu_has_pv_caps (i915)) +return false; + +/* PV capability negotiation between PV guest and GVT */ + gvt_pvcaps =readl (shared_area +vgtif_offset (pv_caps)); + pvcaps = i915->vgpu.pv_caps & gvt_pvcaps; + i915->vgpu.pv_caps = pvcaps; +writel (pvcaps, shared_area +vgtif_offset (pv_caps)); + +if (!pvcaps) +return false; + +return true; +}drivers/gpu/drm/i915/i915_vgpu.h +5
-0@@ -29,6 +29,11 @@struct drm_i915_private ;struct i915_ggtt ; +/* define different PV capabilities */ +enum pv_caps { +PV_NONE =0 , +}; +void intel_vgpu_detect (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);@@ -39,4 +44,9 @@ bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915);int intel_vgt_balloon (struct i915_ggtt *ggtt);void intel_vgt_deballoon (struct i915_ggtt *ggtt);
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/i915_vgpu.h +5
-0+/* i915 vgpu pv related functions */ +bool intel_vgpu_detect_pv_caps (struct drm_i915_private *i915, +void __iomem *shared_area); +void intel_vgpu_config_pv_caps (struct drm_i915_private *i915, +enum pv_caps cap,void *data);#endif /* _I915_VGPU_H_ */
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/12 drm/i915: vgpu shared memory setup for pv support
In reply to Xiaolin ZhangTo support vgpu pv features, a common shared memory is setup used for communication and data exchange between guest and host GVTg to reduce data access overhead and trap cost.
guest i915 will allocate this common memory (1 page size) and then pass it's physical address to host GVTg through PVINFO register so that host GVTg can access this shared guest page meory without trap cost with hyperviser's facility.
guest i915 will send VGT_G2V_SHARED_PAGE_SETUP notification to host GVTg once shared memory setup succcessfully finished.
the layout of the shared_page also defined as well, the first part is the PV vervsion information used for compabilty support.
--- drivers/gpu/drm/i915/i915_drv.c | 2 + drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/i915_pvinfo.h | 5 +- drivers/gpu/drm/i915/i915_vgpu.c | 94 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_vgpu.h | 14 ++++++ 5 files changed, 117 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -1071,6 +1071,8 @@ static void i915_driver_release(struct drm_device *dev)disable_rpm_wakeref_asserts (rpm); +intel_vgpu_destroy (dev_priv); +i915_gem_driver_release (dev_priv);intel_memory_regions_driver_release (dev_priv);
drivers/gpu/drm/i915/i915_drv.h +3 -1
@@ -809,7 +809,9 @@ struct i915_virtual_gpu {bool active;u32 caps;u32 pv_caps; -}; + +struct i915_virtual_gpu_pv *pv; +} __packed;struct intel_cdclk_config {unsigned int cdclk, vco, ref, bypass;
drivers/gpu/drm/i915/i915_pvinfo.h +4 -1
@@ -48,6 +48,7 @@ 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_REGISTER , VGT_G2V_MAX, };
@@ -112,7 +113,9 @@ struct vgt_if {u32 pv_caps; -u32 rsv7[0x200 -25 ];/* pad to one page */ +u64 shared_page_gpa; + +u32 rsv7[0x200 -27 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))
drivers/gpu/drm/i915/i915_vgpu.c +94 -0
111 lines not on this page · raw message
drivers/gpu/drm/i915/i915_vgpu.h +14 -0
@@ -29,12 +29,26 @@struct drm_i915_private ;struct i915_ggtt ; +#define PV_MAJOR 0 +#define PV_MINOR 1 +/* define different PV capabilities */ enum pv_caps {PV_NONE =0 , }; +/* A common shared page(4KB) between GVTg and vgpu allocated by guest */ +struct gvt_shared_page { +u16 ver_major; +u16 ver_minor; +}; + +struct i915_virtual_gpu_pv { +struct gvt_shared_page *shared_page; +}; +void intel_vgpu_detect (struct drm_i915_private *i915); +void intel_vgpu_destroy (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);bool intel_vgpu_has_full_ppgtt (struct drm_i915_private *i915);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v1 02/12] drm/i915: vgpu shared memory setup for pv support
Quoted 42 lines · Xiaolin Zhang
To support vgpu pv features, a common shared memory is setup used for communication and data exchange between guest and host GVTg to reduce data access overhead and trap cost.
guest i915 will allocate this common memory (1 page size) and then pass it's physical address to host GVTg through PVINFO register so that host GVTg can access this shared guest page meory without trap cost with hyperviser's facility.
guest i915 will send
VGT_G2V_SHARED_PAGE_SETUPnotification to host GVTg once shared memory setup succcessfully finished.the layout of the
shared_pagealso defined as well, the first part is the PV vervsion information used for compabilty support.Signed-off-by Xiaolin Zhang <[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 | 5 +- drivers/gpu/drm/i915/i915_vgpu.c | 94 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_vgpu.h | 14 ++++++ 5 files changed, 117 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_drv.c +2
-0@@ -1071,6 +1071,8 @@ static void i915_driver_release(struct drm_device *dev)disable_rpm_wakeref_asserts (rpm); +intel_vgpu_destroy (dev_priv); +i915_gem_driver_release (dev_priv);intel_memory_regions_driver_release (dev_priv);drivers/gpu/drm/i915/i915_drv.h +0
-0
drivers/gpu/drm/i915/i915_drv.h struct i915_virtual_gpu { · line 814
Quoted 7 lines
drivers/gpu/drm/i915/i915_drv.h +3
-1@@ -809,7 +809,9 @@ struct i915_virtual_gpu {bool active;u32 caps;u32 pv_caps; -}; + +struct i915_virtual_gpu_pv *pv; +} __packed;
I'm unsure why this struct should be packed.
Quoted 110 lines
drivers/gpu/drm/i915/i915_drv.h +0
-0struct intel_cdclk_config {unsigned int cdclk, vco, ref, bypass;drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -48,6 +48,7 @@ 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_REGISTER , VGT_G2V_MAX, };@@ -112,7 +113,9 @@ struct vgt_if {u32 pv_caps; -u32 rsv7[0x200 -25 ];/* pad to one page */ +u64 shared_page_gpa; + +u32 rsv7[0x200 -27 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +69
-0@@ -110,6 +110,17 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv)pci_iounmap (pdev, shared_area); } +void intel_vgpu_destroy (struct drm_i915_private *i915) +{ +struct i915_virtual_gpu_pv *pv = i915->vgpu.pv; + +if (!intel_vgpu_active (i915) || !pv) +return ; + +__free_page (virt_to_page (pv->shared_page)); +kfree (pv); +} +void intel_vgpu_register (struct drm_i915_private *i915) {/* @@ -360,6 +371,83 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)*/ /* +* shared_page setup for VGPU PV features +*/ +static int intel_vgpu_setup_shared_page (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +void __iomem *addr; +struct i915_virtual_gpu_pv *pv; +struct gvt_shared_page *base; +u64 gpa; +u16 ver_maj, ver_min; +int ret =0 ; + +/* We allocate 1 page shared between guest and GVT for data exchange. +* _______________________________ +* |version | +* |_______________________________PAGE/8 +* | | +* |_______________________________PAGE/4 +* | | +* | | +* | | +* |_______________________________PAGE/2 +* | | +* | | +* | | +* | | +* | | +* | | +* | | +* |_______________________________| +* +* 0 offset: PV version area +*/ + + base = (struct gvt_shared_page *)get_zeroed_page (GFP_KERNEL ); +if (!base) { +dev_info (i915->drm.dev,"out of memory for shared memory\n" ); +return -ENOMEM ; + } + +/* pass guest memory pa address to GVT and then read back to verify */ + gpa =__pa (base); + addr = shared_area +vgtif_offset (shared_page_gpa); +writeq (gpa, addr); +if (gpa !=readq (addr)) { +dev_info (i915->drm.dev,"passed shared_page_gpa failed\n" ); + ret = -EIO ; + goto err; + } + + addr = shared_area +vgtif_offset (g2v_notify); +writel (VGT_G2V_SHARED_PAGE_REGISTER , addr); + + ver_maj = base->ver_major; + ver_min = base->ver_minor; +if (ver_maj !=PV_MAJOR || ver_min !=PV_MINOR ) { +dev_info (i915->drm.dev,"VGPU PV version incompatible\n" ); + ret = -EIO ;
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 441
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +10
-0+ goto err; + } + + pv =kzalloc (sizeof (struct i915_virtual_gpu_pv ),GFP_KERNEL ); +if (!pv) { + ret = -ENOMEM ; + goto err; + } + +DRM_INFO ("vgpu PV ver major %d and minor %d\n" , ver_maj, ver_min);
Please use drm_info(), and please polish the message for info level. This looks like debug to me.
Quoted 32 lines
drivers/gpu/drm/i915/i915_vgpu.c +15
-0+ i915->vgpu.pv = pv; + pv->shared_page = base; +return ret; +err: +__free_page (virt_to_page (base)); +return ret; +} + +/* * Config vgpu PV ops for different PV capabilities */ void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,@@ -395,5 +483,11 @@ bool intel_vgpu_detect_pv_caps(struct drm_i915_private *i915,if (!pvcaps)return false; +if (intel_vgpu_setup_shared_page (i915, shared_area)) { + i915->vgpu.pv_caps =0 ; +writel (0 , shared_area +vgtif_offset (pv_caps)); +return false; + } +return true; }drivers/gpu/drm/i915/i915_vgpu.h +0
-0@@ -29,12 +29,26 @@struct drm_i915_private ;struct i915_ggtt ;
drivers/gpu/drm/i915/i915_vgpu.h line 41
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.h +5
-0+#define PV_MAJOR 0 +#define PV_MINOR 1 +/* define different PV capabilities */ enum pv_caps {PV_NONE =0 , }; +/* A common shared page(4KB) between GVTg and vgpu allocated by guest */ +struct gvt_shared_page {
Prefix with intel_?
drivers/gpu/drm/i915/i915_vgpu.h line 46
Quoted 5 lines
drivers/gpu/drm/i915/i915_vgpu.h +5
-0+u16 ver_major; +u16 ver_minor; +}; + +struct i915_virtual_gpu_pv {
Why i915_virtual_gpu instead of intel_vgpu like everywhere else?
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.h +4
-0+struct gvt_shared_page *shared_page; +}; +void intel_vgpu_detect (struct drm_i915_private *i915); +void intel_vgpu_destroy (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);bool intel_vgpu_has_full_ppgtt (struct drm_i915_private *i915);
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v1 02/12] drm/i915: vgpu shared memory setup for pv support
Quoted 46 lines · Jani Nikula
Quoted 45 lines · Xiaolin Zhang
To support vgpu pv features, a common shared memory is setup used for
communication and data exchange between guest and host GVTg to reduce
data access overhead and trap cost.guest i915 will allocate this common memory (1 page size) and then pass
it's physical address to host GVTg through PVINFO register so that host
GVTg can access this shared guest page meory without trap cost with hyperviser's facility.guest i915 will send
VGT_G2V_SHARED_PAGE_SETUPnotification to host GVTg
once shared memory setup succcessfully finished.the layout of the
shared_pagealso defined as well, the first part is the
PV vervsion information used for compabilty support.Signed-off-by Xiaolin Zhang <[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 | 5 +- drivers/gpu/drm/i915/i915_vgpu.c | 94 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_vgpu.h | 14 ++++++ 5 files changed, 117 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_drv.c +2
-0@@ -1071,6 +1071,8 @@ static void i915_driver_release(struct drm_device *dev)disable_rpm_wakeref_asserts (rpm ); +intel_vgpu_destroy (dev_priv); +i915_gem_driver_release (dev_priv);
Quoted 16 lines
Quoted 7 lines
drivers/gpu/drm/i915/i915_drv.c +0
-0intel_memory_regions_driver_release (dev_priv);drivers/gpu/drm/i915/i915_drv.h +0
-0drivers/gpu/drm/i915/i915_drv.h struct i915_virtual_gpu { · line 814
Quoted 7 lines
drivers/gpu/drm/i915/i915_drv.h +3
-1@@ -809,7 +809,9 @@ struct i915_virtual_gpu {bool active;u32 caps;u32 pv_caps; -}; + +struct i915_virtual_gpu_pv *pv; +} __packed;I'm unsure why this struct should be packed.
Thanks your point it out. it is not necessary. will remove this next version.
Quoted 191 lines
Quoted 130 lines
drivers/gpu/drm/i915/i915_drv.h +0
-0struct intel_cdclk_config {unsigned int cdclk, vco, ref, bypass;drivers/gpu/drm/i915/i915_pvinfo.h +4
-1@@ -48,6 +48,7 @@ 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_REGISTER , VGT_G2V_MAX, };@@ -112,7 +113,9 @@ struct vgt_if {u32 pv_caps; -u32 rsv7[0x200 -25 ];/* pad to one page */ +u64 shared_page_gpa; + +u32 rsv7[0x200 -27 ];/* pad to one page */ } __packed;#define vgtif_offset (x) (offsetof(struct vgt_if, x))drivers/gpu/drm/i915/i915_vgpu.c +11
-0@@ -110,6 +110,17 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv)pci_iounmap (pdev, shared_area); } +void intel_vgpu_destroy (struct drm_i915_private *i915) +{ +struct i915_virtual_gpu_pv *pv = i915->vgpu.pv; + +if (!intel_vgpu_active (i915) || !pv) +return ; + +__free_page (virt_to_page (pv->shared_page)); +kfree (pv); +} +void intel_vgpu_register (struct drm_i915_private *i915) {drivers/gpu/drm/i915/i915_vgpu.c +13
-0/* @@ -360,6 +371,83 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)*/ /* +* shared_page setup for VGPU PV features +*/ +static int intel_vgpu_setup_shared_page (struct drm_i915_private *i915, +void __iomem *shared_area) +{ +void __iomem *addr; +struct i915_virtual_gpu_pv *pv; +struct gvt_shared_page *base; +u64 gpa; +u16 ver_maj, ver_min; +int ret =0 ; + +/* We allocate 1 page shared between guest and GVT for data exchange.
drivers/gpu/drm/i915/i915_vgpu.c +24
-0+* _______________________________ +* |version | +* |_______________________________PAGE/8 +* | | +* |_______________________________PAGE/4 +* | | +* | | +* | | +* |_______________________________PAGE/2 +* | | +* | | +* | | +* | | +* | | +* | | +* | | +* |_______________________________| +* +* 0 offset: PV version area +*/ + + base = (struct gvt_shared_page *)get_zeroed_page (GFP_KERNEL ); +if (!base) { + dev_info(i915->drm.dev, "out of memory for sharedmemory\n");
drivers/gpu/drm/i915/i915_vgpu.c +4
-0+return -ENOMEM ; + } + +/* pass guest memory pa address to GVT and then read back to verify */
drivers/gpu/drm/i915/i915_vgpu.c +5
-0+ gpa =__pa (base); + addr = shared_area +vgtif_offset (shared_page_gpa); +writeq (gpa, addr); +if (gpa !=readq (addr)) { + dev_info(i915->drm.dev, "passed shared_page_gpafailed\n");
drivers/gpu/drm/i915/i915_vgpu.c +11
-0+ ret = -EIO ; + goto err; + } + + addr = shared_area +vgtif_offset (g2v_notify); +writel (VGT_G2V_SHARED_PAGE_REGISTER , addr); + + ver_maj = base->ver_major; + ver_min = base->ver_minor; +if (ver_maj !=PV_MAJOR || ver_min !=PV_MINOR ) { + dev_info(i915->drm.dev, "VGPU PV versionincompatible\n");
drivers/gpu/drm/i915/i915_vgpu.c +11
-0+ ret = -EIO ; + goto err; + } + + pv =kzalloc (sizeof (struct i915_virtual_gpu_pv ),GFP_KERNEL ); +if (!pv) { + ret = -ENOMEM ; + goto err; + } + + DRM_INFO("vgpu PV ver major %d and minor %d\n", ver_maj,Quoted 1 line
ver_min);Please use
drm_info(), and please polish the message for info level. This looks like debug to me.Quoted 43 lines
drivers/gpu/drm/i915/i915_vgpu.c +15
-0+ i915->vgpu.pv = pv; + pv->shared_page = base; +return ret; +err: +__free_page (virt_to_page (base)); +return ret; +} + +/* * Config vgpu PV ops for different PV capabilities */ void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,@@ -395,5 +483,11 @@ bool intel_vgpu_detect_pv_caps(struct drm_i915_private *i915, if (!pvcaps)return false; +if (intel_vgpu_setup_shared_page (i915, shared_area)) { + i915->vgpu.pv_caps =0 ; +writel (0 , shared_area +vgtif_offset (pv_caps)); +return false; + } +return true;}
drivers/gpu/drm/i915/i915_vgpu.h +4
-0@@ -29,12 +29,26 @@struct drm_i915_private ;struct i915_ggtt ; +#define PV_MAJOR 0 +#define PV_MINOR 1 +/* define different PV capabilities */ enum pv_caps {PV_NONE =0 , }; +/* A common shared page(4KB) between GVTg and vgpu allocated by Quoted 2 lines
guest */
+structgvt_shared_page{Prefix with
intel_?drivers/gpu/drm/i915/i915_vgpu.h line 46
Quoted 5 lines
drivers/gpu/drm/i915/i915_vgpu.h +5
-0+u16 ver_major; +u16 ver_minor; +}; + +struct i915_virtual_gpu_pv {Why
i915_virtual_gpuinstead ofintel_vgpulike everywhere else?
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.h line 54
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.h +4
-0+struct gvt_shared_page *shared_page; +}; +void intel_vgpu_detect (struct drm_i915_private *i915); +void intel_vgpu_destroy (struct drm_i915_private *i915);bool intel_vgpu_active (struct drm_i915_private *i915);void intel_vgpu_register (struct drm_i915_private *i915);bool intel_vgpu_has_full_ppgtt (struct drm_i915_private *i915);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/12 drm/i915: vgpu pv command buffer transport protocol
In reply to Xiaolin Zhangbased on the common shared memory, vgpu pv command transport buffer (CTB) protocol is implemented which is a simple pv command buffer ring with pv command descriptor used to perform guest-2-gvt single direction commucation between guest and host GVTg.
with this CTB, guest can send PV command with PV data to host to perform PV commands in host side.
--- drivers/gpu/drm/i915/i915_pvinfo.h | 1 + drivers/gpu/drm/i915/i915_vgpu.c | 195 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 53 ++++++++++ 3 files changed, 247 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_pvinfo.h +1 -0
@@ -49,6 +49,7 @@ enum vgt_g2v_type {VGT_G2V_EXECLIST_CONTEXT_CREATE ,VGT_G2V_EXECLIST_CONTEXT_DESTROY ,VGT_G2V_SHARED_PAGE_REGISTER , +VGT_G2V_PV_SEND_TRIGGER , VGT_G2V_MAX, };
drivers/gpu/drm/i915/i915_vgpu.c +193 -2
225 lines not on this page · raw message
drivers/gpu/drm/i915/i915_vgpu.h +53 -0
67 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v1 03/12] drm/i915: vgpu pv command buffer transport protocol
Quoted 54 lines · Xiaolin Zhang
based on the common shared memory, vgpu pv command transport buffer (CTB) protocol is implemented which is a simple pv command buffer ring with pv command descriptor used to perform guest-2-gvt single direction commucation between guest and host GVTg.
with this CTB, guest can send PV command with PV data to host to perform PV commands in host side.
Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_pvinfo.h | 1 + drivers/gpu/drm/i915/i915_vgpu.c | 195 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 53 ++++++++++ 3 files changed, 247 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_pvinfo.h +1
-0@@ -49,6 +49,7 @@ enum vgt_g2v_type {VGT_G2V_EXECLIST_CONTEXT_CREATE ,VGT_G2V_EXECLIST_CONTEXT_DESTROY ,VGT_G2V_SHARED_PAGE_REGISTER , +VGT_G2V_PV_SEND_TRIGGER , VGT_G2V_MAX, };drivers/gpu/drm/i915/i915_vgpu.c +19
-0@@ -370,6 +370,183 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)* i915 vgpu PV support for Linux */ +/** +* wait_for_desc_update - Wait for the command buffer descriptor update. +* @desc: buffer descriptor +* @fence: response fence +* @status: placeholder for status +* +* GVTg will update command buffer descriptor with new fence and status +* after processing the command identified by the fence. Wait for +* specified fence and then read from the descriptor status of the +* command. +* +* Return: +* * 0 response received (status is valid) +* * -ETIMEDOUT no response within hardcoded timeout +*/ +static int wait_for_desc_update (struct vgpu_pv_ct_buffer_desc *desc, +u32 fence,u32 *status) +{ +int err;
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 401
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +10
-0+ +#define done (READ_ONCE(desc->fence) == fence) + err =wait_for_us (done,5 ); +if (err) + err =wait_for (done,10 ); +#undef done + +if (unlikely (err)) { +DRM_ERROR ("CT: fence %u failed; reported fence=%u\n" , + fence, desc->fence);
drm_err() please.
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 404
Quoted 3 lines
drivers/gpu/drm/i915/i915_vgpu.c +3
-0+ } + + *status = desc->status;
Please have a blank line before the return. Recommended throughout the series.
Quoted 124 lines
drivers/gpu/drm/i915/i915_vgpu.c +124
-0+return err; +} + +/** +* CTB Guest to GVT request +* +* Format of the CTB Guest to GVT request message is as follows:: +* +* +------------+---------+---------+---------+---------+ +* | msg[0] | [1] | [2] | ... | [n-1] | +* +------------+---------+---------+---------+---------+ +* | MESSAGE | MESSAGE PAYLOAD | +* + HEADER +---------+---------+---------+---------+ +* | | 0 | 1 | ... | n | +* +============+=========+=========+=========+=========+ +* | len >= 1 | FENCE | request specific data | +* +------+-----+---------+---------+---------+---------+ +* +* ^-----------------len-------------------^ +*/ +static int pv_command_buffer_write (struct i915_virtual_gpu_pv *pv, +const u32 *action,u32 len/* in dwords */ ,u32 fence) +{ +struct vgpu_pv_ct_buffer_desc *desc = pv->ctb.desc; +u32 head = desc->head /4 ;/* in dwords */ +u32 tail = desc->tail /4 ;/* in dwords */ +u32 size = desc->size /4 ;/* in dwords */ +u32 used;/* in dwords */ +u32 header; +u32 *cmds = pv->ctb.cmds; +unsigned int i; + +GEM_BUG_ON (desc->size %4 ); +GEM_BUG_ON (desc->head %4 ); +GEM_BUG_ON (desc->tail %4 ); +GEM_BUG_ON (tail >= size); + +/* tail == head condition indicates empty */ +if (tail < head) + used = (size - head) + tail; +else + used = tail - head; + +/* make sure there is a space including extra dw for the fence */ +if (unlikely (used + len +1 >= size)) +return -ENOSPC ; + +/* +* Write the message. The format is the following: +* DW0: header (including action code) +* DW1: fence +* DW2+: action data +*/ + header = (len <<PV_CT_MSG_LEN_SHIFT ) | + (PV_CT_MSG_WRITE_FENCE_TO_DESC ) | + (action[0 ] <<PV_CT_MSG_ACTION_SHIFT ); + + cmds[tail] = header; + tail = (tail +1 ) % size; + + cmds[tail] = fence; + tail = (tail +1 ) % size; + +for (i =1 ; i < len; i++) { + cmds[tail] = action[i]; + tail = (tail +1 ) % size; + } + +/* now update desc tail (back in bytes) */ + desc->tail = tail *4 ; +GEM_BUG_ON (desc->tail > desc->size); + +return 0 ; +} + +static u32 pv_get_next_fence (struct i915_virtual_gpu_pv *pv) +{ +/* For now it's trivial */ +return ++pv->next_fence; +} + +static int pv_send (struct drm_i915_private *i915, +const u32 *action,u32 len,u32 *status) +{ +struct i915_virtual_gpu *vgpu = &i915->vgpu; +struct i915_virtual_gpu_pv *pv = vgpu->pv; + +struct vgpu_pv_ct_buffer_desc *desc = pv->ctb.desc; + +u32 fence; +int err; + +GEM_BUG_ON (!len); +GEM_BUG_ON (len & ~PV_CT_MSG_LEN_MASK ); + + fence =pv_get_next_fence (pv); + err =pv_command_buffer_write (pv, action, len, fence); +if (unlikely (err)) + goto unlink; + + i915->vgpu.pv->notify (i915); + + err =wait_for_desc_update (desc, fence, status); +if (unlikely (err)) + goto unlink; + +if ((*status)) { + err = -EIO ; + goto unlink; + } + + err = (*status); +unlink: +return err; +} + +static int intel_vgpu_pv_send_command_buffer (struct drm_i915_private *i915, +u32 *action,u32 len) +{ +struct i915_virtual_gpu *vgpu = &i915->vgpu; +unsigned long flags; + +u32 status = ~0 ;/* undefined */ +int ret;
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 538
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +10
-0+ +spin_lock_irqsave (&vgpu->pv->lock, flags); + + ret =pv_send (i915, action, len, &status); +if (unlikely (ret <0 )) { +DRM_ERROR ("PV: send action %#X failed; err=%d status=%#X\n" , + action[0 ], ret, status); + }else if (unlikely (ret)) { +DRM_ERROR ("PV: send action %#x returned %d (%#x)\n" , + action[0 ], ret, ret);
drm_err() please.
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 547
Quoted 9 lines
drivers/gpu/drm/i915/i915_vgpu.c +9
-0+ } + +spin_unlock_irqrestore (&vgpu->pv->lock, flags); +return ret; +} + +static void intel_vgpu_pv_notify_mmio (struct drm_i915_private *dev_priv) +{ +I915_WRITE (vgtif_reg (g2v_notify),VGT_G2V_PV_SEND_TRIGGER );
Please do not add any more I915_WRITE() uses. intel_uncore_write() please.
Quoted 98 lines
drivers/gpu/drm/i915/i915_vgpu.c +18
-2+} +/* * shared_page setup for VGPU PV features */ @@ -385,7 +562,7 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,/* We allocate 1 page shared between guest and GVT for data exchange. * _______________________________ -* |version | +* |version|PV_DESCs(SEND) | * |_______________________________PAGE/8 * | | * |_______________________________PAGE/4 @@ -393,7 +570,7 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,* | | * | | * |_______________________________PAGE/2 -* | | +* |PV_CMDs(SEND) | * | | * | | * | | @@ -403,6 +580,8 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,* |_______________________________| * * 0 offset: PV version area +* PAGE/4 offset: PV command buffer command descriptor area +* PAGE/2 offset: PV command buffer command data area */ base = (struct gvt_shared_page *)get_zeroed_page (GFP_KERNEL );@@ -441,6 +620,18 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,DRM_INFO ("vgpu PV ver major %d and minor %d\n" , ver_maj, ver_min); i915->vgpu.pv = pv; pv->shared_page = base; + +/* setup PV command buffer ptr */ + pv->ctb.cmds = (void *)base +PV_CMD_OFF ; + pv->ctb.desc = (void *)base +PV_DESC_OFF ; + pv->ctb.desc->size =PAGE_SIZE /2 ; + pv->ctb.desc->addr =PV_CMD_OFF ; + +/* setup PV command buffer callback */ + pv->send = intel_vgpu_pv_send_command_buffer; + pv->notify = intel_vgpu_pv_notify_mmio; +spin_lock_init (&pv->lock); +return ret; err:__free_page (virt_to_page (base));drivers/gpu/drm/i915/i915_vgpu.h +32
-0@@ -31,6 +31,8 @@ struct i915_ggtt;#define PV_MAJOR 0#define PV_MINOR 1 +#define PV_DESC_OFF (PAGE_SIZE/256) +#define PV_CMD_OFF (PAGE_SIZE/2)/* define different PV capabilities */ enum pv_caps {@@ -43,8 +45,59 @@ struct gvt_shared_page {u16 ver_minor; }; +/* +* Definition of the command transport message header (DW0) +* +* bit[0..4] message len (in dwords) +* bit[5..7] reserved +* bit[8..8] write fence to desc +* bit[9..15] reserved +* bit[16..31] action code +*/ +#define PV_CT_MSG_LEN_SHIFT 0 +#define PV_CT_MSG_LEN_MASK 0x1F +#define PV_CT_MSG_WRITE_FENCE_TO_DESC (1 << 8) +#define PV_CT_MSG_ACTION_SHIFT 16 +#define PV_CT_MSG_ACTION_MASK 0xFFFF + +/* PV command transport buffer descriptor */ +struct vgpu_pv_ct_buffer_desc { +u32 addr;/* gpa address */ +u32 size;/* size in bytes */ +u32 head;/* offset updated by GVT */ +u32 tail;/* offset updated by owner */ + +u32 fence;/* fence updated by GVT */ +u32 status;/* status updated by GVT */ +} __packed; + +/** PV single command transport buffer. +* +* A single command transport buffer consists of two parts, the header +* record (command transport buffer descriptor) and the actual buffer which
drivers/gpu/drm/i915/i915_vgpu.h struct gvt_shared_page { · line 87
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.h +10
-0+* holds the commands. +* +* @desc: pointer to the buffer descriptor +* @cmds: pointer to the commands buffer +*/ +struct vgpu_pv_ct_buffer { +struct vgpu_pv_ct_buffer_desc *desc; +u32 *cmds; +}; +
Again, another name prefix that is not in line with the rest of the file or driver.
Quoted 16 lines
drivers/gpu/drm/i915/i915_vgpu.h +11
-0struct i915_virtual_gpu_pv {struct gvt_shared_page *shared_page; + +/* PV command buffer support */ +struct vgpu_pv_ct_buffer ctb; +u32 next_fence; + +/* To serialize the vgpu PV send actions */ +spinlock_t lock; + +/* VGPU's PV specific send function */ +int (*send)(struct drm_i915_private *dev_priv,u32 *data,u32 len); +void (*notify)(struct drm_i915_private *dev_priv); };void intel_vgpu_detect (struct drm_i915_private *i915);
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v1 03/12] drm/i915: vgpu pv command buffer transport protocol
Quoted 69 lines · Jani Nikula
Quoted 68 lines · Xiaolin Zhang
based on the common shared memory, vgpu pv command transport buffer (CTB)
protocol is implemented which is a simple pv command buffer ring with pv
command descriptor used to perform guest-2-gvt single direction commucation
between guest and host GVTg.with this CTB, guest can send PV command with PV data to host to perform PV
commands in host side.Signed-off-by Xiaolin Zhang <[email protected]>--- drivers/gpu/drm/i915/i915_pvinfo.h | 1 + drivers/gpu/drm/i915/i915_vgpu.c | 195 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 53 ++++++++++ 3 files changed, 247 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_pvinfo.h +1
-0@@ -49,6 +49,7 @@ enum vgt_g2v_type {VGT_G2V_EXECLIST_CONTEXT_CREATE ,VGT_G2V_EXECLIST_CONTEXT_DESTROY ,VGT_G2V_SHARED_PAGE_REGISTER , +VGT_G2V_PV_SEND_TRIGGER , VGT_G2V_MAX, };drivers/gpu/drm/i915/i915_vgpu.c +2
-0@@ -370,6 +370,183 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)* i915 vgpu PV support for Linux */ +/** +* wait_for_desc_update - Wait for the command buffer descriptor update.
+ * @desc: buffer descriptor
+ * @fence: response fence
+ * @status: placeholder for status
+ *
+ * GVTg will update command buffer descriptor with new fence and status
+ * after processing the command identified by the fence. Wait for
+ * specified fence and then read from the descriptor status of the
+ * command.
+ *
+ * Return:
+ * * 0 response received (status is valid)
+ * *-ETIMEDOUTno response within hardcoded timeout
+ */
+static int wait_for_desc_update(structvgpu_pv_ct_buffer_desc*desc,drivers/gpu/drm/i915/i915_vgpu.c +7
-0+ u32 fence, u32 *status) +{ + int err; + +#define done (READ_ONCE(desc->fence) == fence) + err =wait_for_us (done,5 ); +if (err)
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 401
Quoted 6 lines
drivers/gpu/drm/i915/i915_vgpu.c +6
-0+ err =wait_for (done,10 ); +#undef done + +if (unlikely (err)) { +DRM_ERROR ("CT: fence %u failed; reported fence=%u\n" , + fence, desc->fence);
drm_err()please.
Sure. will change all the similar code. thanks.
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 404
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.c +3
-0+ } + + *status = desc->status;Please have a blank line before the return. Recommended throughout the
series.
Sure, will do it in whole series. thanks.
Quoted 141 lines
Quoted 134 lines
drivers/gpu/drm/i915/i915_vgpu.c +44
-0+return err; +} + +/** +* CTB Guest to GVT request +* +* Format of the CTB Guest to GVT request message is as follows:: +* +* +------------+---------+---------+---------+---------+ +* | msg[0] | [1] | [2] | ... | [n-1] | +* +------------+---------+---------+---------+---------+ +* | MESSAGE | MESSAGE PAYLOAD | +* + HEADER +---------+---------+---------+---------+ +* | | 0 | 1 | ... | n | +* +============+=========+=========+=========+=========+ +* | len >= 1 | FENCE | request specific data | +* +------+-----+---------+---------+---------+---------+ +* +* ^-----------------len-------------------^ +*/ +static int pv_command_buffer_write (struct i915_virtual_gpu_pv *pv, +const u32 *action,u32 len/* in dwords */ ,u32 fence) +{ +struct vgpu_pv_ct_buffer_desc *desc = pv->ctb.desc; +u32 head = desc->head /4 ;/* in dwords */ +u32 tail = desc->tail /4 ;/* in dwords */ +u32 size = desc->size /4 ;/* in dwords */ +u32 used;/* in dwords */ +u32 header; +u32 *cmds = pv->ctb.cmds; +unsigned int i; + +GEM_BUG_ON (desc->size %4 ); +GEM_BUG_ON (desc->head %4 ); +GEM_BUG_ON (desc->tail %4 ); +GEM_BUG_ON (tail >= size); + +/* tail == head condition indicates empty */ +if (tail < head) + used = (size - head) + tail; +else + used = tail - head; + +/* make sure there is a space including extra dw for the fence */
drivers/gpu/drm/i915/i915_vgpu.c +73
-0+if (unlikely (used + len +1 >= size)) +return -ENOSPC ; + +/* +* Write the message. The format is the following: +* DW0: header (including action code) +* DW1: fence +* DW2+: action data +*/ + header = (len <<PV_CT_MSG_LEN_SHIFT ) | + (PV_CT_MSG_WRITE_FENCE_TO_DESC ) | + (action[0 ] <<PV_CT_MSG_ACTION_SHIFT ); + + cmds[tail] = header; + tail = (tail +1 ) % size; + + cmds[tail] = fence; + tail = (tail +1 ) % size; + +for (i =1 ; i < len; i++) { + cmds[tail] = action[i]; + tail = (tail +1 ) % size; + } + +/* now update desc tail (back in bytes) */ + desc->tail = tail *4 ; +GEM_BUG_ON (desc->tail > desc->size); + +return 0 ; +} + +static u32 pv_get_next_fence (struct i915_virtual_gpu_pv *pv) +{ +/* For now it's trivial */ +return ++pv->next_fence; +} + +static int pv_send (struct drm_i915_private *i915, +const u32 *action,u32 len,u32 *status) +{ +struct i915_virtual_gpu *vgpu = &i915->vgpu; +struct i915_virtual_gpu_pv *pv = vgpu->pv; + +struct vgpu_pv_ct_buffer_desc *desc = pv->ctb.desc; + +u32 fence; +int err; + +GEM_BUG_ON (!len); +GEM_BUG_ON (len & ~PV_CT_MSG_LEN_MASK ); + + fence =pv_get_next_fence (pv); + err =pv_command_buffer_write (pv, action, len, fence); +if (unlikely (err)) + goto unlink; + + i915->vgpu.pv->notify (i915); + + err =wait_for_desc_update (desc, fence, status); +if (unlikely (err)) + goto unlink; + +if ((*status)) { + err = -EIO ; + goto unlink; + } + + err = (*status); +unlink: +return err; +} + +static int intel_vgpu_pv_send_command_buffer(struct
drm_i915_private*i915,drivers/gpu/drm/i915/i915_vgpu.c +13
-0+ u32 *action, u32 len) +{ +struct i915_virtual_gpu *vgpu = &i915->vgpu; +unsigned long flags; + +u32 status = ~0 ;/* undefined */ +int ret; + +spin_lock_irqsave (&vgpu->pv->lock, flags); + + ret =pv_send (i915, action, len, &status); +if (unlikely (ret <0 )) { + DRM_ERROR("PV: send action %#X failed; err=%dstatus=%#X\n",
drivers/gpu/drm/i915/i915_vgpu.c int intel_vgt_balloon(struct i915_ggtt *ggtt) · line 538
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.c +4
-0+ action[0], ret, status); + }else if (unlikely (ret)) { +DRM_ERROR ("PV: send action %#x returned %d (%#x)\n" , + action[0 ], ret, ret);
drm_err()please.
Quoted 13 lines
drivers/gpu/drm/i915/i915_vgpu.c
Quoted 10 lines
drivers/gpu/drm/i915/i915_vgpu.c +7
-0+ } + +spin_unlock_irqrestore (&vgpu->pv->lock, flags); +return ret; +} + +static void intel_vgpu_pv_notify_mmio(struct drm_i915_private
*dev_priv)drivers/gpu/drm/i915/i915_vgpu.c +2
-0+{ +I915_WRITE (vgtif_reg (g2v_notify),VGT_G2V_PV_SEND_TRIGGER );Please do not add any more
I915_WRITE()uses.intel_uncore_write()please.
Sure. NP.
Quoted 114 lines
Quoted 114 lines
drivers/gpu/drm/i915/i915_vgpu.c +2
-0+} +/* * shared_page setup for VGPU PV features */ @@ -385,7 +562,7 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,/* We allocate 1 page shared between guest and GVT for data exchange.
drivers/gpu/drm/i915/i915_vgpu.c +2
-2* _______________________________ -* |version | +* |version|PV_DESCs(SEND) | * |_______________________________PAGE/8 * | | * |_______________________________PAGE/4 @@ -393,7 +570,7 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915, * | | * | | * |_______________________________PAGE/2 - * | | + * |PV_CMDs(SEND) | * | | * | |drivers/gpu/drm/i915/i915_vgpu.c +2
-0* | | @@ -403,6 +580,8 @@ static int intel_vgpu_setup_shared_page(structdrm_i915_private *i915, * |_______________________________| * * 0 offset: PV version area +* PAGE/4 offset: PV command buffer command descriptor area +* PAGE/2 offset: PV command buffer command data area */ drivers/gpu/drm/i915/i915_vgpu.c +12
-0base = (struct gvt_shared_page *)get_zeroed_page (GFP_KERNEL );@@ -441,6 +620,18 @@ static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,DRM_INFO ("vgpu PV ver major %d and minor %d\n" , ver_maj, ver_min); i915->vgpu.pv = pv; pv->shared_page = base; + +/* setup PV command buffer ptr */ + pv->ctb.cmds = (void *)base +PV_CMD_OFF ; + pv->ctb.desc = (void *)base +PV_DESC_OFF ; + pv->ctb.desc->size =PAGE_SIZE /2 ; + pv->ctb.desc->addr =PV_CMD_OFF ; + +/* setup PV command buffer callback */ + pv->send = intel_vgpu_pv_send_command_buffer; + pv->notify = intel_vgpu_pv_notify_mmio; +spin_lock_init (&pv->lock); +return ret;err:
drivers/gpu/drm/i915/i915_vgpu.c +0
-0__free_page (virt_to_page (base));drivers/gpu/drm/i915/i915_vgpu.h +31
-0@@ -31,6 +31,8 @@ struct i915_ggtt;#define PV_MAJOR 0#define PV_MINOR 1 +#define PV_DESC_OFF (PAGE_SIZE/256) +#define PV_CMD_OFF (PAGE_SIZE/2)/* define different PV capabilities */ enum pv_caps {@@ -43,8 +45,59 @@ struct gvt_shared_page {u16 ver_minor; }; +/* +* Definition of the command transport message header (DW0) +* +* bit[0..4] message len (in dwords) +* bit[5..7] reserved +* bit[8..8] write fence to desc +* bit[9..15] reserved +* bit[16..31] action code +*/ +#define PV_CT_MSG_LEN_SHIFT 0 +#define PV_CT_MSG_LEN_MASK 0x1F +#define PV_CT_MSG_WRITE_FENCE_TO_DESC (1 << 8) +#define PV_CT_MSG_ACTION_SHIFT 16 +#define PV_CT_MSG_ACTION_MASK 0xFFFF + +/* PV command transport buffer descriptor */ +struct vgpu_pv_ct_buffer_desc { +u32 addr;/* gpa address */ +u32 size;/* size in bytes */ +u32 head;/* offset updated by GVT */ +u32 tail;/* offset updated by owner */ + +u32 fence;/* fence updated by GVT */ +u32 status;/* status updated by GVT */ +} __packed; + +/** PV single command transport buffer. +* +* A single command transport buffer consists of two parts, the header
+ * record (command transport buffer descriptor) and the actual buffer which
+ * holds the commands.
+ *
+ * @desc: pointer to the buffer descriptor
+ * @cmds: pointer to the commands buffer
+ */
+structvgpu_pv_ct_buffer{
Quoted 8 lines
drivers/gpu/drm/i915/i915_vgpu.h struct gvt_shared_page { · line 87
Quoted 4 lines
drivers/gpu/drm/i915/i915_vgpu.h +4
-0+struct vgpu_pv_ct_buffer_desc *desc; +u32 *cmds; +}; +Again, another name prefix that is not in line with the rest of the file
or driver.
Sure. will fix the name prefix and use consistant name prefix.
Quoted 17 lines
Quoted 17 lines
struct
i915_virtual_gpu_pv{drivers/gpu/drm/i915/i915_vgpu.h +10
-0struct gvt_shared_page *shared_page; + +/* PV command buffer support */ +struct vgpu_pv_ct_buffer ctb; +u32 next_fence; + +/* To serialize the vgpu PV send actions */ +spinlock_t lock; + +/* VGPU's PV specific send function */ + int (*send)(struct drm_i915_private *dev_priv, u32 *data, u32len);
drivers/gpu/drm/i915/i915_vgpu.h +1
-0+void (*notify)(struct drm_i915_private *dev_priv); };
Quoted 1 line
Quoted 1 line
void
intel_vgpu_detect(struct drm_i915_private *i915);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/12 drm/i915: vgpu ppgtt page table pv support
In reply to Xiaolin Zhangto improve efficiency and reduce the complexsity of vgpu ppgtt support, vgpu ppgtt page table operations are implemented in pv fashion and implemented pv version of bind/unbind for ppgtt vma ops.
The pv version of ppgtt vma ops use the CTB protocol to communicate pv ppgtt command along with data struct pv_vma from guest to GVT and then GVT will implement command handler of PV_CMD_BIND_PPGTT and PV_CMD_UBIND_PPGTT to support vgpu PPGTT feature.
new PV_PPGTT pv_cap is used to control this level of pv support in both guest and host side.
--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 4 +- drivers/gpu/drm/i915/i915_vgpu.c | 95 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_vgpu.h | 17 +++++++ 3 files changed, 115 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +3 -1
@@ -729,8 +729,10 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt) ppgtt->vm.pte_encode = gen8_pte_encode; -if (intel_vgpu_active (gt->i915)) +if (intel_vgpu_active (gt->i915)) { +intel_vgpu_config_pv_caps (gt->i915,PV_PPGTT , ppgtt);gen8_ppgtt_notify_vgt (ppgtt, true); + } ppgtt->vm.cleanup = gen8_ppgtt_cleanup;
drivers/gpu/drm/i915/i915_vgpu.c +95 -0
116 lines not on this page · raw message
drivers/gpu/drm/i915/i915_vgpu.h +17 -0
@@ -37,6 +37,14 @@ struct i915_ggtt;/* define different PV capabilities */ enum pv_caps {PV_NONE =0 , +PV_PPGTT =BIT (0 ), +}; + +/* vgpu PV commands */ +enum intel_vgpu_pv_cmd { +PV_CMD_DEFAULT =0x0 , +PV_CMD_BIND_PPGTT , +PV_CMD_UNBIND_PPGTT , };/* A common shared page(4KB) between GVTg and vgpu allocated by guest */
@@ -45,6 +53,15 @@ struct gvt_shared_page {u16 ver_minor; }; +/* PV virtual memory address for GGTT/PPGTT */ +struct pv_vma { +u32 size;/* num of pages */ +u32 flags;/* bind or unbind flags */ +u64 start;/* start of virtual address */ +u64 dma_addrs;/* BO's dma address list */ +u64 pml4;/* ppgtt handler */ +} __packed; +/* * Definition of the command transport message header (DW0) *
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/12 drm/i915: vgpu ggtt page table pv support
In reply to Xiaolin Zhangto improve efficiency and reduce the complexsity of vgpu ggtt support, vgpu ggtt page table operations are implemented in pv fashion and implemented pv version of bind/unbind for ggtt vma ops.
The pv version of ggtt vma ops use the CTB protocol to communicate pv ggtt command along with data struct pv_vma from guest to GVT and then GVT will implement command handler of PV_CMD_BIND_GGTT and PV_CMD_UBIND_gGTT to support vgpu GGTT feature.
new PV_GGTT pv_cap is used to control this level of pv support in both guest and host side.
--- drivers/gpu/drm/i915/i915_gem.c | 4 +++- drivers/gpu/drm/i915/i915_vgpu.c | 37 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 3 +++ 3 files changed, 42 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +3 -1
@@ -1129,9 +1129,11 @@ 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)) {mkwrite_device_info (dev_priv)->page_sizes =I915_GTT_PAGE_SIZE_4K ; +intel_vgpu_config_pv_caps (dev_priv,PV_GGTT , &dev_priv->ggtt); + } ret =i915_gem_init_userptr (dev_priv);if (ret)
drivers/gpu/drm/i915/i915_vgpu.c +36 -1
@@ -100,7 +100,7 @@ void intel_vgpu_detect(struct drm_i915_private *dev_priv)mutex_init (&dev_priv->vgpu.lock);/* guest driver PV capability */ - dev_priv->vgpu.pv_caps =PV_PPGTT ; + dev_priv->vgpu.pv_caps =PV_PPGTT |PV_GGTT ;if (!intel_vgpu_detect_pv_caps (dev_priv, shared_area)) {DRM_INFO ("Virtual GPU for Intel GVT-g detected.\n" );
@@ -458,6 +458,34 @@ static void ppgtt_unbind_vma_pv(struct i915_address_space *vm,vgpu_pv_vma_action (vm, vma,PV_CMD_UNBIND_PPGTT ,0 ,0 ); } +static void ggtt_bind_vma_pv (struct i915_address_space *vm, +struct i915_vm_pt_stash *stash, +struct i915_vma *vma, +enum i915_cache_level cache_level, +u32 flags) +{ +struct drm_i915_gem_object *obj = vma->obj; +u32 pte_flags; + +if (i915_vma_is_bound (vma, ~flags &I915_VMA_BIND_MASK )) +return ; + +/* Applicable to VLV (gen8+ do not support RO in the GGTT) */ + pte_flags =0 ; +if (i915_gem_object_is_readonly (obj)) + pte_flags |=PTE_READ_ONLY ; + + pte_flags = vma->vm->pte_encode (0 , cache_level,0 ); +vgpu_pv_vma_action (vm, vma,PV_CMD_BIND_GGTT ,0 , pte_flags); + vma->page_sizes.gtt =I915_GTT_PAGE_SIZE ; +} + +static void ggtt_unbind_vma_pv_nop (struct i915_address_space *vm, +struct i915_vma *vma) +{ + +} +/** * wait_for_desc_update - Wait for the command buffer descriptor update. * @desc: buffer descriptor
@@ -733,6 +761,7 @@ void intel_vgpu_config_pv_caps(struct drm_i915_private *i915, enum pv_caps cap, void *data) { struct i915_ppgtt *ppgtt; +struct i915_ggtt *ggtt;if (!intel_vgpu_check_pv_cap (i915, cap))return ;
@@ -742,6 +771,12 @@ void intel_vgpu_config_pv_caps(struct drm_i915_private *i915, ppgtt->vm.vma_ops.bind_vma = ppgtt_bind_vma_pv; ppgtt->vm.vma_ops.unbind_vma = ppgtt_unbind_vma_pv; } + +if (cap ==PV_GGTT ) { + ggtt = (struct i915_ggtt *)data; + ggtt->vm.vma_ops.bind_vma = ggtt_bind_vma_pv; + ggtt->vm.vma_ops.unbind_vma = ggtt_unbind_vma_pv_nop; + } }/**
drivers/gpu/drm/i915/i915_vgpu.h +3 -0
@@ -38,6 +38,7 @@ struct i915_ggtt;enum pv_caps {PV_NONE =0 ,PV_PPGTT =BIT (0 ), +PV_GGTT =BIT (1 ), };/* vgpu PV commands */
@@ -45,6 +46,8 @@ enum intel_vgpu_pv_cmd {PV_CMD_DEFAULT =0x0 ,PV_CMD_BIND_PPGTT ,PV_CMD_UNBIND_PPGTT , +PV_CMD_BIND_GGTT , + PV_CMD_UNBIND_GGTT, };/* A common shared page(4KB) between GVTg and vgpu allocated by guest */
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/12 drm/i915: vgpu workload submisison pv support
In reply to Xiaolin Zhangto improve efficiency and reduce the complexity of vgpu workload submission support, a pv version of workload submission backend implemented with engine submission data in the shared memory and eliminating execlists csb process and context switch interrupt in submisision routine.
new PV_SUBMISSION pv_cap is used to control this level of pv support in both guest and host side.
--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 + drivers/gpu/drm/i915/i915_vgpu.c | 67 +++++- drivers/gpu/drm/i915/i915_vgpu.h | 25 +++ drivers/gpu/drm/i915/intel_pv_submission.c | 324 +++++++++++++++++++++++++++++ 5 files changed, 413 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_pv_submission.c
drivers/gpu/drm/i915/Makefile +1 -1
@@ -269,7 +269,7 @@ i915-$(CONFIG_DRM_I915_SELFTEST) += \ selftests/librapl.o # virtual gpu code -i915-y += i915_vgpu.o +i915-y += i915_vgpu.o intel_pv_submission.o ifeq ($(CONFIG_DRM_I915_GVT),y) i915-y += intel_gvt.o
drivers/gpu/drm/i915/gt/intel_lrc.c +2 -0
@@ -5018,6 +5018,8 @@ void intel_execlists_set_default_submission(struct intel_engine_cs *engine)if (IS_ACTIVE (CONFIG_DRM_I915_TIMESLICE_DURATION )) engine->flags |=I915_ENGINE_HAS_TIMESLICES ; } + }else { +intel_vgpu_config_pv_caps (engine->i915,PV_SUBMISSION , engine); }if (INTEL_GEN (engine->i915) >=12 )
drivers/gpu/drm/i915/i915_vgpu.c +61 -6
135 lines not on this page · raw message
drivers/gpu/drm/i915/i915_vgpu.h +25 -0
@@ -25,6 +25,7 @@#define _I915_VGPU_H_#include <linux/types.h> +#include "gt/intel_engine_types.h" struct drm_i915_private ;struct i915_ggtt ;
@@ -32,6 +33,8 @@ struct i915_ggtt;#define PV_MAJOR 0#define PV_MINOR 1#define PV_DESC_OFF (PAGE_SIZE/256) +#define PV_RSVD_OFF (PAGE_SIZE/8) +#define PV_SUB_OFF (PAGE_SIZE/4)#define PV_CMD_OFF (PAGE_SIZE/2)/* define different PV capabilities */
@@ -39,6 +42,7 @@ enum pv_caps {PV_NONE =0 ,PV_PPGTT =BIT (0 ),PV_GGTT =BIT (1 ), + PV_SUBMISSION = BIT(2), };/* vgpu PV commands */
@@ -48,6 +52,8 @@ enum intel_vgpu_pv_cmd {PV_CMD_UNBIND_PPGTT ,PV_CMD_BIND_GGTT ,PV_CMD_UNBIND_GGTT , +PV_CMD_REGISTER_CAP_GPA , + PV_CMD_SUBMIT_WORKLOAD };/* A common shared page(4KB) between GVTg and vgpu allocated by guest */
@@ -56,6 +62,11 @@ struct gvt_shared_page {u16 ver_minor; }; +struct pv_cap_addr { +u32 cap; +u64 gpa; +}; +/* PV virtual memory address for GGTT/PPGTT */ struct pv_vma {u32 size;/* num of pages */
@@ -65,6 +76,14 @@ struct pv_vma {u64 pml4;/* ppgtt handler */ } __packed; +/* PV workload submission */ +struct pv_submission { +bool submitted; +/* workload lrc descriptor */ +u64 descs[EXECLIST_MAX_PORTS ]; +u64 rsvd[EXECLIST_MAX_PORTS ]; +} __packed; +/* * Definition of the command transport message header (DW0) *
@@ -108,6 +127,11 @@ struct vgpu_pv_ct_buffer {struct i915_virtual_gpu_pv {struct gvt_shared_page *shared_page; +void *submission;/* pv submission base */ +/* per engine PV workload submission data */ +struct pv_submission *submission_data[I915_NUM_ENGINES ]; +spinlock_t submission_lock[I915_NUM_ENGINES ]; +/* PV command buffer support */ struct vgpu_pv_ct_buffer ctb;u32 next_fence;
@@ -136,4 +160,5 @@ bool intel_vgpu_detect_pv_caps(struct drm_i915_private *i915, void __iomem *shared_area);void intel_vgpu_config_pv_caps (struct drm_i915_private *i915,enum pv_caps cap,void *data); +void vgpu_set_pv_submission (struct intel_engine_cs *engine);#endif /* _I915_VGPU_H_ */
drivers/gpu/drm/i915/intel_pv_submission.c new file +324 -0
324 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/12 drm/i915/gvt: GVTg expose pv_caps PVINFO register
In reply to Xiaolin Zhangexpose pv_caps PVINFO register from GVTg to guest in order that guest can query and control different pv capability support.
report VGT_CAPS_PV capability in pvinfo page for guest.
--- drivers/gpu/drm/i915/gvt/gvt.h | 8 ++++++++ drivers/gpu/drm/i915/gvt/handlers.c | 5 +++++ drivers/gpu/drm/i915/gvt/vgpu.c | 1 + 3 files changed, 14 insertions(+)
drivers/gpu/drm/i915/gvt/gvt.h +8 -0
@@ -49,6 +49,7 @@#include "fb_decoder.h" #include "dmabuf.h" #include "page_track.h" +#include "i915_vgpu.h" #define GVT_MAX_VGPU 8
@@ -212,6 +213,7 @@ struct intel_vgpu {struct idr object_idr;u32 scan_nonprivbb; +u32 pv_caps; };static inline void *intel_vgpu_vdev (struct intel_vgpu *vgpu)
@@ -531,6 +533,12 @@ static inline u64 intel_vgpu_get_bar_gpa(struct intel_vgpu *vgpu, int bar)PCI_BASE_ADDRESS_MEM_MASK ; } +static inline bool intel_vgpu_enabled_pv_cap (struct intel_vgpu *vgpu, +enum pv_caps cap) +{ +return (vgpu->pv_caps & cap); +} +void intel_vgpu_clean_opregion (struct intel_vgpu *vgpu);int intel_vgpu_init_opregion (struct intel_vgpu *vgpu);int intel_vgpu_opregion_base_write_handler (struct intel_vgpu *vgpu,u32 gpa);
drivers/gpu/drm/i915/gvt/handlers.c +5 -0
@@ -1203,6 +1203,7 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,break ;case 0x78010 :/* vgt_caps */ case 0x7881c : +case _vgtif_reg (pv_caps):break ;default : invalid_read = true;
@@ -1272,6 +1273,10 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,case _vgtif_reg (g2v_notify):handle_g2v_notification (vgpu, data);break ; +case _vgtif_reg (pv_caps): +DRM_INFO ("vgpu id=%d pv caps =0x%x\n" , vgpu->id, data); + vgpu->pv_caps = 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 +1 -0
@@ -48,6 +48,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)vgpu_vreg_t (vgpu,vgtif_reg (vgt_caps)) =VGT_CAPS_FULL_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_PV ;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
PATCH 8/12 drm/i915/gvt: GVTg handle guest shared_page setup
In reply to Xiaolin ZhangGVTg implemented guest shared_page register operation and read and write shared_page functionality based on hypervisor read and write functionality.
the shared_page_gpa was passed from guest driver through PVINFO shared_page_gpa register.
--- drivers/gpu/drm/i915/gvt/gvt.h | 9 ++++++-- drivers/gpu/drm/i915/gvt/handlers.c | 20 +++++++++++++++++ drivers/gpu/drm/i915/gvt/vgpu.c | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gvt/gvt.h +7 -2
@@ -214,6 +214,8 @@ struct intel_vgpu {u32 scan_nonprivbb;u32 pv_caps; +u64 shared_page_gpa; +bool shared_page_enabled; };static inline void *intel_vgpu_vdev (struct intel_vgpu *vgpu)
@@ -536,7 +538,7 @@ static inline u64 intel_vgpu_get_bar_gpa(struct intel_vgpu *vgpu, int bar)static inline bool intel_vgpu_enabled_pv_cap (struct intel_vgpu *vgpu,enum pv_caps cap) { -return (vgpu->pv_caps & cap); +return vgpu->shared_page_enabled && (vgpu->pv_caps & cap); }void intel_vgpu_clean_opregion (struct intel_vgpu *vgpu);
@@ -692,7 +694,10 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu);void intel_gvt_debugfs_remove_vgpu (struct intel_vgpu *vgpu);void 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); +int intel_gvt_write_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 +20 -0
@@ -1204,6 +1204,8 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,case 0x78010 :/* vgt_caps */ case 0x7881c :case _vgtif_reg (pv_caps): +case _vgtif_reg (shared_page_gpa): +case _vgtif_reg (shared_page_gpa) +4 :break ;default : invalid_read = true;
@@ -1221,6 +1223,9 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)enum intel_gvt_gtt_type root_entry_type =GTT_TYPE_PPGTT_ROOT_L4_ENTRY ;struct intel_vgpu_mm *mm;u64 *pdps; +unsigned long gpa, gfn; +u16 ver_major =PV_MAJOR ; +u16 ver_minor =PV_MINOR ; pdps = (u64 *)&vgpu_vreg64_t (vgpu,vgtif_reg (pdp[0 ]));
@@ -1234,6 +1239,19 @@ 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_REGISTER : + 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 (pv_caps)) =0 ; +return 0 ; + } + vgpu->shared_page_gpa = gpa; + vgpu->shared_page_enabled = true; + +intel_gvt_write_shared_page (vgpu,0 , &ver_major,2 ); +intel_gvt_write_shared_page (vgpu,2 , &ver_minor,2 ); +break ;case VGT_G2V_EXECLIST_CONTEXT_CREATE :case VGT_G2V_EXECLIST_CONTEXT_DESTROY :case 1 :/* Remove this in guest driver. */
@@ -1290,6 +1308,8 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,case _vgtif_reg (pdp[3 ].hi):case _vgtif_reg (execlist_context_descriptor_lo):case _vgtif_reg (execlist_context_descriptor_hi): +case _vgtif_reg (shared_page_gpa): +case _vgtif_reg (shared_page_gpa) +4 :break ; case _vgtif_reg(rsv5[0])..._vgtif_reg(rsv5[3]): invalid_write = true;
drivers/gpu/drm/i915/gvt/vgpu.c +43 -0
52 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/12 drm/i915/gvt: GVTg support vgpu pv CTB protocol
In reply to Xiaolin Zhanghost side to implement vgpu PV CTB protocol. based on the protocol, CTB read functionality is implemented to handle pv command from guest.
--- drivers/gpu/drm/i915/gvt/handlers.c | 119 +++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/handlers.c +118 -1
@@ -1218,6 +1218,119 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset,return 0 ; } +static inline unsigned int ct_header_get_len (u32 header) +{ +return (header >>PV_CT_MSG_LEN_SHIFT ) &PV_CT_MSG_LEN_MASK ; +} + +static inline unsigned int ct_header_get_action (u32 header) +{ +return (header >>PV_CT_MSG_ACTION_SHIFT ) &PV_CT_MSG_ACTION_MASK ; +} + +static int fetch_pv_command_buffer (struct intel_vgpu *vgpu, +struct vgpu_pv_ct_buffer_desc *desc, +u32 *fence,u32 *action,u32 *data) +{ +u32 head, tail, len, size, off; +u32 cmd_head; +u32 avail; +u32 ret; + +/* fetch command descriptor */ + off =PV_DESC_OFF ; + ret =intel_gvt_read_shared_page (vgpu, off, desc,sizeof (*desc)); +if (ret) +return ret; + +GEM_BUG_ON (desc->size %4 ); +GEM_BUG_ON (desc->head %4 ); +GEM_BUG_ON (desc->tail %4 ); +GEM_BUG_ON (tail >= size); +GEM_BUG_ON (head >= size); + +/* tail == head condition indicates empty */ + head = desc->head/4 ; + tail = desc->tail/4 ; + size = desc->size/4 ; + +if (unlikely ((tail - head) ==0 )) +return -ENODATA ; + +/* fetch command head */ + off = desc->addr + head *4 ; + ret =intel_gvt_read_shared_page (vgpu, off, &cmd_head,4 ); + head = (head +1 ) % size; +if (ret) + goto err; + + len =ct_header_get_len (cmd_head) -1 ; + *action =ct_header_get_action (cmd_head); + +/* fetch command fence */ + off = desc->addr + head *4 ; + ret =intel_gvt_read_shared_page (vgpu, off, fence,4 ); + head = (head +1 ) % size; +if (ret) + goto err; + +/* no command data */ +if (len ==0 ) + goto err; + +/* fetch command data */ + avail = size - head; +if (len <= avail) { + off = desc->addr + head *4 ; + ret =intel_gvt_read_shared_page (vgpu, off, data, len *4 ); + head = (head + len) % size; + }else { +/* swap case */ + off = desc->addr + head *4 ; + ret =intel_gvt_read_shared_page (vgpu, off, data, avail *4 ); + head = (head + avail) % size; +if (ret) + goto err; + + off = desc->addr; + ret =intel_gvt_read_shared_page (vgpu, off, &data[avail], + (len - avail) *4 ); + head = (head + len - avail) % size; + } + +err: + desc->head = head *4 ; +return ret; +} + +static int pv_command_buffer_read (struct intel_vgpu *vgpu, +u32 *cmd,u32 *data) +{ +struct vgpu_pv_ct_buffer_desc desc; +u32 fence, off =PV_DESC_OFF ; +int ret; + + ret =fetch_pv_command_buffer (vgpu, &desc, &fence, cmd, data); + +/* write command descriptor back */ + desc.fence = fence; + desc.status = ret; + + ret =intel_gvt_write_shared_page (vgpu, off, &desc,sizeof (desc)); +return ret; + +} + +static int handle_pv_commands (struct intel_vgpu *vgpu) +{ +u32 cmd; +u32 data[32 ]; +int ret; + + ret =pv_command_buffer_read (vgpu, &cmd, data); +return ret; +} +static int handle_g2v_notification (struct intel_vgpu *vgpu,int notification) {enum intel_gvt_gtt_type root_entry_type =GTT_TYPE_PPGTT_ROOT_L4_ENTRY ;
@@ -1226,6 +1339,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)unsigned long gpa, gfn;u16 ver_major =PV_MAJOR ;u16 ver_minor =PV_MINOR ; +int ret =0 ; pdps = (u64 *)&vgpu_vreg64_t (vgpu,vgtif_reg (pdp[0 ]));
@@ -1252,6 +1366,9 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification)intel_gvt_write_shared_page (vgpu,0 , &ver_major,2 );intel_gvt_write_shared_page (vgpu,2 , &ver_minor,2 );break ; +case VGT_G2V_PV_SEND_TRIGGER : + ret =handle_pv_commands (vgpu); +break ;case VGT_G2V_EXECLIST_CONTEXT_CREATE :case VGT_G2V_EXECLIST_CONTEXT_DESTROY :case 1 :/* Remove this in guest driver. */
@@ -1259,7 +1376,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)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/12 drm/i915/gvt: GVTg support ppgtt pv operations
In reply to Xiaolin ZhangThis patch is to handle ppgtt PV_CMD_BIND_PPGTT and PV_CMD_UNBIND_PPGTT
for ppgtt, it creates local ppgtt tables and set up the PTE's directly from the PV command data from guest, which does not track the usage of guest page table and remove the cost of write protection from the original PPGTT shadow page mechansim.
--- drivers/gpu/drm/i915/gvt/gtt.c | 172 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/gvt/gtt.h | 4 + drivers/gpu/drm/i915/gvt/gvt.h | 1 + drivers/gpu/drm/i915/gvt/handlers.c | 25 ++++++ drivers/gpu/drm/i915/gvt/vgpu.c | 2 + 5 files changed, 204 insertions(+)
drivers/gpu/drm/i915/gvt/gtt.c +172 -0
@@ -1777,6 +1777,25 @@ 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_vm_put (&mm->ppgtt->vm); + +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;
@@ -1789,6 +1808,11 @@ static void invalidate_ppgtt_mm(struct intel_vgpu_mm *mm)if (!mm->ppgtt_mm.shadowed)return ; +if (intel_vgpu_enabled_pv_cap (vgpu,PV_PPGTT )) { +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);
@@ -1806,6 +1830,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->gt); +if (IS_ERR (mm->ppgtt)) { +gvt_vgpu_err ("fail to create ppgtt for pdp 0x%llx\n" , +px_dma (mm->ppgtt->pd)); +return PTR_ERR (mm->ppgtt); + } + + se.type =GTT_TYPE_PPGTT_ROOT_L4_ENTRY ; + se.val64 =px_dma (mm->ppgtt->pd); +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) {
@@ -1820,6 +1864,9 @@ static int shadow_ppgtt_mm(struct intel_vgpu_mm *mm)if (mm->ppgtt_mm.shadowed)return 0 ; +if (intel_vgpu_enabled_pv_cap (vgpu,PV_PPGTT )) +return shadow_mm_pv (mm); + mm->ppgtt_mm.shadowed = true;for (index =0 ; index <ARRAY_SIZE (mm->ppgtt_mm.guest_pdps); index++) {
@@ -2606,6 +2653,131 @@ static int setup_spt_oos(struct intel_gvt *gvt)return ret; } +static int intel_vgpu_pv_ppgtt_insert_4lvl (struct intel_vgpu *vgpu, +struct intel_vgpu_mm *mm,struct pv_vma *pvvma,u64 *gfns) +{ +u32 size = pvvma->size; +int ret =0 ; +u32 cache_level; +struct sg_table st; +struct scatterlist *sg =NULL ; +struct i915_vma vma; +unsigned long gfn; +dma_addr_t dma_addr; +int i; +u64 pte_flag; + + cache_level = pvvma->flags &0xffff ; + +if (sg_alloc_table (&st, size,GFP_KERNEL )) { + ret = -ENOMEM ; + goto fail; + } + + pte_flag = gfns[0 ] &0xFFF ; +for_each_sg (st.sgl, sg, size, i) { + sg->offset =0 ; + sg->length =PAGE_SIZE ; + + gfn = gfns[i] >>PAGE_SHIFT ; + ret =intel_gvt_hypervisor_dma_map_guest_page (vgpu, + gfn,PAGE_SIZE , &dma_addr); +if (ret) { +gvt_vgpu_err ("fail to translate gfn: 0x%lx\n" , gfn); +return -ENXIO ; + } +sg_dma_address (sg) = dma_addr | pte_flag; +sg_dma_len (sg) =PAGE_SIZE ; + } + +memset (&vma,0 ,sizeof (vma)); + vma.node.start = pvvma->start; + vma.pages = &st; + mm->ppgtt->vm.insert_entries (&mm->ppgtt->vm, &vma,0 ,0 ); +sg_free_table (&st); + +fail: +return ret; +} + +static void intel_vgpu_pv_ppgtt_bind (struct intel_vgpu *vgpu, +struct intel_vgpu_mm *mm,struct pv_vma *vma,u64 *gfns) +{ +struct i915_vm_pt_stash stash = {}; + +if (vma->flags &BIT (I915_VMA_ALLOC_BIT )) { +i915_vm_alloc_pt_stash (&mm->ppgtt->vm, &stash, vma->size <<PAGE_SHIFT ); +i915_vm_pin_pt_stash (&mm->ppgtt->vm, &stash); + mm->ppgtt->vm.allocate_va_range (&mm->ppgtt->vm, + &stash, vma->start, vma->size <<PAGE_SHIFT ); + } + +intel_vgpu_pv_ppgtt_insert_4lvl (vgpu, mm, vma, gfns); +} + +static void intel_vgpu_pv_ppgtt_unbind (struct intel_vgpu *vgpu, +struct intel_vgpu_mm *mm,struct pv_vma *vma,u64 *gfns) +{ +u32 size = vma->size; +int i; +u64 dma_addr; + + mm->ppgtt->vm.clear_range (&mm->ppgtt->vm, + vma->start, size <<PAGE_SHIFT ); + +for (i =0 ; i < size; i++) { + dma_addr = gfns[i]; +intel_gvt_hypervisor_dma_unmap_guest_page (vgpu, dma_addr); + } + +} + +int intel_vgpu_handle_pv_vma (struct intel_vgpu *vgpu, +struct intel_vgpu_mm *mm,u32 cmd,u32 data[]) +{ +struct pv_vma *vma = (struct pv_vma *)data; +int ret =0 ; + +u32 num_pages; +u64 dma_addr_array[32 ]; +u64 *dma_addr_mem; +u64 *dma_addrs = dma_addr_array; + + num_pages = vma->size; +if (num_pages ==1 ) { + dma_addrs[0 ] = vma->dma_addrs; + goto out; + } + +if (num_pages >ARRAY_SIZE (dma_addr_array)) { + dma_addr_mem =kmalloc_array (num_pages, +sizeof (u64),GFP_KERNEL ); + dma_addrs = dma_addr_mem; + } + + ret =intel_gvt_hypervisor_read_gpa (vgpu, vma->dma_addrs, + dma_addrs, num_pages *sizeof (u64)); +if (ret) +return ret; + +out: +switch (cmd) { +case PV_CMD_UNBIND_PPGTT : +intel_vgpu_pv_ppgtt_unbind (vgpu, mm, vma, dma_addrs); +break ; +case PV_CMD_BIND_PPGTT : +intel_vgpu_pv_ppgtt_bind (vgpu, mm, vma, dma_addrs); +break ; +default : +break ; + } + +if (num_pages >ARRAY_SIZE (dma_addr_array)) +kfree (dma_addr_mem); + +return ret; +} +/** * intel_vgpu_find_ppgtt_mm - find a PPGTT mm object * @vgpu: a vGPU
drivers/gpu/drm/i915/gvt/gtt.h +4 -0
@@ -141,6 +141,7 @@ struct intel_gvt_partial_pte {struct intel_vgpu_mm {enum intel_gvt_mm_type type; +struct i915_ppgtt *ppgtt;struct intel_vgpu *vgpu;struct kref ref;
@@ -280,4 +281,7 @@ int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,void intel_vgpu_destroy_all_ppgtt_mm (struct intel_vgpu *vgpu); +int intel_vgpu_handle_pv_vma (struct intel_vgpu *vgpu, +struct intel_vgpu_mm *mm,u32 action,u32 data[]); +#endif /* _GVT_GTT_H_ */
drivers/gpu/drm/i915/gvt/gvt.h +1 -0
@@ -50,6 +50,7 @@#include "dmabuf.h" #include "page_track.h" #include "i915_vgpu.h" +#include "i915_pvinfo.h" #define GVT_MAX_VGPU 8
drivers/gpu/drm/i915/gvt/handlers.c +25 -0
@@ -1323,11 +1323,36 @@ static int pv_command_buffer_read(struct intel_vgpu *vgpu,static int handle_pv_commands (struct intel_vgpu *vgpu) { +struct intel_vgpu_mm *mm; +struct pv_vma *vma; +u64 pdp;u32 cmd;u32 data[32 ];int ret; ret =pv_command_buffer_read (vgpu, &cmd, data); + +if (ret) +return ret; + +switch (cmd) { +case PV_CMD_BIND_PPGTT : +case PV_CMD_UNBIND_PPGTT : + vma = (struct pv_vma *)data; + pdp = vma->pml4; + mm =intel_vgpu_find_ppgtt_mm (vgpu, &pdp); +if (!mm) { +gvt_vgpu_err ("failed to find pdp 0x%llx\n" , pdp); + ret = -EINVAL ; +enter_failsafe_mode (vgpu,GVT_FAILSAFE_GUEST_ERR ); +return ret; + } + ret =intel_vgpu_handle_pv_vma (vgpu, mm, cmd, data); +break ; +default : +break ; + } +return ret; }
drivers/gpu/drm/i915/gvt/vgpu.c +2 -0
@@ -50,6 +50,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_PV ; +vgpu_vreg_t (vgpu,vgtif_reg (pv_caps)) =PV_PPGTT ; +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
PATCH 11/12 drm/i915/gvt: GVTg support ggtt pv operations
In reply to Xiaolin ZhangThis patch is to handle ppgtt PV_CMD_BIND_GGTT and PV_CMD_UNBIND_GGTT
for pv ggtt, it is operated (bind/unbind) per vma instead of per ggtt entry mmio update to improve efficiency
--- drivers/gpu/drm/i915/gvt/gtt.c | 83 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/gvt/handlers.c | 4 ++ drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 3 files changed, 88 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gtt.c +83 -0
@@ -2732,6 +2732,83 @@ static void intel_vgpu_pv_ppgtt_unbind(struct intel_vgpu *vgpu, } +static int intel_vgpu_pv_ggtt_bind (struct intel_vgpu *vgpu, +struct pv_vma *vma,u64 *gpas) +{ +u64 off = (vma->start /I915_GTT_PAGE_SIZE ) <<3 ; +u32 size = vma->size; +struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm; +struct intel_gvt_gtt_pte_ops *ops = vgpu->gvt->gtt.pte_ops; +unsigned long g_gtt_index = off >>3 ; +struct intel_gvt_gtt_entry e = {.val64 =0 , .type =GTT_TYPE_GGTT_PTE }; +struct intel_gvt_gtt_entry m = {.val64 =0 , .type =GTT_TYPE_GGTT_PTE }; +int ret =0 ; +int i; +u64 gfn; +dma_addr_t dma_addr; + +for (i =0 ; i < size; i++) { + e.val64 = gpas[i]; +if (!ops->test_present (&e)) { + ops->set_pfn (&m, vgpu->gvt->gtt.scratch_mfn); + ops->clear_present (&m); + goto out; + } + + gfn = ops->get_pfn (&e); + m.val64 = e.val64; + ret =intel_gvt_hypervisor_dma_map_guest_page (vgpu, + gfn,PAGE_SIZE , &dma_addr); +if (ret) { +gvt_vgpu_err ("failed to map guest ggtt entry\n" ); + ops->set_pfn (&m, vgpu->gvt->gtt.scratch_mfn); + }else + ops->set_pfn (&m, dma_addr >>PAGE_SHIFT ); +out: + g_gtt_index = off >>3 ; +ggtt_set_guest_entry (ggtt_mm, &e, g_gtt_index); +ggtt_get_host_entry (ggtt_mm, &e, g_gtt_index); +ggtt_invalidate_pte (vgpu, &e); +ggtt_set_host_entry (ggtt_mm, &m, g_gtt_index); + off +=8 ; + } + +ggtt_invalidate (vgpu->gvt->gt); +return ret; +} + + +static int intel_vgpu_pv_ggtt_unbind (struct intel_vgpu *vgpu, +struct pv_vma *vma,u64 *gpas) +{ +u64 off = (vma->start /I915_GTT_PAGE_SIZE ) <<3 ; +u32 size = vma->size; +struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm; +struct intel_gvt_gtt_pte_ops *ops = vgpu->gvt->gtt.pte_ops; +unsigned long g_gtt_index = off >>3 ; +struct intel_gvt_gtt_entry e = {.val64 =0 , .type =GTT_TYPE_GGTT_PTE }; +struct intel_gvt_gtt_entry m = {.val64 =0 , .type =GTT_TYPE_GGTT_PTE }; +int ret =0 ; +int i; + +for (i =0 ; i < size; i++) { + g_gtt_index = off >>3 ; + e.val64 = gpas[i]; +ggtt_invalidate_pte (vgpu, &e); + ops->clear_present (&e); +ggtt_set_guest_entry (ggtt_mm, &e, g_gtt_index); + ops->set_pfn (&m, vgpu->gvt->gtt.scratch_mfn); + ops->clear_present (&m); +ggtt_get_host_entry (ggtt_mm, &e, g_gtt_index); +ggtt_set_host_entry (ggtt_mm, &m, g_gtt_index); + off +=8 ; + } + +ggtt_invalidate (vgpu->gvt->gt); + +return ret; +} +int intel_vgpu_handle_pv_vma (struct intel_vgpu *vgpu,struct intel_vgpu_mm *mm,u32 cmd,u32 data[]) {
@@ -2768,6 +2845,12 @@ int intel_vgpu_handle_pv_vma(struct intel_vgpu *vgpu,case PV_CMD_BIND_PPGTT :intel_vgpu_pv_ppgtt_bind (vgpu, mm, vma, dma_addrs);break ; +case PV_CMD_BIND_GGTT : + ret =intel_vgpu_pv_ggtt_bind (vgpu, vma, dma_addrs); +break ; +case PV_CMD_UNBIND_GGTT : + ret =intel_vgpu_pv_ggtt_unbind (vgpu, vma, dma_addrs); +break ;default :break ; }
drivers/gpu/drm/i915/gvt/handlers.c +4 -0
@@ -1349,6 +1349,10 @@ static int handle_pv_commands(struct intel_vgpu *vgpu) } ret =intel_vgpu_handle_pv_vma (vgpu, mm, cmd, data);break ; +case PV_CMD_BIND_GGTT : +case PV_CMD_UNBIND_GGTT : + ret =intel_vgpu_handle_pv_vma (vgpu,NULL , cmd, data); +break ;default :break ; }
drivers/gpu/drm/i915/gvt/vgpu.c +1 -1
@@ -50,7 +50,7 @@ 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_PV ; -vgpu_vreg_t (vgpu,vgtif_reg (pv_caps)) =PV_PPGTT ; +vgpu_vreg_t (vgpu,vgtif_reg (pv_caps)) =PV_PPGTT |PV_GGTT ;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
PATCH 12/12 drm/i915/gvt: GVTg support pv workload submssion
In reply to Xiaolin Zhangimplemented pv workload submission support within GVTg.
GVTg to read engine submission data (engine lrc) from the shared_page with pv interface to reduce mmio trap cost and then eliminate execlist HW behavior emulation by removing injecting context switch interrupt to guest under workload submisison pv mode to improve efficiency.
--- drivers/gpu/drm/i915/gvt/gvt.h | 1 + drivers/gpu/drm/i915/gvt/handlers.c | 101 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/gvt/vgpu.c | 1 + 3 files changed, 103 insertions(+)
drivers/gpu/drm/i915/gvt/gvt.h +1 -0
@@ -217,6 +217,7 @@ struct intel_vgpu {u32 pv_caps;u64 shared_page_gpa;bool shared_page_enabled; +u64 pv_sub_gpa; };static inline void *intel_vgpu_vdev (struct intel_vgpu *vgpu)
drivers/gpu/drm/i915/gvt/handlers.c +101 -0
125 lines not on this page · raw message
drivers/gpu/drm/i915/gvt/vgpu.c +1 -0
@@ -51,6 +51,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)vgpu_vreg_t (vgpu,vgtif_reg (vgt_caps)) |=VGT_CAPS_PV ;vgpu_vreg_t (vgpu,vgtif_reg (pv_caps)) =PV_PPGTT |PV_GGTT ; +vgpu_vreg_t (vgpu,vgtif_reg (pv_caps)) |=PV_SUBMISSION ;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
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for enhanced i915 vgpu with PV feature support
In reply to Xiaolin Zhang== Series Details ==
== Series Details ==
Series: enhanced i915 vgpu with PV feature support
URL : https://patchwork.freedesktop.org/series/81400/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip b72c9e3578ae drm/i915: introduced vgpu pv capability -:98: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #98: FILE: drivers/gpu/drm/i915/i915_vgpu.c:144: +static bool intel_vgpu_check_pv_cap(struct drm_i915_private *dev_priv, + enum pv_caps cap)
-:101: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #101: FILE: drivers/gpu/drm/i915/i915_vgpu.c:147:
+ return (dev_priv->vgpu.active && (dev_priv->vgpu.caps & VGT_CAPS_PV)
+ && (dev_priv->vgpu.pv_caps & cap));
-:125: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #125: FILE: drivers/gpu/drm/i915/i915_vgpu.c:366:
+void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,
+ enum pv_caps cap, void *data)
-:127: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #127: FILE: drivers/gpu/drm/i915/i915_vgpu.c:368:
+{
+
-:140: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #140: FILE: drivers/gpu/drm/i915/i915_vgpu.c:381:
+bool intel_vgpu_detect_pv_caps(struct drm_i915_private *i915,
+ void __iomem *shared_area)
-:181: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #181: FILE: drivers/gpu/drm/i915/i915_vgpu.h:49:
+bool intel_vgpu_detect_pv_caps(struct drm_i915_private *i915,
+ void __iomem *shared_area);
-:183: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #183: FILE: drivers/gpu/drm/i915/i915_vgpu.h:51:
+void intel_vgpu_config_pv_caps(struct drm_i915_private *i915,
+ enum pv_caps cap, void *data);
total: 0 errors, 0 warnings, 7 checks, 137 lines checked 6c29bb1bd899 drm/i915: vgpu shared memory setup for pv support -:104: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #104: FILE: drivers/gpu/drm/i915/i915_vgpu.c:377:
+static int intel_vgpu_setup_shared_page(struct drm_i915_private *i915,
+ void __iomem *shared_area)
-:162: CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*pv)...) over kzalloc(sizeof(struct i915_virtual_gpu_pv)...) #162: FILE: drivers/gpu/drm/i915/i915_vgpu.c:435:
+ pv = kzalloc(sizeof(struct i915_virtual_gpu_pv), GFP_KERNEL);
total: 0 errors, 0 warnings, 2 checks, 172 lines checked 3357dfa9bfcf drm/i915: vgpu pv command buffer transport protocol -:52: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #52: FILE: drivers/gpu/drm/i915/i915_vgpu.c:389:
+static int wait_for_desc_update(struct vgpu_pv_ct_buffer_desc *desc,
+ u32 fence, u32 *status)
-:64: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #64: FILE: drivers/gpu/drm/i915/i915_vgpu.c:401:
+ DRM_ERROR("CT: fence %u failed; reported fence=%u\n",
+ fence, desc->fence);
-:89: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #89: FILE: drivers/gpu/drm/i915/i915_vgpu.c:426:
+static int pv_command_buffer_write(struct i915_virtual_gpu_pv *pv,
+ const u32 *action, u32 len /* in dwords */, u32 fence)
-:150: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #150: FILE: drivers/gpu/drm/i915/i915_vgpu.c:487:
+static int pv_send(struct drm_i915_private *i915,
+ const u32 *action, u32 len, u32 *status)
-:185: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #185: FILE: drivers/gpu/drm/i915/i915_vgpu.c:522:
+static int intel_vgpu_pv_send_command_buffer(struct drm_i915_private *i915,
+ u32 *action, u32 len)
-:201: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #201: FILE: drivers/gpu/drm/i915/i915_vgpu.c:538:
+ DRM_ERROR("PV: send action %#x returned %d (%#x)\n",
+ action[0], ret, ret);
-:251: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #251: FILE: drivers/gpu/drm/i915/i915_vgpu.c:627:
+ pv->ctb.desc->size = PAGE_SIZE/2;
^
-:270: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #270: FILE: drivers/gpu/drm/i915/i915_vgpu.h:34:
+#define PV_DESC_OFF (PAGE_SIZE/256)
^
-:271: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #271: FILE: drivers/gpu/drm/i915/i915_vgpu.h:35:
+#define PV_CMD_OFF (PAGE_SIZE/2)
^
total: 0 errors, 0 warnings, 9 checks, 299 lines checked 4de75f774c0a drm/i915: vgpu ppgtt page table pv support
-:55: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #55: FILE: drivers/gpu/drm/i915/i915_vgpu.c:377:
+static int vgpu_pv_vma_action(struct i915_address_space *vm,
+ struct i915_vma *vma,
-:87: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!gpas" #87: FILE: drivers/gpu/drm/i915/i915_vgpu.c:409:
+ if (gpas == NULL)
-:109: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #109: FILE: drivers/gpu/drm/i915/i915_vgpu.c:431:
+static void ppgtt_bind_vma_pv(struct i915_address_space *vm,
+ struct i915_vm_pt_stash *stash,
-:133: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #133: FILE: drivers/gpu/drm/i915/i915_vgpu.c:455:
+static void ppgtt_unbind_vma_pv(struct i915_address_space *vm,
+ struct i915_vma *vma)
total: 0 errors, 0 warnings, 4 checks, 156 lines checked ebdd3ccc911e drm/i915: vgpu ggtt page table pv support
-:55: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #55: FILE: drivers/gpu/drm/i915/i915_vgpu.c:462:
+static void ggtt_bind_vma_pv(struct i915_address_space *vm,
+ struct i915_vm_pt_stash *stash,
-:77: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #77: FILE: drivers/gpu/drm/i915/i915_vgpu.c:484:
+static void ggtt_unbind_vma_pv_nop(struct i915_address_space *vm,
+ struct i915_vma *vma)
-:79: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #79: FILE: drivers/gpu/drm/i915/i915_vgpu.c:486:
+{
+
-:80: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #80: FILE: drivers/gpu/drm/i915/i915_vgpu.c:487:
+
+}
total: 0 errors, 0 warnings, 4 checks, 88 lines checked 1d7f2ad07d7e drm/i915: vgpu workload submisison pv support -:100: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #100: FILE: drivers/gpu/drm/i915/i915_vgpu.c:674:
+static void inte_vgpu_register_cap_gpa(struct drm_i915_private *i915,
+ struct pv_cap_addr *cap_addr, void __iomem *shared_area)
-:208: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #208: FILE: drivers/gpu/drm/i915/i915_vgpu.h:36:
+#define PV_RSVD_OFF (PAGE_SIZE/8)
^
-:209: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #209: FILE: drivers/gpu/drm/i915/i915_vgpu.h:37:
+#define PV_SUB_OFF (PAGE_SIZE/4)
^
-:264: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #264: FILE: drivers/gpu/drm/i915/i915_vgpu.h:133:
+ spinlock_t submission_lock[I915_NUM_ENGINES];
-:276: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #276:
new file mode 100644
-:421: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #421: FILE: drivers/gpu/drm/i915/intel_pv_submission.c:141:
+static void pv_submit(struct intel_engine_cs *engine,
+ struct i915_request **out, struct i915_request **end)
-:595: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #595: FILE: drivers/gpu/drm/i915/intel_pv_submission.c:315:
+ engine->park = engine->unpark = NULL;
total: 0 errors, 1 warnings, 6 checks, 546 lines checked e104ce5af762 drm/i915/gvt: GVTg expose pv_caps PVINFO register -:38: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #38: FILE: drivers/gpu/drm/i915/gvt/gvt.h:537:
+static inline bool intel_vgpu_enabled_pv_cap(struct intel_vgpu *vgpu,
+ enum pv_caps cap)
total: 0 errors, 0 warnings, 1 checks, 50 lines checked b87ea2334728 drm/i915/gvt: GVTg handle guest shared_page setup -:42: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #42: FILE: drivers/gpu/drm/i915/gvt/gvt.h:692:
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len);
-:44: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #44: FILE: drivers/gpu/drm/i915/gvt/gvt.h:694:
+int intel_gvt_write_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len);
-:122: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #122: FILE: drivers/gpu/drm/i915/gvt/vgpu.c:619:
+int intel_gvt_read_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len)
-:141: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #141: FILE: drivers/gpu/drm/i915/gvt/vgpu.c:638:
+int intel_gvt_write_shared_page(struct intel_vgpu *vgpu,
+ unsigned int offset, void *buf, unsigned long len)
total: 0 errors, 0 warnings, 4 checks, 123 lines checked faded3875072 drm/i915/gvt: GVTg support vgpu pv CTB protocol -:30: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #30: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1232:
+static int fetch_pv_command_buffer(struct intel_vgpu *vgpu,
+ struct vgpu_pv_ct_buffer_desc *desc,
-:51: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #51: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1253:
+ head = desc->head/4;
^
-:52: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #52: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1254:
+ tail = desc->tail/4;
^
-:53: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #53: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1255:
+ size = desc->size/4;
^
-:95: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #95: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1297:
+ ret = intel_gvt_read_shared_page(vgpu, off, &data[avail],
+ (len - avail) * 4);
-:105: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #105: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1307:
+static int pv_command_buffer_read(struct intel_vgpu *vgpu,
+ u32 *cmd, u32 *data)
-:120: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #120: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1322:
+
+}
total: 0 errors, 0 warnings, 7 checks, 143 lines checked 0ab96123813a drm/i915/gvt: GVTg support ppgtt pv operations -:70: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #70: FILE: drivers/gpu/drm/i915/gvt/gtt.c:1842:
+ gvt_vgpu_err("fail to create ppgtt for pdp 0x%llx\n",
+ px_dma(mm->ppgtt->pd));
-:99: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #99: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2657:
+static int intel_vgpu_pv_ppgtt_insert_4lvl(struct intel_vgpu *vgpu,
+ struct intel_vgpu_mm *mm, struct pv_vma *pvvma, u64 *gfns)
-:126: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #126: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2684:
+ ret = intel_gvt_hypervisor_dma_map_guest_page(vgpu,
+ gfn, PAGE_SIZE, &dma_addr);
-:146: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #146: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2704:
+static void intel_vgpu_pv_ppgtt_bind(struct intel_vgpu *vgpu,
+ struct intel_vgpu_mm *mm, struct pv_vma *vma, u64 *gfns)
-:161: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #161: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2719:
+static void intel_vgpu_pv_ppgtt_unbind(struct intel_vgpu *vgpu,
+ struct intel_vgpu_mm *mm, struct pv_vma *vma, u64 *gfns)
-:175: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #175: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2733:
+
+}
-:178: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #178: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2736:
+int intel_vgpu_handle_pv_vma(struct intel_vgpu *vgpu,
+ struct intel_vgpu_mm *mm, u32 cmd, u32 data[])
-:196: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #196: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2754:
+ dma_addr_mem = kmalloc_array(num_pages,
+ sizeof(u64), GFP_KERNEL);
-:201: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #201: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2759:
+ ret = intel_gvt_hypervisor_read_gpa(vgpu, vma->dma_addrs,
+ dma_addrs, num_pages * sizeof(u64));
-:243: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #243: FILE: drivers/gpu/drm/i915/gvt/gtt.h:286:
+int intel_vgpu_handle_pv_vma(struct intel_vgpu *vgpu,
+ struct intel_vgpu_mm *mm, u32 action, u32 data[]);
total: 0 errors, 0 warnings, 10 checks, 267 lines checked 9352c15a9bc8 drm/i915/gvt: GVTg support ggtt pv operations -:22: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #22: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2736:
+static int intel_vgpu_pv_ggtt_bind(struct intel_vgpu *vgpu,
+ struct pv_vma *vma, u64 *gpas)
-:47: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #47: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2761:
+ ret = intel_gvt_hypervisor_dma_map_guest_page(vgpu,
+ gfn, PAGE_SIZE, &dma_addr);
-:48: CHECK:BRACES: braces {} should be used on all arms of this statement #48: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2762:
+ if (ret) {
[...]
+ } else
[...]
-:51: CHECK:BRACES: Unbalanced braces around else statement #51: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2765:
+ } else
-:66: CHECK:LINE_SPACING: Please don't use multiple blank lines #66: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2780:
+
+
-:68: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #68: FILE: drivers/gpu/drm/i915/gvt/gtt.c:2782:
+static int intel_vgpu_pv_ggtt_unbind(struct intel_vgpu *vgpu,
+ struct pv_vma *vma, u64 *gpas)
total: 0 errors, 0 warnings, 6 checks, 113 lines checked d4828a33c233 drm/i915/gvt: GVTg support pv workload submssion -:72: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #72: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1884:
+static int submit_context_pv(struct intel_vgpu *vgpu,
+ const struct intel_engine_cs *engine,
-:89: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i' may be better as '(i)' to avoid precedence issues #89: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1901:
+#define get_desc_from_elsp_dwords(ed, i) \
+ ((struct execlist_ctx_descriptor_format *)&((ed)->data[i * 2]))
-:93: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #93: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1905:
+static int handle_pv_submission(struct intel_vgpu *vgpu,
+ const struct intel_engine_cs *engine)
-:108: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around subdata.descs[0] #108: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1920:
+ desc[0] = (struct execlist_ctx_descriptor_format *)&(subdata.descs[0]);
-:109: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around subdata.descs[1] #109: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1921:
+ desc[1] = (struct execlist_ctx_descriptor_format *)&(subdata.descs[1]);
-:154: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #154: FILE: drivers/gpu/drm/i915/gvt/handlers.c:1971:
+ if (intel_vgpu_enabled_pv_cap(vgpu, PV_SUBMISSION) &&
+ data == PV_CMD_SUBMIT_WORKLOAD)
total: 0 errors, 0 warnings, 6 checks, 139 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for enhanced i915 vgpu with PV feature support
In reply to Xiaolin Zhang== Series Details ==
== Series Details ==
Series: enhanced i915 vgpu with PV feature support
URL : https://patchwork.freedesktop.org/series/81400/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/gt/intel_reset.c:1311:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block +drivers/gpu/drm/i915/i915_perf.c:1440:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/i915_perf.c:1494:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/intel_pv_submission.c:275:6: warning: symbol 'pv_submit_request' was not declared. Should it be static? +./include/linux/seqlock.h:752:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:778:16: warning: trying to copy expression type 31 +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.DOCS: warning for enhanced i915 vgpu with PV feature support
In reply to Xiaolin Zhang== Series Details ==
== Series Details ==
Series: enhanced i915 vgpu with PV feature support
URL : https://patchwork.freedesktop.org/series/81400/
State : warning
== Summary ==
$ make htmldocs 2>&1 > /dev/null | grep i915 ./drivers/gpu/drm/i915/i915_vgpu.c:846: warning: Excess function parameter 'dev_priv' description in 'intel_vgpu_detect_pv_caps' ./drivers/gpu/drm/i915/i915_vgpu.c:547: warning: Function parameter or member 'pv' not described in 'pv_command_buffer_write' ./drivers/gpu/drm/i915/i915_vgpu.c:547: warning: Function parameter or member 'action' not described in 'pv_command_buffer_write' ./drivers/gpu/drm/i915/i915_vgpu.c:547: warning: Function parameter or member 'len' not described in 'pv_command_buffer_write' ./drivers/gpu/drm/i915/i915_vgpu.c:547: warning: Function parameter or member 'fence' not described in 'pv_command_buffer_write' ./drivers/gpu/drm/i915/i915_vgpu.c:847: warning: Function parameter or member 'i915' not described in 'intel_vgpu_detect_pv_caps' ./drivers/gpu/drm/i915/i915_vgpu.c:847: warning: Function parameter or member 'shared_area' not described in 'intel_vgpu_detect_pv_caps' ./drivers/gpu/drm/i915/i915_vgpu.c:847: warning: Excess function parameter 'dev_priv' description in 'intel_vgpu_detect_pv_caps'
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for enhanced i915 vgpu with PV feature support
In reply to Xiaolin Zhang== Series Details ==
== Series Details ==
Series: enhanced i915 vgpu with PV feature support
URL : https://patchwork.freedesktop.org/series/81400/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8968 -> Patchwork_18446
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/index.html
Known issues
------------
Here are the changes found in Patchwork_18446 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@gem_contexts:
- fi-tgl-u2: [PASS][1] -> [INCOMPLETE][2] ([i915#2045])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- fi-icl-u2: [PASS][3] -> [DMESG-WARN][4] ([i915#1982]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/fi-icl-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/fi-icl-u2/igt@[email protected]
* igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2:
- fi-skl-guc: [PASS][5] -> [DMESG-WARN][6] ([i915#2203])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/fi-skl-guc/igt@kms_flip@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/fi-skl-guc/igt@kms_flip@[email protected]
#### Possible fixes ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [DMESG-WARN][7] ([i915#1982]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/fi-bsw-kefka/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/fi-bsw-kefka/igt@[email protected]
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2045]: https://gitlab.freedesktop.org/drm/intel/issues/2045
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
Participating hosts (35 -> 32)
------------------------------
Missing (3): fi-byt-clapper fi-byt-squawks fi-bsw-cyan
Build changes
-------------
* Linux: CI_DRM_8968 -> Patchwork_18446
CI-20190529: 20190529
CI_DRM_8968: 4d831cabbba82294ba008ec7999c71f443b1864f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5779: f52bf19b5f02d52fc3e201c6467ec3f511227fba @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18446: d4828a33c2335b6b8865993683f6821c6ce4ba4d @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
d4828a33c233 drm/i915/gvt: GVTg support pv workload submssion 9352c15a9bc8 drm/i915/gvt: GVTg support ggtt pv operations 0ab96123813a drm/i915/gvt: GVTg support ppgtt pv operations faded3875072 drm/i915/gvt: GVTg support vgpu pv CTB protocol b87ea2334728 drm/i915/gvt: GVTg handle guest shared_page setup e104ce5af762 drm/i915/gvt: GVTg expose pv_caps PVINFO register 1d7f2ad07d7e drm/i915: vgpu workload submisison pv support ebdd3ccc911e drm/i915: vgpu ggtt page table pv support 4de75f774c0a drm/i915: vgpu ppgtt page table pv support 3357dfa9bfcf drm/i915: vgpu pv command buffer transport protocol 6c29bb1bd899 drm/i915: vgpu shared memory setup for pv support b72c9e3578ae drm/i915: introduced vgpu pv capability
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for enhanced i915 vgpu with PV feature support
In reply to Xiaolin Zhang== Series Details ==
== Series Details ==
Series: enhanced i915 vgpu with PV feature support
URL : https://patchwork.freedesktop.org/series/81400/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8968_full -> Patchwork_18446_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_18446_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_18446_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18446_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_ctx_persistence@processes:
- shard-skl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl9/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl1/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_18446_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_reloc@basic-many-active@rcs0:
- shard-glk: [PASS][3] -> [FAIL][4] ([i915#2389]) +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-glk6/igt@gem_exec_reloc@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-glk3/igt@gem_exec_reloc@[email protected]
* igt@gem_reg_read@timestamp-monotonic:
- shard-iclb: [PASS][5] -> [DMESG-WARN][6] ([i915#1982])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb2/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][7] -> [FAIL][8] ([i915#454])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb1/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb4/igt@[email protected]
* igt@i915_pm_rpm@gem-mmap-type@uc:
- shard-skl: [PASS][9] -> [DMESG-WARN][10] ([i915#1982]) +10 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl7/igt@i915_pm_rpm@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl5/igt@i915_pm_rpm@[email protected]
* igt@kms_big_fb@y-tiled-8bpp-rotate-0:
- shard-kbl: [PASS][11] -> [DMESG-WARN][12] ([i915#1982])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-kbl4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-kbl4/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [PASS][13] -> [DMESG-WARN][14] ([i915#180]) +3 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-kbl7/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-kbl7/igt@[email protected]
* igt@kms_cursor_edge_walk@pipe-b-256x256-left-edge:
- shard-apl: [PASS][15] -> [DMESG-WARN][16] ([i915#1635] / [i915#1982])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-apl2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-apl6/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1:
- shard-skl: [PASS][17] -> [FAIL][18] ([i915#79])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl2/igt@kms_flip@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl3/igt@kms_flip@[email protected]
* igt@kms_flip_tiling@flip-changes-tiling-y:
- shard-skl: [PASS][19] -> [FAIL][20] ([i915#699])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl7/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-badstride:
- shard-glk: [PASS][21] -> [DMESG-WARN][22] ([i915#1982]) +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-glk8/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-glk8/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-onoff:
- shard-tglb: [PASS][23] -> [DMESG-WARN][24] ([i915#1982]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-tglb7/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-tglb2/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][25] -> [FAIL][26] ([fdo#108145] / [i915#265]) +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl7/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl5/igt@[email protected]
* igt@kms_psr@psr2_cursor_mmap_cpu:
- shard-iclb: [PASS][27] -> [SKIP][28] ([fdo#109441])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb5/igt@kms_psr@psr2_cursor_mmap_cpu.html
* igt@perf@polling:
- shard-skl: [PASS][29] -> [FAIL][30] ([i915#1542]) +1 similar issue
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl5/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl3/igt@[email protected]
#### Possible fixes ####
* igt@gem_eio@kms:
- shard-skl: [DMESG-WARN][31] ([i915#1982]) -> [PASS][32] +4 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl10/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl2/igt@[email protected]
* igt@gem_flink_race@flink_close:
- shard-iclb: [DMESG-WARN][33] ([i915#1982]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb2/igt@gem_flink_race@flink_close.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb7/igt@gem_flink_race@flink_close.html
* igt@gen9_exec_parse@allowed-single:
- shard-skl: [DMESG-WARN][35] ([i915#1436] / [i915#716]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl3/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl2/igt@[email protected]
* igt@kms_big_fb@x-tiled-64bpp-rotate-0:
- shard-apl: [DMESG-WARN][37] ([i915#1635] / [i915#1982]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-apl6/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-apl4/igt@[email protected]
* igt@kms_draw_crc@draw-method-xrgb2101010-render-xtiled:
- shard-glk: [DMESG-WARN][39] ([i915#1982]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-glk3/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-glk7/igt@[email protected]
* igt@kms_flip@2x-plain-flip-fb-recreate@ab-hdmi-a1-hdmi-a2:
- shard-glk: [FAIL][41] ([i915#2122]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-glk6/igt@kms_flip@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-glk3/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: [FAIL][43] ([i915#79]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl2/igt@kms_flip@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl3/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1:
- shard-glk: [FAIL][45] ([i915#79]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-glk7/igt@kms_flip@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-glk2/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
- shard-kbl: [DMESG-WARN][47] ([i915#180]) -> [PASS][48] +8 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-kbl7/igt@kms_flip@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-kbl7/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend@b-edp1:
- shard-skl: [INCOMPLETE][49] ([i915#198]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl1/igt@kms_flip@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl9/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-wf_vblank-interruptible@a-dp1:
- shard-kbl: [DMESG-WARN][51] ([i915#1982]) -> [PASS][52] +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-kbl4/igt@kms_flip@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-kbl7/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-slowdraw:
- shard-tglb: [DMESG-WARN][53] ([i915#1982]) -> [PASS][54] +1 similar issue
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-tglb8/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-tglb3/igt@[email protected]
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][55] ([fdo#109441]) -> [PASS][56] +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb6/igt@kms_psr@psr2_primary_mmap_cpu.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
#### Warnings ####
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [DMESG-WARN][57] ([i915#1226]) -> [SKIP][58] ([fdo#109349])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-iclb2/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-iclb5/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [DMESG-FAIL][59] ([fdo#108145] / [i915#1982]) -> [DMESG-WARN][60] ([i915#1982])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8968/shard-skl6/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/shard-skl4/igt@[email protected]
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#1226]: https://gitlab.freedesktop.org/drm/intel/issues/1226
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
Participating hosts (10 -> 11)
------------------------------
Additional (1): pig-snb-2600
Build changes
-------------
* Linux: CI_DRM_8968 -> Patchwork_18446
CI-20190529: 20190529
CI_DRM_8968: 4d831cabbba82294ba008ec7999c71f443b1864f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5779: f52bf19b5f02d52fc3e201c6467ec3f511227fba @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18446: d4828a33c2335b6b8865993683f6821c6ce4ba4d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18446/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx