RE: [PATCH v5 05/15] iommupt: Add iova_to_phys op

Tian, Kevin
2025-09-18T07:08:43Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Thursday, September 4, 2025 1:47 AM
>
> +
> +/*
> + * Some APIs use unsigned long some use dma_addr_t as the type. Dispatch
> to the
> + * correct validation based on the type.

"Some APIs use unsigned long, while others use..."

> +
> +/*
> + * The driver should setup its domain struct like
> + * union {
> + * struct iommu_domain domain;
> + * struct pt_iommu_xxx xx;
> + * };
> + * PT_IOMMU_CHECK_DOMAIN(struct mock_iommu_domain, xx.iommu,
> domain);
> + *
> + * Which creates an alias between driver_domain.domain and
> + * driver_domain.xx.iommu.domain. This is to avoid a mass rename of
> existing
> + * driver_domain.domain users.
> + */
> +#define PT_IOMMU_CHECK_DOMAIN(s, pt_iommu_memb, domain_memb)
> \
> + static_assert(offsetof(s, pt_iommu_memb.domain) == \
> + offsetof(s, domain_memb))
>

not belong to this patch

Reviewed-by: Kevin Tian <kevin.tian@intel.com>