Received: by 10.192.165.156 with SMTP id m28csp1133257imm; Mon, 16 Apr 2018 14:50:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3ORkKf1+mLonw+dDfll2KG4aUXZpEvz4JEkMmWyN9FArUwYCsXXzu/qTjnu6FrIIZHVdw X-Received: by 10.99.189.82 with SMTP id d18mr4734929pgp.311.1523915401315; Mon, 16 Apr 2018 14:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915401; cv=none; d=google.com; s=arc-20160816; b=qJMdNuDgIhRv2qxVL3VJT+1oR1sYo4Q/V5J5bmS3vIDPVDuIZMuaeL1xHjY8CTeW7U R+MeuwJtjUjk9kSyp15zUNvlGICjk8dBWKADNYT+Ff9Bp8bbPziSEkh4auNuRirmyff9 L1Q7VbabxROO1aMKl428DSUtPRcYxOHb/YEiFYmKb6rcbxYPOwmTEvt0Uic5k8zHdG8o Zqd953d/Gz+mUcI3Q+XRPOhAngHAfaKG+z/2AD/XL5QatcOw5bEPjV+CC0gdcoNq6eSF HXX+6qGNNW/RRaEeM9rJIc2mLZG1hpPKEctT+cdS/QYWsNQwpCrKYDF8o7YEFbJlXlXP h8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gpL1yKAn4vTIIPj+2YRp2a32xwSR212L6qyEpVFXbDQ=; b=0D7flik+/+IjWKJ3MKXwS9t+PKT96y95J7wrMcBOnYpczxdFIZCaGxqCqp8mUSxMZW u3Y7QZw6lQ28YKFcGimywHNm5Hsc9B/dPMjE4Xc309bRByE8JweSWA2AldKfcS30Xr+2 JZTqbVQPCMdoN2BTJtvpRPnKyMX5SV8KSNvyoZYaxDbfbUBOpJa+PmeWAVv8x4Gg5Lls V8XluOUh6VABJxw3bFwwLuKGN6PpXhBaFWPalf5dOln+bGcGn6WcjFqaYg36vxcIH8aI DEBiULpCmQILslbWdUHX4NMVkgPVVNKOEz2PBUnrQS6Bk8XGgztZpH0h3vpjMmr6pjy/ ESYQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si10506797pgu.285.2018.04.16.14.49.46; Mon, 16 Apr 2018 14:50:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753241AbeDPVrm (ORCPT + 99 others); Mon, 16 Apr 2018 17:47:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:12291 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbeDPVqu (ORCPT ); Mon, 16 Apr 2018 17:46:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 14:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740194" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:43 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Jean-Philippe Brucker Cc: Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , "Christoph Hellwig" , "Lu Baolu" , Jacob Pan Subject: [PATCH v4 19/22] iommu/intel-svm: do not flush iotlb for viommu Date: Mon, 16 Apr 2018 14:49:08 -0700 Message-Id: <1523915351-54415-20-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vIOMMU passdown invalidation will be inclusive, PASID cache invalidation includes TLBs. See Intel VT-d Specification Ch 6.5.2.2 for details. Signed-off-by: Jacob Pan --- drivers/iommu/intel-svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index bdda1b6..697d5c2 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -284,7 +284,9 @@ static void intel_mm_release(struct mmu_notifier *mn, struct mm_struct *mm) rcu_read_lock(); list_for_each_entry_rcu(sdev, &svm->devs, list) { intel_flush_pasid_dev(svm, sdev, svm->pasid); - intel_flush_svm_range_dev(svm, sdev, 0, -1, 0, !svm->mm); + /* for emulated iommu, PASID cache invalidation implies IOTLB/DTLB */ + if (!cap_caching_mode(svm->iommu->cap)) + intel_flush_svm_range_dev(svm, sdev, 0, -1, 0, !svm->mm); } rcu_read_unlock(); -- 2.7.4