All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check
@ 2017-06-05  3:00 Zhenyu Wang
  2017-06-05  3:25 ` ✗ Fi.CI.BAT: warning for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Zhenyu Wang @ 2017-06-05  3:00 UTC (permalink / raw)
  To: intel-gfx, intel-gvt-dev
  Cc: Chuanxiao Dong, Joonas Lahtinen, stable, #, 4.10+

Current it's strictly checked if PVINFO version matches 1.0
for GVT-g i915 guest which doesn't help for compatibility at
all and forces GVT-g host can't extend PVINFO easily with version
bump for real compatibility check.

This fixes that to check minimal required PVINFO version instead
and currently minimal 1.0 is required.

Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org # 4.10+
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pvinfo.h | 3 ++-
 drivers/gpu/drm/i915/i915_vgpu.c   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index c0cb2974caac..96434707857e 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -37,7 +37,8 @@
 #define VGT_VERSION_MINOR 0
 
 #define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
-#define INTEL_VGT_IF_VERSION \
+/* minimal required PVINFO version */
+#define INTEL_VGT_IF_VERSION_REQUIRED \
 	INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)
 
 /*
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 4ab8a973b61f..5798572e6db3 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -72,7 +72,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	version = INTEL_VGT_IF_VERSION_ENCODE(
 		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
 		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
-	if (version != INTEL_VGT_IF_VERSION) {
+	if (version < INTEL_VGT_IF_VERSION_REQUIRED) {
 		DRM_INFO("VGT interface version mismatch!\n");
 		return;
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
@ 2017-06-05  3:25 ` Patchwork
  2017-06-05 13:40 ` [PATCH] " Joonas Lahtinen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-06-05  3:25 UTC (permalink / raw)
  To: Zhenyu Wang; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix GVT-g PVINFO version compatibility check
URL   : https://patchwork.freedesktop.org/series/25275/
State : warning

== Summary ==

Series 25275v1 drm/i915: Fix GVT-g PVINFO version compatibility check
https://patchwork.freedesktop.org/api/1.0/series/25275/revisions/1/mbox/

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test drv_module_reload:
        Subgroup basic-reload-final:
                pass       -> DMESG-WARN (fi-skl-6770hq)

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:444s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:438s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:587s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:516s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:494s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:499s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:436s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:421s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:420s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:496s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:461s
fi-kbl-7500u     total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18  time:477s
fi-kbl-7560u     total:278  pass:263  dwarn:5   dfail:0   fail:0   skip:10  time:563s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:456s
fi-skl-6700hq    total:278  pass:228  dwarn:1   dfail:0   fail:27  skip:22  time:401s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:466s
fi-skl-6770hq    total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10  time:501s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:434s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:535s
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29  time:411s

d919ad0d077110d2d48a4b7503ddc02c3864667d drm-tip: 2017y-06m-02d-21h-49m-57s UTC integration manifest
0c9adb6 drm/i915: Fix GVT-g PVINFO version compatibility check

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4872/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
  2017-06-05  3:25 ` ✗ Fi.CI.BAT: warning for " Patchwork
@ 2017-06-05 13:40 ` Joonas Lahtinen
  2017-06-07  9:16   ` Zhenyu Wang
  2017-06-08  6:58 ` [PATCH v2] " Zhenyu Wang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Joonas Lahtinen @ 2017-06-05 13:40 UTC (permalink / raw)
  To: Zhenyu Wang, intel-gfx, intel-gvt-dev


On ma, 2017-06-05 at 11:00 +0800, Zhenyu Wang wrote:
> Current it's strictly checked if PVINFO version matches 1.0
> for GVT-g i915 guest which doesn't help for compatibility at
> all and forces GVT-g host can't extend PVINFO easily with version
> bump for real compatibility check.
> 
> This fixes that to check minimal required PVINFO version instead
> and currently minimal 1.0 is required.
> 
> Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: stable@vger.kernel.org # 4.10+
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_pvinfo.h
> @@ -37,7 +37,8 @@
>  #define VGT_VERSION_MINOR 0
>  
>  #define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
> -#define INTEL_VGT_IF_VERSION \
> +/* minimal required PVINFO version */
> +#define INTEL_VGT_IF_VERSION_REQUIRED \
>  	INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)

I think this can be dropped completely.

> @@ -72,7 +72,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
>  	version = INTEL_VGT_IF_VERSION_ENCODE(
>  		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
>  		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));

Here one would check that

	if (version_major != VGT_VERSION_MAJOR)
 		DRM_INFO("VGT interface version mismatch!\n");
		return;
	}

That makes sure that major version must always match (incrementing
major version is a direct indication of interface incompatibility). I'm
not sure if we want to check the minor version at all, at load time.

Instead we should check the minor version for each new feature we know
has been added. That way an older i915 module could keep running in the
DOM0, and the newer i915 modules in VMs just wouldn't attempt to use
the new features until the DOM0 gets an update, too.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-05 13:40 ` [PATCH] " Joonas Lahtinen
@ 2017-06-07  9:16   ` Zhenyu Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2017-06-07  9:16 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: intel-gfx, intel-gvt-dev


[-- Attachment #1.1: Type: text/plain, Size: 2632 bytes --]

On 2017.06.05 16:40:09 +0300, Joonas Lahtinen wrote:
> 
> On ma, 2017-06-05 at 11:00 +0800, Zhenyu Wang wrote:
> > Current it's strictly checked if PVINFO version matches 1.0
> > for GVT-g i915 guest which doesn't help for compatibility at
> > all and forces GVT-g host can't extend PVINFO easily with version
> > bump for real compatibility check.
> > 
> > This fixes that to check minimal required PVINFO version instead
> > and currently minimal 1.0 is required.
> > 
> > Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: stable@vger.kernel.org # 4.10+
> > Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> 
> <SNIP>
> 
> > +++ b/drivers/gpu/drm/i915/i915_pvinfo.h
> > @@ -37,7 +37,8 @@
> >  #define VGT_VERSION_MINOR 0
> >  
> >  #define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
> > -#define INTEL_VGT_IF_VERSION \
> > +/* minimal required PVINFO version */
> > +#define INTEL_VGT_IF_VERSION_REQUIRED \
> >  	INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)
> 
> I think this can be dropped completely.
> 
> > @@ -72,7 +72,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
> >  	version = INTEL_VGT_IF_VERSION_ENCODE(
> >  		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
> >  		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
> 
> Here one would check that
> 
> 	if (version_major != VGT_VERSION_MAJOR)
>  		DRM_INFO("VGT interface version mismatch!\n");
> 		return;
> 	}
> 
> That makes sure that major version must always match (incrementing
> major version is a direct indication of interface incompatibility). I'm
> not sure if we want to check the minor version at all, at load time.

We only plan to extend PVInfo definition (use previous reserved/unused
area) but not break compatibility as no requirement to do
incompatibility change for pvinfo, so like to keep compat with older
kernel. So this version check is just for sanity on minimal require,
agree to only check major is enough.

> 
> Instead we should check the minor version for each new feature we know
> has been added. That way an older i915 module could keep running in the
> DOM0, and the newer i915 modules in VMs just wouldn't attempt to use
> the new features until the DOM0 gets an update, too.
> 

yeah, minor version would be bumped for each new feature support, e.g
guc/huc for guest etc, structural extension will get major version
bumped.

-- 
Open Source Technology Center, Intel ltd.

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
  2017-06-05  3:25 ` ✗ Fi.CI.BAT: warning for " Patchwork
  2017-06-05 13:40 ` [PATCH] " Joonas Lahtinen
@ 2017-06-08  6:58 ` Zhenyu Wang
  2017-06-08  9:17   ` Joonas Lahtinen
  2017-06-09  7:48   ` [PATCH v3] " Zhenyu Wang
  2017-06-08  7:27 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev2) Patchwork
  2017-06-09  8:10 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3) Patchwork
  4 siblings, 2 replies; 10+ messages in thread
From: Zhenyu Wang @ 2017-06-08  6:58 UTC (permalink / raw)
  To: intel-gfx, intel-gvt-dev
  Cc: Chuanxiao Dong, Joonas Lahtinen, stable, #, v4.10+

Current it's strictly checked if PVINFO version matches 1.0
for GVT-g i915 guest which doesn't help for compatibility at
all and forces GVT-g host can't extend PVINFO easily with version
bump for real compatibility check.

This fixes that to check minimal required PVINFO version instead.

v2:
- drop unneeded version macro
- use only major version for sanity check

Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org # v4.10+
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pvinfo.h | 4 ----
 drivers/gpu/drm/i915/i915_vgpu.c   | 9 ++++-----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index c0cb2974caac..928f600c875a 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -36,10 +36,6 @@
 #define VGT_VERSION_MAJOR 1
 #define VGT_VERSION_MINOR 0
 
-#define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
-#define INTEL_VGT_IF_VERSION \
-	INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)
-
 /*
  * notifications from guest to vgpu device model
  */
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 3791e9c9392f..25f2a76f17e9 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -61,7 +61,7 @@
 void i915_check_vgpu(struct drm_i915_private *dev_priv)
 {
 	uint64_t magic;
-	uint32_t version;
+	uint32_t version_major;
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
@@ -69,10 +69,9 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	if (magic != VGT_MAGIC)
 		return;
 
-	version = INTEL_VGT_IF_VERSION_ENCODE(
-		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
-		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
-	if (version != INTEL_VGT_IF_VERSION) {
+	version_major = __raw_i915_read16(dev_priv,
+					  vgtif_reg(version_major));
+	if (version_major < VGT_VERSION_MAJOR) {
 		DRM_INFO("VGT interface version mismatch!\n");
 		return;
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev2)
  2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
                   ` (2 preceding siblings ...)
  2017-06-08  6:58 ` [PATCH v2] " Zhenyu Wang
@ 2017-06-08  7:27 ` Patchwork
  2017-06-09  8:10 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3) Patchwork
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-06-08  7:27 UTC (permalink / raw)
  To: Zhenyu Wang; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix GVT-g PVINFO version compatibility check (rev2)
URL   : https://patchwork.freedesktop.org/series/25275/
State : success

== Summary ==

Series 25275v2 drm/i915: Fix GVT-g PVINFO version compatibility check
https://patchwork.freedesktop.org/api/1.0/series/25275/revisions/2/mbox/

Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                dmesg-warn -> PASS       (fi-kbl-r) fdo#100125
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-skl-6700hq) fdo#100461

fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fdo#100461 https://bugs.freedesktop.org/show_bug.cgi?id=100461

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:446s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:440s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:576s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:516s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:487s
fi-glk-2a        total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:584s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:427s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:411s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:420s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:501s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:459s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:468s
fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:579s
fi-kbl-r         total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:576s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:458s
fi-skl-6700hq    total:278  pass:228  dwarn:1   dfail:0   fail:27  skip:22  time:398s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:468s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:443s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:537s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time:402s

64f82c4142fd563bb5b1f3406369e90b072c7c4c drm-tip: 2017y-06m-07d-16h-03m-00s UTC integration manifest
b14a3e2 drm/i915: Fix GVT-g PVINFO version compatibility check

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4905/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-08  6:58 ` [PATCH v2] " Zhenyu Wang
@ 2017-06-08  9:17   ` Joonas Lahtinen
  2017-06-09  7:48   ` [PATCH v3] " Zhenyu Wang
  1 sibling, 0 replies; 10+ messages in thread
From: Joonas Lahtinen @ 2017-06-08  9:17 UTC (permalink / raw)
  To: Zhenyu Wang, intel-gfx, intel-gvt-dev

On to, 2017-06-08 at 14:58 +0800, Zhenyu Wang wrote:
> Current it's strictly checked if PVINFO version matches 1.0
> for GVT-g i915 guest which doesn't help for compatibility at
> all and forces GVT-g host can't extend PVINFO easily with version
> bump for real compatibility check.
> 
> This fixes that to check minimal required PVINFO version instead.
> 
> v2:
> - drop unneeded version macro
> - use only major version for sanity check
> 
> Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: stable@vger.kernel.org # v4.10+
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_vgpu.c
> @@ -61,7 +61,7 @@
>  void i915_check_vgpu(struct drm_i915_private *dev_priv)
>  {
>  	uint64_t magic;
> -	uint32_t version;
> +	uint32_t version_major;

Just a final tune, change these types into u64 and u32 respectively.

>  
>  	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
>  
> @@ -69,10 +69,9 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
>  	if (magic != VGT_MAGIC)
>  		return;
>  
> -	version = INTEL_VGT_IF_VERSION_ENCODE(
> -		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
> -		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
> -	if (version != INTEL_VGT_IF_VERSION) {
> +	version_major = __raw_i915_read16(dev_priv,
> +					  vgtif_reg(version_major));

This assignment fits a single line now.

Then this is;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3] drm/i915: Fix GVT-g PVINFO version compatibility check
  2017-06-08  6:58 ` [PATCH v2] " Zhenyu Wang
  2017-06-08  9:17   ` Joonas Lahtinen
@ 2017-06-09  7:48   ` Zhenyu Wang
  1 sibling, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2017-06-09  7:48 UTC (permalink / raw)
  To: intel-gfx, intel-gvt-dev
  Cc: Chuanxiao Dong, Joonas Lahtinen, stable, #, v4.10+

Current it's strictly checked if PVINFO version matches 1.0
for GVT-g i915 guest which doesn't help for compatibility at
all and forces GVT-g host can't extend PVINFO easily with version
bump for real compatibility check.

This fixes that to check minimal required PVINFO version instead.

v2:
- drop unneeded version macro
- use only major version for sanity check

v3:
- fix up PVInfo value with kernel type
- one indent fix

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org # v4.10+
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pvinfo.h |  8 ++------
 drivers/gpu/drm/i915/i915_vgpu.c   | 10 ++++------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index c0cb2974caac..2cfe96d3e5d1 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -36,10 +36,6 @@
 #define VGT_VERSION_MAJOR 1
 #define VGT_VERSION_MINOR 0
 
-#define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
-#define INTEL_VGT_IF_VERSION \
-	INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)
-
 /*
  * notifications from guest to vgpu device model
  */
@@ -55,8 +51,8 @@ enum vgt_g2v_type {
 
 struct vgt_if {
 	u64 magic;		/* VGT_MAGIC */
-	uint16_t version_major;
-	uint16_t version_minor;
+	u16 version_major;
+	u16 version_minor;
 	u32 vgt_id;		/* ID of vGT instance */
 	u32 rsv1[12];		/* pad to offset 0x40 */
 	/*
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 3791e9c9392f..cf7a958e4d3c 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -60,8 +60,8 @@
  */
 void i915_check_vgpu(struct drm_i915_private *dev_priv)
 {
-	uint64_t magic;
-	uint32_t version;
+	u64 magic;
+	u16 version_major;
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
@@ -69,10 +69,8 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	if (magic != VGT_MAGIC)
 		return;
 
-	version = INTEL_VGT_IF_VERSION_ENCODE(
-		__raw_i915_read16(dev_priv, vgtif_reg(version_major)),
-		__raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
-	if (version != INTEL_VGT_IF_VERSION) {
+	version_major = __raw_i915_read16(dev_priv, vgtif_reg(version_major));
+	if (version_major < VGT_VERSION_MAJOR) {
 		DRM_INFO("VGT interface version mismatch!\n");
 		return;
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3)
  2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
                   ` (3 preceding siblings ...)
  2017-06-08  7:27 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev2) Patchwork
@ 2017-06-09  8:10 ` Patchwork
  2017-06-12 12:46   ` Joonas Lahtinen
  4 siblings, 1 reply; 10+ messages in thread
From: Patchwork @ 2017-06-09  8:10 UTC (permalink / raw)
  To: Zhenyu Wang; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix GVT-g PVINFO version compatibility check (rev3)
URL   : https://patchwork.freedesktop.org/series/25275/
State : success

== Summary ==

Series 25275v3 drm/i915: Fix GVT-g PVINFO version compatibility check
https://patchwork.freedesktop.org/api/1.0/series/25275/revisions/3/mbox/

Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-kbl-7560u) fdo#100125
Test kms_busy:
        Subgroup basic-flip-default-a:
                dmesg-warn -> PASS       (fi-skl-6700hq) fdo#101144 +3
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-skl-6700hq) fdo#101154 +24
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                skip       -> PASS       (fi-skl-6700hq)
        Subgroup basic-flip-vs-wf_vblank:
                skip       -> PASS       (fi-skl-6700hq) fdo#99739
        Subgroup basic-plain-flip:
                skip       -> PASS       (fi-skl-6700hq)
Test kms_frontbuffer_tracking:
        Subgroup basic:
                skip       -> PASS       (fi-skl-6700hq)

fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144
fdo#101154 https://bugs.freedesktop.org/show_bug.cgi?id=101154
fdo#99739 https://bugs.freedesktop.org/show_bug.cgi?id=99739

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:439s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:432s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:583s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:513s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:486s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:484s
fi-glk-2a        total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:596s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:430s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:418s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:419s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:492s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:470s
fi-kbl-7560u     total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10  time:572s
fi-kbl-r         total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18  time:575s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:448s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time:579s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:463s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:501s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:444s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:534s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time:401s

5b363842b49a66879d4c67d652923fb04e44b271 drm-tip: 2017y-06m-08d-20h-34m-37s UTC integration manifest
f6f6e657 drm/i915: Fix GVT-g PVINFO version compatibility check

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4922/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3)
  2017-06-09  8:10 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3) Patchwork
@ 2017-06-12 12:46   ` Joonas Lahtinen
  0 siblings, 0 replies; 10+ messages in thread
From: Joonas Lahtinen @ 2017-06-12 12:46 UTC (permalink / raw)
  To: intel-gfx, Zhenyu Wang

On pe, 2017-06-09 at 08:10 +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Fix GVT-g PVINFO version compatibility check (rev3)
> URL   : https://patchwork.freedesktop.org/series/25275/
> State : success

Applied. Thanks for the patch.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-12 12:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05  3:00 [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check Zhenyu Wang
2017-06-05  3:25 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-06-05 13:40 ` [PATCH] " Joonas Lahtinen
2017-06-07  9:16   ` Zhenyu Wang
2017-06-08  6:58 ` [PATCH v2] " Zhenyu Wang
2017-06-08  9:17   ` Joonas Lahtinen
2017-06-09  7:48   ` [PATCH v3] " Zhenyu Wang
2017-06-08  7:27 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev2) Patchwork
2017-06-09  8:10 ` ✓ Fi.CI.BAT: success for drm/i915: Fix GVT-g PVINFO version compatibility check (rev3) Patchwork
2017-06-12 12:46   ` Joonas Lahtinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.