From patchwork Thu Jun 23 15:31:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 909172 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5NFWmsu012382 for ; Thu, 23 Jun 2011 15:32:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759626Ab1FWPcO (ORCPT ); Thu, 23 Jun 2011 11:32:14 -0400 Received: from ch1ehsobe001.messaging.microsoft.com ([216.32.181.181]:33821 "EHLO CH1EHSOBE014.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758366Ab1FWPbp (ORCPT ); Thu, 23 Jun 2011 11:31:45 -0400 Received: from mail191-ch1-R.bigfish.com (216.32.181.173) by CH1EHSOBE014.bigfish.com (10.43.70.64) with Microsoft SMTP Server id 14.1.225.22; Thu, 23 Jun 2011 15:31:44 +0000 Received: from mail191-ch1 (localhost.localdomain [127.0.0.1]) by mail191-ch1-R.bigfish.com (Postfix) with ESMTP id 1627A1278142; Thu, 23 Jun 2011 15:31:44 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzz8275bhz32i668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI Received: from mail191-ch1 (localhost.localdomain [127.0.0.1]) by mail191-ch1 (MessageSwitch) id 1308843103911287_5373; Thu, 23 Jun 2011 15:31:43 +0000 (UTC) Received: from CH1EHSMHS026.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.240]) by mail191-ch1.bigfish.com (Postfix) with ESMTP id CD05619E804B; Thu, 23 Jun 2011 15:31:43 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by CH1EHSMHS026.bigfish.com (10.43.70.26) with Microsoft SMTP Server id 14.1.225.22; Thu, 23 Jun 2011 15:31:42 +0000 X-WSS-ID: 0LN91SQ-02-H67-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Axway MailGate 3.8.1) with ESMTP id 2C1BEC83E0; Thu, 23 Jun 2011 10:31:37 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Thu, 23 Jun 2011 10:32:30 -0500 Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 23 Jun 2011 10:31:40 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.83.0; Thu, 23 Jun 2011 11:31:37 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 818E249C5E5; Thu, 23 Jun 2011 16:31:36 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 5EDA1100261; Thu, 23 Jun 2011 17:31:36 +0200 (CEST) From: Joerg Roedel To: CC: , David Woodhouse , Ohad Ben-Cohen , David Brown , , Avi Kivity , Alex Williamson , Joerg Roedel Subject: [PATCH 1/2] iommu-api: Introduce iommu_comit function Date: Thu, 23 Jun 2011 17:31:22 +0200 Message-ID: <1308843083-10442-2-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1308843083-10442-1-git-send-email-joerg.roedel@amd.com> References: <1308843083-10442-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 23 Jun 2011 15:32:48 +0000 (UTC) This function will be used to coalesce cache-flushes required after a domain was changed. This should significantly improve performance in some cases. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 7 +++++++ include/linux/iommu.h | 6 ++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 6e6b6a1..4099cc6 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -122,3 +122,10 @@ int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) return iommu_ops->unmap(domain, iova, gfp_order); } EXPORT_SYMBOL_GPL(iommu_unmap); + +void iommu_commit(struct iommu_domain *domain) +{ + if (iommu_ops->commit) + iommu_ops->commit(domain); +} +EXPORT_SYMBOL_GPL(iommu_commit); diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9940319..dbb4324 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -47,6 +47,7 @@ struct iommu_ops { unsigned long iova); int (*domain_has_cap)(struct iommu_domain *domain, unsigned long cap); + void (*commit)(struct iommu_domain *domain); }; #ifdef CONFIG_IOMMU_API @@ -67,6 +68,7 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, unsigned long iova); extern int iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap); +extern void iommu_commit(struct iommu_domain *domain); #else /* CONFIG_IOMMU_API */ @@ -123,6 +125,10 @@ static inline int domain_has_cap(struct iommu_domain *domain, return 0; } +static inline void iommu_commit(struct iommu_domain *domain) +{ +} + #endif /* CONFIG_IOMMU_API */ #endif /* __LINUX_IOMMU_H */