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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 BD251C43460 for ; Thu, 1 Apr 2021 16:50:29 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4BD206120D for ; Thu, 1 Apr 2021 16:50:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BD206120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/TGgnhZO50HGdLPjgqUJkDpyWfcRl1kYFGAE6wcF5Cw=; b=klbPL2CDk/kR8w1S41FBd5BXQ 7HcGe+gw9UgYC3U3/oDLL70dej/bQ3Ky6jUfRGceDXBclSvdOZLRSf+D3P8xKwzkvuAa5PoZAD9bP TBX1BS6BLoRIPFhQN6VshbMIQWQllWzZmO1RWy1wOyYXyyiQJpciTLbVIO3rjzl9ODvUuP/JmjUHu DjiG20Z/cR7B3GExJpnI1dGKYz9XCUatVCFsrEezegUxycfyqlSzJtlcV50916X/tuQDR8lghmCky HZxQNKcfoZ2WG9EPyXCI/YsVY6N6LBPzi53D3oUaJ49ifNtD0jjSXHTINi0ApZlGL7eof/7sv6rYU y0OULyj1g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lS0V5-00ANmL-6F; Thu, 01 Apr 2021 16:48:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lS0Un-00ANia-37 for linux-arm-kernel@lists.infradead.org; Thu, 01 Apr 2021 16:48:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A013A61384; Thu, 1 Apr 2021 16:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617295715; bh=p4hoXNujhDB52s4CkDR3mvKvMLihsFk6ec9xg1tPeII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HjXHx5Wcc0eFWhBXlm6rO7YJkyJ7ISLX/ZG6hikgYM0O4Dv6A8PZ+BJvSevosmyID BMQHqPjKuj9LWOkmQBsN2muIcjZTGAE2S9vpZ0sZyqdl7coMotpFWX4qkB9DASdAdA 8MOYbNkn1wTKrQKd9ElOL38sqBegH///SqfyTM38A9hpPK/aN5tj6UmNSjt5wr21zl BEE7c57t1BkZB+Txn4rPCbRMopaWbR81Q0MfM4/F0ybVIPYJcb5sQmEA17MS2mYWRv 6cJA2/T8yfcQnbM5oXhZ76tbrih3c8kbk+J0gmyWhpKEDFlqjqyaLgPyIOPNP5j71X YE5ETBtoFYGLA== From: Will Deacon To: iommu@lists.linux-foundation.org Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , "Isaac J. Manjarres" , Pratik Patel , Robin Murphy , Lu Baolu Subject: [RFC PATCH 2/6] iommu: Add an unmap_pages() op for IOMMU drivers Date: Thu, 1 Apr 2021 17:47:34 +0100 Message-Id: <20210401164738.9513-3-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210401164738.9513-1-will@kernel.org> References: <20210401164738.9513-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_174837_359563_BD180F54 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Isaac J. Manjarres" Add a callback for IOMMU drivers to provide a path for the IOMMU framework to call into an IOMMU driver, which can call into the io-pgtable code, to unmap a virtually contiguous range of pages of the same size. For IOMMU drivers that do not specify an unmap_pages() callback, the existing logic of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/iommu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 5e7fe519430a..9cf81242581a 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -193,6 +193,7 @@ struct iommu_iotlb_gather { * @detach_dev: detach device from an iommu domain * @map: map a physically contiguous memory region to an iommu domain * @unmap: unmap a physically contiguous memory region from an iommu domain + * @unmap_pages: unmap a number of pages of the same size from an iommu domain * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain * @iotlb_sync_map: Sync mappings created recently using @map to the hardware * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush @@ -245,6 +246,9 @@ struct iommu_ops { phys_addr_t paddr, size_t size, int prot, gfp_t gfp); size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, size_t size, struct iommu_iotlb_gather *iotlb_gather); + size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova, + size_t pgsize, size_t pgcount, + struct iommu_iotlb_gather *iotlb_gather); void (*flush_iotlb_all)(struct iommu_domain *domain); void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova, size_t size); -- 2.31.0.291.g576ba9dcdaf-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel