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

Jason Gunthorpe jgg at ziepe.ca
Thu Jun 4 07:26:05 PDT 2026


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



More information about the linux-arm-kernel mailing list