Message ID | 0-v2-68a2e1ba507c+1fb-iommu_rm_ops_pgsize_jgg@nvidia.com |
---|---|
Headers | show |
Series | Remove ops.pgsize_bitmap | expand |
On Mon, Jun 09, 2025 at 05:41:25PM -0300, Jason Gunthorpe wrote: > The driver never reads this value, arm_smmu_domain_finalise() always sets > domain.pgsize_bitmap to pgtbl_cfg, which comes from the per-smmu > calculated value. > > Remove the ops version entirely, the related dead code and make > arm_smmu_ops const. > > Reviewed-by: Kevin Tian <kevin.tian@intel.com> > Acked-by: Will Deacon <will@kernel.org> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Is "qiommu" a typo in the subject?
On Mon, Jun 09, 2025 at 05:41:24PM -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. > > v2: > - Rebase on v6.16-rc1 Sanity tests with SMMUv3 look good. Tested-by: Nicolin Chen <nicolinc@nvidia.com>
On Mon, Jun 09, 2025 at 03:15:47PM -0700, Nicolin Chen wrote: > On Mon, Jun 09, 2025 at 05:41:25PM -0300, Jason Gunthorpe wrote: > > The driver never reads this value, arm_smmu_domain_finalise() always sets > > domain.pgsize_bitmap to pgtbl_cfg, which comes from the per-smmu > > calculated value. > > > > Remove the ops version entirely, the related dead code and make > > arm_smmu_ops const. > > > > Reviewed-by: Kevin Tian <kevin.tian@intel.com> > > Acked-by: Will Deacon <will@kernel.org> > > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> > > Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> > > Is "qiommu" a typo in the subject? Yeah Thanks, Jason