From patchwork Mon Jun 5 03:00:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 9765349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E872260353 for ; Mon, 5 Jun 2017 03:04:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4B5825E13 for ; Mon, 5 Jun 2017 03:04:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C642226E40; Mon, 5 Jun 2017 03:04:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D419125E13 for ; Mon, 5 Jun 2017 03:04:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 681B289C88; Mon, 5 Jun 2017 03:04:28 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0046289C88; Mon, 5 Jun 2017 03:04:26 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2017 20:04:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,299,1493708400"; d="scan'208";a="864544643" Received: from debian-nuc.sh.intel.com ([10.239.13.2]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jun 2017 20:04:24 -0700 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org Date: Mon, 5 Jun 2017 11:00:41 +0800 Message-Id: <20170605030041.9619-1-zhenyuw@linux.intel.com> X-Mailer: git-send-email 2.11.0 Cc: 4.10+@freedesktop.org, #@freedesktop.org, stable@vger.kernel.org Subject: [Intel-gfx] [PATCH] drm/i915: Fix GVT-g PVINFO version compatibility check X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Joonas Lahtinen Cc: stable@vger.kernel.org # 4.10+ Signed-off-by: Zhenyu Wang --- 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; }