From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out199-6.us.a.mail.aliyun.com (out199-6.us.a.mail.aliyun.com [47.90.199.6]) (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 5B2AD357D19; Sun, 31 May 2026 09:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.199.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780220236; cv=none; b=H79l0X534kBfaJJsBKdh6J3ttFKChHZ30JJRQMGw+VFDtYq6CctQx0QOVMXrE4r2Np7az2IcDqdxBxyeVOb388tLJHjdssSS4GzkIoTZmzyunbOqZWnQQ7rdcxORyTXGqjNoSOWGzy5rANxgrNZYJ2qHhDOi+/4uoxmGVu0wN3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780220236; c=relaxed/simple; bh=xRalzbcpLDZ7+7bYboe0Stt7HU7h6x+ZVecxZJ0LG6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fBYOlL9Nqmpt/YAp+OoHm6rQhh+rytE7Ls+OaAEV1gwCiWewunl1+cSBrZmKE5OMg/xJx6sVScj0gX5vmFOGNCX08BK6F4yJ3NYoEGBPc3dqKq77YkdnX1Angue71FiKVDXvAkQcXWNeK8svbOEJE4SYevjR9ZCh8GYxXvBw8rM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=MmiFBQOR; arc=none smtp.client-ip=47.90.199.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="MmiFBQOR" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1780220217; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=4/Z+ZPm/plftxIVQEjNwZFqBQEqg7EIjfcS2GaMAQFU=; b=MmiFBQORJe2csb7MQbPTKnXb+GtbgaX++0RtqBihtwDrUFJktrng7jjAi38u2fkz/ZKC4FIlrZfmGkH50Mh+5sCD6Afu9SELDV1BHzJbe19ehEBEAjmTutofc22yRZ6I515ai8U0fdk4mJtTtzfuVYsLKt83dUP72A2naTzbqt8= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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