From patchwork Thu Dec 5 13:21:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13895310 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ED4D218AD1; Thu, 5 Dec 2024 13:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733404903; cv=none; b=IZfPC9STdLAULVI3cdowqiSevN1uP+rs1l9IaBoKDiG/eX7z0IsbmZzc1fswjamMsxFFOT7Fhp7pksFKR6yodOu3vsT5mHPVEgzN5Xi7Cysn+YMgDLuwWiRifnyoX+OQydbYOAcvpeaTiqC+3d+uKwp6S0qFzxv6b4G6XxiSYTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733404903; c=relaxed/simple; bh=VDNJrNgrvXeiKwTQI653m0SaajGvRheByl4V4Wf2JY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u2gFmdMfxfv8bUfVvrR70SoxgnshokUizI+8a7lPs4pAWi/MQe1V0qEEQXqvd94dv63Q43U062BfDyHWLQXlWCzzPewSxbYxLxudSzzambukoRPi4yg/kdQGSR9TFX1UEb3OOtFj94O5LaItThVgziaFBj5opK0sBpalV9hJfFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RPr7ALUa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RPr7ALUa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EF8DC4CEDD; Thu, 5 Dec 2024 13:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733404903; bh=VDNJrNgrvXeiKwTQI653m0SaajGvRheByl4V4Wf2JY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPr7ALUaMhuypEqnOZAReGPsJO+L7CxPCXOtIRW390pP3BgIq43qVAlYTCBl50Tbq AYLMWWZEi1Wf4ldGPrnc+Cn9gGcnH1q/N8n2YizrGGPvKhMmV8i7CB0YsnQu9W4RIy r23PPnc9oFtb7FGHBWlz8+3XmxQDarPEGuOS3STWY2u7wIf69ZigOhPi96tgHvPxCC YSqEJ9uf4DMnaj+VJaog96+zDb56sp50z1+PreCl7/Ifk5VyRiXRpQLJ+ASdXeTURE GEXRyiz661D9BBLygBY64ddV7oTPuKAw293jbjhYaAPogLRmlENxCxlOzuck2YzWcG pORaBiUE8Rx5Q== From: Leon Romanovsky To: Jens Axboe , Jason Gunthorpe , Robin Murphy , Joerg Roedel , Will Deacon , Christoph Hellwig , Sagi Grimberg Cc: Leon Romanovsky , Keith Busch , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Marek Szyprowski , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton , Jonathan Corbet , 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, Randy Dunlap , Jason Gunthorpe Subject: [PATCH v4 04/18] iommu: add kernel-doc for iommu_unmap and iommu_unmap_fast Date: Thu, 5 Dec 2024 15:21:03 +0200 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Signed-off-by: Leon Romanovsky Acked-by: Will Deacon Reviewed-by: Christoph Hellwig --- drivers/iommu/iommu.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index ec75d14497bf..9eb7c7d7aa70 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2590,6 +2590,24 @@ 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 cannot + * 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. + * + * Basicly iommu_unmap_fast() as the same as iommu_unmap() but for callers + * which manage IOTLB flush range externaly to perform 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)