Message ID | 0-v1-7c5282b0c334+2db-iommu_rm_ops_pgsize_jgg@nvidia.com |
---|---|
Headers | show |
Series | Remove ops.pgsize_bitmap | expand |
> From: Jason Gunthorpe <jgg@nvidia.com> > Sent: Tuesday, April 29, 2025 10:34 PM > > Now that all drivers are using domain_alloc_paging() and dev is never > NULL, we can have all drivers correctly set domain.pgsize_bitmap during > their allocation function. > > There are a few oddities that have accumulated here over past changes: > > - Some drivers always set domain.pgsize_bitmap during their > domain_alloc_paging() call but still provide a value in ops. This is dead > code, delete it. > > - Some drivers calculate a system global pgsize_bitmap in the ops, but > it is now trivial to use the per-instance value instead. In several > cases this is dead code, delete it. This also allows > constifying the ops in these drivers as a hardening measure > > - Some drivers have a fixed pgsize_bitmap, put it next to setting up the > geometry in their domain_alloc_paging() functions. > > - Finally a few drivers still use ops because they have a delayed > finalize operation. Set the constant pgsize_bitmap in the > domain_alloc_paging(). > > Then remove ops.pgsize_bitmap. > > This is based on iommu next, and must go after the virtio > domain_alloc_paging() conversion. > for entire series: Reviewed-by: Kevin Tian <kevin.tian@intel.com>
On Tue, Apr 29, 2025 at 11:34:10AM -0300, Jason Gunthorpe wrote: > Now that all drivers are using domain_alloc_paging() and dev is never > NULL, we can have all drivers correctly set domain.pgsize_bitmap during > their allocation function. > > There are a few oddities that have accumulated here over past changes: > > - Some drivers always set domain.pgsize_bitmap during their > domain_alloc_paging() call but still provide a value in ops. This is dead > code, delete it. > > - Some drivers calculate a system global pgsize_bitmap in the ops, but > it is now trivial to use the per-instance value instead. In several > cases this is dead code, delete it. This also allows > constifying the ops in these drivers as a hardening measure > > - Some drivers have a fixed pgsize_bitmap, put it next to setting up the > geometry in their domain_alloc_paging() functions. > > - Finally a few drivers still use ops because they have a delayed > finalize operation. Set the constant pgsize_bitmap in the > domain_alloc_paging(). > > Then remove ops.pgsize_bitmap. > > This is based on iommu next, and must go after the virtio > domain_alloc_paging() conversion. > > Jason Gunthorpe (7): > iommu/arm-smmu-v3: Remove iommu_ops pgsize_bitmap > iommu/arm-smmu: Remove iommu_ops pgsize_bitmap These two SMMU changes look correct to me: Acked-by: Will Deacon <will@kernel.org> Please yell if you'd like me to pick them up separately from the rest of the series. Will