Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3332754ybc; Mon, 18 Nov 2019 13:29:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwnWCg85osdZ+uuu0sS4LE1FcCHFUBKCov/tG0fjxo5rOOGrfbxY52ksQwPnfEfeIJcSJQO X-Received: by 2002:a17:906:944d:: with SMTP id z13mr29556286ejx.58.1574112555026; Mon, 18 Nov 2019 13:29:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574112555; cv=none; d=google.com; s=arc-20160816; b=zQwhDihKZObm7cgLWR702JK8yqHRRPUWwEFgRr6opo/GLXw2IT44ozq5N9nh7XjIN6 E5jKg0U1FvpTReZxGMdE7Zesodzi0ZNalEqx/jg58OOxF/n0iMn1tRDLxSKdkawtc3be lrtq/hUVw2NJ7HXBFs6BaFphuqMXpt0zoOT5uVkOJz+siU3PUAsVJgTM0VJj5BCCskk8 m0sCZ8sOqGE+Hu3es7OE/pv9dQDPHHFV5DT+6c+jt09ZOqQk3gEVsf3WiuK/BN0KJ5QF OV06sx0wHgLxkdZyw8S2FKKf5c+neXIoWz+iKfXjm41pdbZBHdNLBAel+dDQI+RoTNkG KIIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=H2ueiIRt7fqjanQS0GX2y/MsXFCxWQAcy1vqFBO38zo=; b=WrKRs5Jsl/HB2GtN9t/qW2nkH251yq8AZ3qy38kR3xJS2tcJ8qNA5SmV1aAaN8Rvdt NNG3uQVJpEvcMMLJTHcRXBIsARxxve+I3N4m3Gq3APEXt6NmQnwZZo5Zzo/o/Zhm7kqp pOj8B76AqGqt4CBzjLiMtG7elbnhLfEBIKeCiNozl4ouMYYk442JHNa4+PvUzggbFCgt 9XNSMtG7/T/1SQFdm/g5cGbBDAmZEqmC+gQ/yTi8xl84gJ+JEh3V6MlU9M1P+t8pbHfn ECbBth3H7G4NpDumt2iCV4lSFAbsIQJrRX8yaZmZKgpEu+d3QuPhh+SCCT0e6L4Cvx7l teOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="iPPhfX7/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si12273219ejx.132.2019.11.18.13.28.51; Mon, 18 Nov 2019 13:29:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="iPPhfX7/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfKRV1K (ORCPT + 99 others); Mon, 18 Nov 2019 16:27:10 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:49461 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726272AbfKRV1K (ORCPT ); Mon, 18 Nov 2019 16:27:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574112429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H2ueiIRt7fqjanQS0GX2y/MsXFCxWQAcy1vqFBO38zo=; b=iPPhfX7/B0l631f4r9r8IM87GpS7cu1pZZ5ZABmbTBwIaDHJYdtgUJMoSiyiZJP22PFLBy oRmLJq+V1ZJwW3x6C4UJF/xwwyQWPxZv6Q9bSWcwYL5J2Eg74mm2OzM3HNWkyZD5GpNXr2 uYZ6upp+FIRvSmiDNCKosHOk0fZ1fBI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-83-zMDzssdpODa4prXTJjAb8w-1; Mon, 18 Nov 2019 16:27:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6EDD08E8046; Mon, 18 Nov 2019 21:27:04 +0000 (UTC) Received: from [10.36.116.37] (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF63F6055C; Mon, 18 Nov 2019 21:27:01 +0000 (UTC) Subject: Re: [PATCH v2 09/10] iommu/vt-d: Avoid sending invalid page response To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , Lu Baolu , David Woodhouse Cc: "Tian, Kevin" , Raj Ashok , Yi Liu References: <1574106153-45867-1-git-send-email-jacob.jun.pan@linux.intel.com> <1574106153-45867-10-git-send-email-jacob.jun.pan@linux.intel.com> From: Auger Eric Message-ID: Date: Mon, 18 Nov 2019 22:26:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1574106153-45867-10-git-send-email-jacob.jun.pan@linux.intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: zMDzssdpODa4prXTJjAb8w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacob, On 11/18/19 8:42 PM, Jacob Pan wrote: > Page responses should only be sent when last page in group (LPIG) or > private data is present in the page request. This patch avoids sending > invalid descriptors. >=20 > Fixes: 5d308fc1ecf53 ("iommu/vt-d: Add 256-bit invalidation descriptor > support") > Signed-off-by: Jacob Pan > Acked-by: Lu Baolu > --- > drivers/iommu/intel-svm.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c > index 26a2f57763ec..098c89246593 100644 > --- a/drivers/iommu/intel-svm.c > +++ b/drivers/iommu/intel-svm.c > @@ -688,11 +688,10 @@ static irqreturn_t prq_event_thread(int irq, void *= d) > =09=09=09if (req->priv_data_present) > =09=09=09=09memcpy(&resp.qw2, req->priv_data, > =09=09=09=09 sizeof(req->priv_data)); > +=09=09=09resp.qw2 =3D 0; > +=09=09=09resp.qw3 =3D 0; > +=09=09=09qi_submit_sync(&resp, iommu); OK so now all the qwords are initialized ;-) > =09=09} > -=09=09resp.qw2 =3D 0; > -=09=09resp.qw3 =3D 0; > -=09=09qi_submit_sync(&resp, iommu); > - > =09=09head =3D (head + sizeof(*req)) & PRQ_RING_MASK; > =09} > =20 >=20 Reviewed-by: Eric Auger Thanks Eric