From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: iommu: introduce iova_to_phys_length for efficient IOVA-to-physical translation Date: Thu, 04 Jun 2026 11:38:17 +1000 Message-ID: In-Reply-To: <20260531093637.3893199-1-guanghuifeng@linux.alibaba.com> References: <20260531093637.3893199-1-guanghuifeng@linux.alibaba.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: iommu: introduce iova_to_phys_length for efficient IOVA-to-physical translation Author: Guanghui Feng Patches: 90 Reviewed: 2026-06-04T11:38:17.921581 --- This mbox contains **both v1 (9 patches) and v2 (30 patches)** of a series introducing `iova_to_phys_length()` across the IOMMU subsystem. v2 addresses Jason Gunthorpe's review feedback from v1. I review v2 as the current version. **Concept**: The motivation is solid. The existing `iova_to_phys()` forces callers to iterate one `PAGE_SIZE` at a time even through 2MB/1GB huge page mappings. Returning the PTE page size alongside the physical address in a single walk is a clear performance win for iommufd and VFIO unmap paths. **Architecture**: The add-migrate-remove pattern (add new interface with fallback, migrate all drivers, remove old interface) is the right approach and v2's split into per-driver patches (30 patches) is far better than v1's coalesced approach (9 patches) for bisectability and per-subsystem review. The v2 change to `PHYS_ADDR_MAX` as error sentinel (per Jason's feedback) is also an improvement, since physical address 0 is a valid mapping target in some contexts. **Key concerns**: Several issues below, the most important being (1) a documentation inconsistency in mapped_length semantics, (2) the arm-smmu hard-path silently losing the optimization, and (3) the v2 fallback path unconditionally returning PAGE_SIZE for legacy drivers. **Acks**: All patches carry Acked-by only from within the same organization (linux.alibaba.com). This series touches core IOMMU infrastructure, multiple ARM SMMU drivers, VFIO, iommufd, and DRM -- acks from the respective subsystem maintainers would significantly strengthen it. --- --- Generated by Claude Code Patch Reviewer