Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3303122ybb; Tue, 31 Mar 2020 02:29:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsKtsgcuylAt+kaSkuhbd8T7aua83soLj7ZhBQUjmOIiIlSB8r5m/7VRuiE+fajmn8gY7PL X-Received: by 2002:aca:4046:: with SMTP id n67mr1478090oia.156.1585646942670; Tue, 31 Mar 2020 02:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646942; cv=none; d=google.com; s=arc-20160816; b=ustqYippZh1eWWkeViD/mUHPVNZdIpiF3su9ZqzbDkWnNRaIR+wC+RgjdcGip5Oz1H HUiEerNnyJlkD+ECNuKTYXOcJ41XrKx2RoauqTRJsZgkJGP6vQXPWTc6uD87KO0GMBKB fuOCTOMB6sqJCbaAGjcQ4vJGcOd+dg9gFSojK+2XQnXh3v6mVgzIy0UKBIRR+3biEFgF xYccq/J0G804Z5QK6sTJh606BrFsIHqt/0QDcXe6v92p2KJ5w8Wrc9vSJypOwkM49gYT F4to243HrdeXkptd+epm9JDbj8DnOxiG9O4R298Itf4UNuH0v8tYTcLaXPP8H82HAfzN X3tQ== 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=//E29gBKS0R3M2BLI8jALgB6AWrOyofC4LvAyn35IUU=; b=f+kir8R2PwpPMxtDkeEhGx3IEesGUtYmxonNHFUCeri18W918/Y4dC2mxQo/5sMh9K YZwnZ8ZD5r7QHrVfPbqMzloMPOzsvfLs4wCKcteZokjEihHeEWn5l9Nk0fsssNcPkok5 IjiPZ2bKkri+Po2ermMaHt5NoI22JCogTA08+1G9VNLndApYGnb/qR+nYZUGOGk8lti9 rfhPOYe2n8u3CVzJ9EQ/1K5qQKZIKRvc2gzWfyKiUYRtmDhh6pQbQ7xXqY/lrYP4CPIa WkA3PKOuszD5CEDeZq3Q09SPbX1LEgQjWQqx5XCPudzQb1R+7cN4+4djrNushDkqm/TZ NJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BzYVMoYo; 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 c133si7370227oif.272.2020.03.31.02.28.49; Tue, 31 Mar 2020 02:29:02 -0700 (PDT) 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=BzYVMoYo; 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 S1730376AbgCaJ21 (ORCPT + 99 others); Tue, 31 Mar 2020 05:28:27 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:35382 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730031AbgCaJ21 (ORCPT ); Tue, 31 Mar 2020 05:28:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585646906; 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=//E29gBKS0R3M2BLI8jALgB6AWrOyofC4LvAyn35IUU=; b=BzYVMoYoTddBoWK23AzCi5K/puQOjtTx4TfJUqhy8bXULwp9m9yTd9gx8/wr2Gk/Eklv6c d9chSFOvT9RUEzDmn8GL4wSmnT04stQEWspG2rVVAAxPXN2wSnl9tCDhbkgsSHIy7awyip /8lYjm+MXGW3s3hwB0/Xh7bkf/YMi5M= 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-418-kwx-1qeAOiShSC9ZnEZQvw-1; Tue, 31 Mar 2020 05:28:24 -0400 X-MC-Unique: kwx-1qeAOiShSC9ZnEZQvw-1 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 0CC18DBA7; Tue, 31 Mar 2020 09:28:23 +0000 (UTC) Received: from [10.36.112.58] (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF01050BEE; Tue, 31 Mar 2020 09:28:18 +0000 (UTC) Subject: Re: [PATCH] iommu/vt-d: Fix PASID cache flush To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Lu Baolu Cc: Raj Ashok References: <1585610725-78316-1-git-send-email-jacob.jun.pan@linux.intel.com> From: Auger Eric Message-ID: <53be1d27-6348-56db-7eac-6734f92f123d@redhat.com> Date: Tue, 31 Mar 2020 11:28:17 +0200 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: <1585610725-78316-1-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacob, On 3/31/20 1:25 AM, Jacob Pan wrote: > PASID cache type and shift of granularity bits are missing in > the current code. > > Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table > interface") > > Cc: Eric Auger > Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Thanks Eric > --- > drivers/iommu/intel-pasid.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/intel-pasid.c b/drivers/iommu/intel-pasid.c > index 22b30f10b396..57d05b0fbafc 100644 > --- a/drivers/iommu/intel-pasid.c > +++ b/drivers/iommu/intel-pasid.c > @@ -365,7 +365,8 @@ pasid_cache_invalidation_with_pasid(struct intel_iommu *iommu, > { > struct qi_desc desc; > > - desc.qw0 = QI_PC_DID(did) | QI_PC_PASID_SEL | QI_PC_PASID(pasid); > + desc.qw0 = QI_PC_DID(did) | QI_PC_GRAN(QI_PC_PASID_SEL) | > + QI_PC_PASID(pasid) | QI_PC_TYPE; > desc.qw1 = 0; > desc.qw2 = 0; > desc.qw3 = 0; >