Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DD91C43381 for ; Wed, 20 Feb 2019 05:22:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6515921773 for ; Wed, 20 Feb 2019 05:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbfBTFWx (ORCPT ); Wed, 20 Feb 2019 00:22:53 -0500 Received: from mga02.intel.com ([134.134.136.20]:52983 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfBTFWx (ORCPT ); Wed, 20 Feb 2019 00:22:53 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 21:22:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,388,1544515200"; d="asc'?scan'208";a="320470742" Received: from zhen-hp.sh.intel.com (HELO zhen-hp) ([10.239.13.116]) by fmsmga006.fm.intel.com with ESMTP; 19 Feb 2019 21:22:51 -0800 Date: Wed, 20 Feb 2019 13:13:19 +0800 From: Zhenyu Wang To: "Zhao, Yan Y" Cc: "intel-gvt-dev@lists.freedesktop.org" , "stable@vger.kernel.org" Subject: Re: [PATCH] drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct index check Message-ID: <20190220051319.GB12380@zhen-hp.sh.intel.com> Reply-To: Zhenyu Wang References: <20190218064653.26020-1-zhenyuw@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YBGzgpgHAney5ErF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --YBGzgpgHAney5ErF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019.02.19 03:30:43 +0000, Zhao, Yan Y wrote: > Do we need to check whether the index is in DWORD or QWORD, which is spec= ified in DWORD 0 of the command? > That is for MI_FLUSH_DW cmd length instead of index size I believe. And index is always Qword aligned, but take steps of u32. So this patch is to fix the upper bound. > BTW, maybe we also need to check whether gma is QWORD aligned ? > Current code did masking on it before checking gma.. > > -----Original Message----- > > From: intel-gvt-dev [mailto:intel-gvt-dev-bounces@lists.freedesktop.org= ] On > > Behalf Of Zhenyu Wang > > Sent: Monday, February 18, 2019 2:47 PM > > To: intel-gvt-dev@lists.freedesktop.org > > Cc: stable@vger.kernel.org > > Subject: [PATCH] drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct ind= ex > > check > >=20 > > When MI_FLUSH_DW post write hw status page in index mode, the index val= ue > > is in dword step. This fixes wrong qword step in cmd parser code which > > incorrectly stopped VM for invalid MI_FLUSH_DW write index. > >=20 > > Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner") > > Cc: stable@vger.kernel.org # v4.10+ > > Signed-off-by: Zhenyu Wang > > --- > > drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c > > b/drivers/gpu/drm/i915/gvt/cmd_parser.c > > index 35b4ec3f7618..d42f7a2dc82f 100644 > > --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c > > +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c > > @@ -1441,7 +1441,7 @@ static inline int cmd_address_audit(struct > > parser_exec_state *s, > > } > >=20 > > if (index_mode) { > > - if (guest_gma >=3D I915_GTT_PAGE_SIZE / sizeof(u64)) { > > + if (guest_gma >=3D I915_GTT_PAGE_SIZE / sizeof(u32)) { > > ret =3D -EFAULT; > > goto err; > > } > > -- > > 2.20.1 > >=20 > > _______________________________________________ > > intel-gvt-dev mailing list > > intel-gvt-dev@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev > _______________________________________________ > intel-gvt-dev mailing list > intel-gvt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --YBGzgpgHAney5ErF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCXGzh7wAKCRCxBBozTXgY J+tdAJ9gle3az5xe1GyCaLe9/JiFm57HtgCggt3OQwkmAo9N0R1Va1SBsf88PRE= =QFJe -----END PGP SIGNATURE----- --YBGzgpgHAney5ErF--