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 CCAD0CD6E56 for ; Sun, 31 May 2026 09:37:57 +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=4/Z+ZPm/plftxIVQEjNwZFqBQEqg7EIjfcS2GaMAQFU=; b=F7EzefoQF6XQh+7ep+17MOnoxz /owWwok8rbffVtccoP7I8oj7aMOBdNl5JYsWB5r1k7vOP7h5GqtDj98xGCnei1Rz33S+8nha7lSCI c7h0ZBtNxds7w78EBWH02u9cHPd8R+3xvoqwwYCIMRxcqgepzSXWHVsBcrdc8CaK9msoLctaqW+Ly TDyTpdEuzj0OOz1o4xD98U1BaeXdv64nT/mmrTHw0MQYtr7KFRoxGOXCwL5cMOrWWlvQE3e5QIIAq LG8XcB4TPvD08lV//pg11iiUVh3j3BKA3uLtJbFevcA/hHtX8DYe2uCBx/H/kXsoBORbAvY07+NBS yLDFqyyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wTccA-00000009RgZ-1OjK; Sun, 31 May 2026 09:37:50 +0000 Received: from out30-112.freemail.mail.aliyun.com ([115.124.30.112]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wTcbO-00000009Qyx-1lYJ for linux-arm-kernel@lists.infradead.org; Sun, 31 May 2026 09:37:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1780220218; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=4/Z+ZPm/plftxIVQEjNwZFqBQEqg7EIjfcS2GaMAQFU=; b=Qljn/UzOAKGKM2ZtBpoJc7/wrYVYkG+5ZPR2iPvdeQUiehuBmvmFCEDCbluFb8rAthILA5eWWj9UqE4+PHRH+wF/2crsfZLHb2nOpT/aOIMYW9VYEuPmrjKRvwCndk+iUHVFqr466psfEHaTPzzKZcfEB3ll0xx8L1HDxOircCs= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R331e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=guanghuifeng@linux.alibaba.com;NM=1;PH=DS;RN=27;SR=0;TI=SMTPD_---0X3tRVrQ_1780220215; Received: from VM20241011-104.tbsite.net(mailfrom:guanghuifeng@linux.alibaba.com fp:SMTPD_---0X3tRVrQ_1780220215 cluster:ay36) by smtp.aliyun-inc.com; Sun, 31 May 2026 17:36:55 +0800 From: Guanghui Feng To: boris.brezillon@collabora.com, robh@kernel.org, steven.price@arm.com, adrian.larumbe@collabora.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, liviu.dudau@arm.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, alex@shazbot.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jgg@ziepe.ca, kevin.tian@intel.com, baolu.lu@linux.intel.com, suravee.suthikulpanit@amd.com, dwmw2@infradead.org Cc: xlpang@linux.alibaba.com, oliver.yang@linux.alibaba.com, shiyu.zsq@linux.alibaba.com, wei.guo.simon@linux.alibaba.com Subject: [PATCH 9/9] iommu: remove deprecated iova_to_phys from domain_ops and io_pgtable_ops Date: Sun, 31 May 2026 17:36:37 +0800 Message-ID: <20260531093637.3893199-10-guanghuifeng@linux.alibaba.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260531093637.3893199-1-guanghuifeng@linux.alibaba.com> References: <20260529115116.GR2487554@ziepe.ca> <20260531093637.3893199-1-guanghuifeng@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260531_023702_686353_1BEB0631 X-CRM114-Status: GOOD ( 11.10 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that all drivers implement iova_to_phys_length and all callers have migrated, remove the deprecated interfaces: - Remove .iova_to_phys from struct iommu_domain_ops - Remove .iova_to_phys from struct io_pgtable_ops - Remove fallback in iommu_iova_to_phys_length() - Make iommu_iova_to_phys() a thin wrapper - Remove old wrapper functions from io-pgtable implementations Signed-off-by: Guanghui Feng Acked-by: Shiqiang Zhang Acked-by: Simon Guo --- drivers/iommu/io-pgtable-arm-v7s.c | 11 ----------- drivers/iommu/io-pgtable-arm.c | 11 ----------- drivers/iommu/io-pgtable-dart.c | 11 ----------- drivers/iommu/iommu.c | 4 ---- include/linux/io-pgtable.h | 3 --- include/linux/iommu.h | 3 --- 6 files changed, 43 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 54e8cc673eb6..00c09710b01b 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -641,16 +641,6 @@ static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova return unmapped; } -static phys_addr_t arm_v7s_iova_to_phys_length(struct io_pgtable_ops *ops, - unsigned long iova, - size_t *mapped_length); - -static phys_addr_t arm_v7s_iova_to_phys(struct io_pgtable_ops *ops, - unsigned long iova) -{ - return arm_v7s_iova_to_phys_length(ops, iova, NULL); -} - static phys_addr_t arm_v7s_iova_to_phys_length(struct io_pgtable_ops *ops, unsigned long iova, size_t *mapped_length) @@ -730,7 +720,6 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, data->iop.ops = (struct io_pgtable_ops) { .map_pages = arm_v7s_map_pages, .unmap_pages = arm_v7s_unmap_pages, - .iova_to_phys = arm_v7s_iova_to_phys, .iova_to_phys_length = arm_v7s_iova_to_phys_length, }; diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index e2ea84669fbf..c7419f812e79 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -731,16 +731,6 @@ static int visit_iova_to_phys(struct io_pgtable_walk_data *walk_data, int lvl, return 0; } -static phys_addr_t arm_lpae_iova_to_phys_length(struct io_pgtable_ops *ops, - unsigned long iova, - size_t *mapped_length); - -static phys_addr_t arm_lpae_iova_to_phys(struct io_pgtable_ops *ops, - unsigned long iova) -{ - return arm_lpae_iova_to_phys_length(ops, iova, NULL); -} - static phys_addr_t arm_lpae_iova_to_phys_length(struct io_pgtable_ops *ops, unsigned long iova, size_t *mapped_length) @@ -963,7 +953,6 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg) data->iop.ops = (struct io_pgtable_ops) { .map_pages = arm_lpae_map_pages, .unmap_pages = arm_lpae_unmap_pages, - .iova_to_phys = arm_lpae_iova_to_phys, .iova_to_phys_length = arm_lpae_iova_to_phys_length, .read_and_clear_dirty = arm_lpae_read_and_clear_dirty, .pgtable_walk = arm_lpae_pgtable_walk, diff --git a/drivers/iommu/io-pgtable-dart.c b/drivers/iommu/io-pgtable-dart.c index fa250f5d16ed..f71c04a4c15e 100644 --- a/drivers/iommu/io-pgtable-dart.c +++ b/drivers/iommu/io-pgtable-dart.c @@ -333,16 +333,6 @@ static size_t dart_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova, return i * pgsize; } -static phys_addr_t dart_iova_to_phys_length(struct io_pgtable_ops *ops, - unsigned long iova, - size_t *mapped_length); - -static phys_addr_t dart_iova_to_phys(struct io_pgtable_ops *ops, - unsigned long iova) -{ - return dart_iova_to_phys_length(ops, iova, NULL); -} - static phys_addr_t dart_iova_to_phys_length(struct io_pgtable_ops *ops, unsigned long iova, size_t *mapped_length) @@ -414,7 +404,6 @@ dart_alloc_pgtable(struct io_pgtable_cfg *cfg) data->iop.ops = (struct io_pgtable_ops) { .map_pages = dart_map_pages, .unmap_pages = dart_unmap_pages, - .iova_to_phys = dart_iova_to_phys, .iova_to_phys_length = dart_iova_to_phys_length, }; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 43323229a1df..df56635de39d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2573,10 +2573,6 @@ phys_addr_t iommu_iova_to_phys_length(struct iommu_domain *domain, return domain->ops->iova_to_phys_length(domain, iova, mapped_length); - /* Fallback to legacy iova_to_phys without length info */ - if (domain->ops->iova_to_phys) - return domain->ops->iova_to_phys(domain, iova); - return 0; } EXPORT_SYMBOL_GPL(iommu_iova_to_phys_length); diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index 42bcdd309b88..c595f5b51e61 100644 --- a/include/linux/io-pgtable.h +++ b/include/linux/io-pgtable.h @@ -202,7 +202,6 @@ struct arm_lpae_io_pgtable_walk_data { * * @map_pages: Map a physically contiguous range of pages of the same size. * @unmap_pages: Unmap a range of virtually contiguous pages of the same size. - * @iova_to_phys: Translate iova to physical address. * @iova_to_phys_length: Translate iova to physical address and return the * remaining mapped length from iova to the end of the * mapping entry via @mapped_length. If @mapped_length is @@ -222,8 +221,6 @@ struct io_pgtable_ops { size_t (*unmap_pages)(struct io_pgtable_ops *ops, unsigned long iova, size_t pgsize, size_t pgcount, struct iommu_iotlb_gather *gather); - phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops, - unsigned long iova); phys_addr_t (*iova_to_phys_length)(struct io_pgtable_ops *ops, unsigned long iova, size_t *mapped_length); diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 19da84c2922c..ca585647180b 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -746,7 +746,6 @@ struct iommu_ops { * array->entry_num to report the number of handled * invalidation requests. The driver data structure * must be defined in include/uapi/linux/iommufd.h - * @iova_to_phys: translate iova to physical address * @iova_to_phys_length: translate iova to physical address and additionally * return the page size of the PTE mapping at @iova * through @mapped_length. @@ -777,8 +776,6 @@ struct iommu_domain_ops { int (*cache_invalidate_user)(struct iommu_domain *domain, struct iommu_user_data_array *array); - phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, - dma_addr_t iova); phys_addr_t (*iova_to_phys_length)(struct iommu_domain *domain, dma_addr_t iova, size_t *mapped_length); -- 2.43.7