From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81DCAC433E0 for ; Thu, 28 Jan 2021 12:51:21 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C20EF64DE3 for ; Thu, 28 Jan 2021 12:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C20EF64DE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3788A2DFF8; Thu, 28 Jan 2021 12:51:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HuNDuY8q7Ifi; Thu, 28 Jan 2021 12:51:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 23EA720358; Thu, 28 Jan 2021 12:51:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E257FC08A1; Thu, 28 Jan 2021 12:51:18 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id EF892C013A for ; Thu, 28 Jan 2021 12:51:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D11DD873BC for ; Thu, 28 Jan 2021 12:51:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e18afUru3p0Y for ; Thu, 28 Jan 2021 12:51:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by hemlock.osuosl.org (Postfix) with ESMTPS id CB1D9873AB for ; Thu, 28 Jan 2021 12:51:15 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id 0B69051D; Thu, 28 Jan 2021 13:51:13 +0100 (CET) Date: Thu, 28 Jan 2021 13:51:12 +0100 From: Joerg Roedel To: Chuck Lever Subject: Re: [PATCH RFC 2/9] iommu: Add iova and size as parameters in iotlb_sync_map Message-ID: <20210128125112.GN32671@8bytes.org> References: <161177711359.1311.417185373365934204.stgit@manet.1015granger.net> <161177763296.1311.15197214300351076283.stgit@manet.1015granger.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <161177763296.1311.15197214300351076283.stgit@manet.1015granger.net> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: isaacm@codeaurora.org, robin.murphy@arm.com, iommu@lists.linux-foundation.org, will@kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi Chuck, thanks for your optimizations! On Wed, Jan 27, 2021 at 03:00:32PM -0500, Chuck Lever wrote: > From: Yong Wu > > iotlb_sync_map allow IOMMU drivers tlb sync after completing the whole > mapping. This patch adds iova and size as the parameters in it. then the > IOMMU driver could flush tlb with the whole range once after iova mapping > to improve performance. > > Signed-off-by: Yong Wu > Reviewed-by: Robin Murphy > Signed-off-by: Chuck Lever > --- > drivers/iommu/iommu.c | 4 ++-- > drivers/iommu/tegra-gart.c | 7 +++++-- > include/linux/iommu.h | 3 ++- > 3 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index c304a6a30d42..3d099a31ddca 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -2443,7 +2443,7 @@ static int _iommu_map(struct iommu_domain *domain, unsigned long iova, > > ret = __iommu_map(domain, iova, paddr, size, prot, GFP_KERNEL); > if (ret == 0 && ops->iotlb_sync_map) > - ops->iotlb_sync_map(domain); > + ops->iotlb_sync_map(domain, iova, size); How about using 'struct iommu_iotlb_gather' instead of directly passing the iova/size parameters here? The iotlb_sync() call-back uses it already. Regards, Joerg _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu