Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2931206ybb; Mon, 30 Mar 2020 16:20:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsD6T1OeybhzQg+3k8+4mtdgZmoERS54gTo27LgmfPFWqX6PidhMOz7GsyzuZNqB89kzqLC X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr311473oij.161.1585610437613; Mon, 30 Mar 2020 16:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585610437; cv=none; d=google.com; s=arc-20160816; b=wi+Ph4rLOFkRZTijyG1h7TEY6ru1T36mk/IACaNAr8i5qCkAOUlJqsx4vzrjf2Z5VJ rbtmzZ5YHn3jL3BXRXSO8i37fNupVlSnVDqBaL45MCSiYXiq0gf6ANAmHGRTwOEpr8Tm XkbKzXpN8EoXDQ8TCFFWHu3QsIzwXKkQ+6tEPyISuwmfb3efIOE+uuFMMcYIn18hbz/Z gysh07Jb59EVNPTj32IYIlE4i2t583QQbJ+EHVSBcVeRGDOJQY7l3lQzTTLaPin6W2WN 0P36MbEF6jnjhHYCpSoS0vrOCwWeh9xzyc9B6SlzlijtEn3kT8FxdPNTeufVsM/W2Vhm chxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=gHejGxvSFiP8RDmwiCiAW6thJe6xh2ODNmKCQ+Il+ag=; b=uujf6OoZXjGTc4MdT4CuJejNK9gDISUxt8U5f/1yoFZrK0e+zqjuurEmW/53cdert/ lg7MzN82R5oxT3WQR4SCdWRRBD0KpiVMbmn6FZVSMJGdHTnhf1D7lHmvZF7FEPwZRWYC xloE8C9o/1EqI7MKeT4NSbN7fzssQYDbdEB1pEkPCk95OSd1CPvHzN1y0W5JXJowErJm C3Q4WPLGoQ7PvWV9JymSAmvJdwPGwLXaHkroE9U03dAB3Z9UWzyqRB/3SHpJ1uE9jjFC LmzlDmlg1YKqPPa+I7sgOP9wPwIvTALrBymTmNbI/yCSgipMpY8oxMWxMq2ybPdrzDod 9dtg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si3861200otq.113.2020.03.30.16.20.24; Mon, 30 Mar 2020 16:20:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729283AbgC3XTk (ORCPT + 99 others); Mon, 30 Mar 2020 19:19:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:65221 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728880AbgC3XTk (ORCPT ); Mon, 30 Mar 2020 19:19:40 -0400 IronPort-SDR: F6XdNkQ5Jv2msHvS2VnTj8RqMcziqmVEXjrv4TGS1f4kl/jhlejNtSjBiNZ6uNaJATu/7noGPz b9645O/wKFCw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 16:19:39 -0700 IronPort-SDR: XqEVJd/kWbEn0s8VDVUm9de+vtDVNtM5MACvHVdcc6uljs6sq9tiErwaXHEmp/e2N1OF9Vi0RE T+GWPhlNNZPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,326,1580803200"; d="scan'208";a="248867857" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga003.jf.intel.com with ESMTP; 30 Mar 2020 16:19:39 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , "Lu Baolu" Cc: Raj Ashok , Jacob Pan , Eric Auger Subject: [PATCH] iommu/vt-d: Fix PASID cache flush Date: Mon, 30 Mar 2020 16:25:25 -0700 Message-Id: <1585610725-78316-1-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.7.4