RE: [PATCH v4 09/17] iommufd: Data structure to provide IOVA to PFN mapping

Tian, Kevin
2022-11-16T02:30:51Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, November 16, 2022 8:33 AM
> > > This is the comment:
> > >
> > > /*
> > > * This is part of the VFIO compatibility support for VFIO_TYPE1_IOMMU.
> > > That
> > > * mode permits splitting a mapped area up, and then one of the splits is
> > > * unmapped. Doing this normally would cause us to violate our invariant
> of
> > > * pairing map/unmap. Thus, to support old VFIO compatibility disable
> > > support
> > > * for batching consecutive PFNs. All PFNs mapped into the iommu are
> done
> > > in
> > > * PAGE_SIZE units, not larger or smaller.
> > > */
> > > static int batch_iommu_map_small(struct iommu_domain *domain,
> > > unsigned long iova, phys_addr_t paddr,
> > > size_t size, int prot)
> > >
> >
> > I meant a comment in iopt_calculate_iova_alignment().
>
> How about "see batch_iommu_map_small()" ?
>

yes, that works.

btw is there a better name to reflect strict PAGE_SIZE only?

disable_large_pages literally implies no >PAGE_SIZE alignment. This is the
confusion easily raised why it also refers to no subpage alignment.