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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 101C0C369D0 for ; Fri, 18 Apr 2025 16:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RdOu79RpWP9Rwts0iiSKkSUioVu0Bpfhp04EyAtc6tA=; b=ZcBN2g01Q6Y2xhipChllbozZWW rcBGvTALzfM18l69sQ61tZnv3BQeN5IziE0LhsYfjUu6+O2pPSvajDcCAlmUk42P1xXf5CZyPDOYA YM2L6BqvBF3GYUFcnX+mF5zdsYxRTpsdiawDqFdyFyKJzJUw1wT8IfhAFhODCIC/b5vrwFs3A/VGZ 9xz3TcrLjy0zS3VXS0yoPv2y5szs6p4dN42v3Tb/yZZB9jV6mp8AZgcwCtWmS9OKna6pFdzAYizcS rTMFlATJzhtjCz7tbUl72lTMFAqQYVynnGogA5ZCqFyZLKGfBnVNihsoDMuVwGhKpjuyUSxwo9Q0N /1PAPAuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5onW-0000000Gzsl-2iFH; Fri, 18 Apr 2025 16:42:38 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5fWL-0000000FJFT-0bec for linux-nvme@lists.infradead.org; Fri, 18 Apr 2025 06:48:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D611368474; Fri, 18 Apr 2025 06:47:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80C09C4CEED; Fri, 18 Apr 2025 06:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744958896; bh=nlY3wEh3C1IEo+kSRhyetcCIxn/sZk9XJjHYh0zo1y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uenu4mojsxkgpDo5apIoPvdB5TZ7+KyME7dRrsezlKFIzSNrqK0G6xnaj1lMmhtJg wJTNctFgkZizdGl1TqzRmL09k1+xz0tnpmPMjexc9xpeJvfDeuLQ4LYsQzlawKBCxB 1FZSP+CYslGLH9ayoD3ssQITRF4htPUkTw5R53V9MCsdAvWQAR+/usSZ7pXgH6Lk5d W6xt4cIXK16YUHoDSnZz+oSOqofM0WxvxEn9hm90qSpgE11qKEQVdipq46JN12PNH3 nvjN6kF40fxtXoDpCYfD1q6bh0Tb77gPByXyKgBr6e7PdcO1PZbRnLgjigChGvLqWP QFyBahGLt7GdQ== From: Leon Romanovsky To: Marek Szyprowski , Jens Axboe , Christoph Hellwig , Keith Busch Cc: Leon Romanovsky , Jake Edge , Jonathan Corbet , Jason Gunthorpe , Zhu Yanjun , Robin Murphy , Joerg Roedel , Will Deacon , Sagi Grimberg , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, Niklas Schnelle , Chuck Lever , Luis Chamberlain , Matthew Wilcox , Dan Williams , Kanchan Joshi , Chaitanya Kulkarni , Jason Gunthorpe Subject: [PATCH v8 04/24] iommu: add kernel-doc for iommu_unmap and iommu_unmap_fast Date: Fri, 18 Apr 2025 09:47:34 +0300 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 18 Apr 2025 09:39:28 -0700 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Leon Romanovsky Add kernel-doc section for iommu_unmap and iommu_unmap_fast to document existing limitation of underlying functions which can't split individual ranges. Suggested-by: Jason Gunthorpe Acked-by: Will Deacon Reviewed-by: Christoph Hellwig Signed-off-by: Leon Romanovsky --- drivers/iommu/iommu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 3dc47f62d9ff..66b0bf6418ef 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2618,6 +2618,25 @@ size_t iommu_unmap(struct iommu_domain *domain, } EXPORT_SYMBOL_GPL(iommu_unmap); +/** + * iommu_unmap_fast() - Remove mappings from a range of IOVA without IOTLB sync + * @domain: Domain to manipulate + * @iova: IO virtual address to start + * @size: Length of the range starting from @iova + * @iotlb_gather: range information for a pending IOTLB flush + * + * iommu_unmap_fast() will remove a translation created by iommu_map(). + * It can't subdivide a mapping created by iommu_map(), so it should be + * called with IOVA ranges that match what was passed to iommu_map(). The + * range can aggregate contiguous iommu_map() calls so long as no individual + * range is split. + * + * Basically iommu_unmap_fast() is the same as iommu_unmap() but for callers + * which manage the IOTLB flushing externally to perform a batched sync. + * + * Returns: Number of bytes of IOVA unmapped. iova + res will be the point + * unmapping stopped. + */ size_t iommu_unmap_fast(struct iommu_domain *domain, unsigned long iova, size_t size, struct iommu_iotlb_gather *iotlb_gather) -- 2.49.0