Subject: Re: [PATCH v3 24/32] iommufd: use iova_to_phys_length for efficient unmap

From: Jason Gunthorpe <[email-masked]>
Date: Thu, 4 Jun 2026 11:26:05 -0300

On Wed, Jun 03, 2026 at 11:17:56PM +0800, Guanghui Feng wrote:
> Use iommu_iova_to_phys_length() to get PTE page size in
> +		for (i = 0; i < npages; i++) {
> +			if (!batch_add_pfn(batch, PHYS_PFN(phys) + i))
> +				return;

batch_add_pfn_num()

Be mindful that the num is purposfully a u32 so that will need some
attention.

Jason