On 10/18/22 15:33, Kirill A. Shutemov wrote: >> Is this #ifdef really necessary? CONFIG_IOMMU_SVA selects IOASID, >> without which pasid_valid() is just stubbed out to 0. > mm->pasid is only defined for CONFIG_IOMMU_SVA=y. > > Do you want me to add mm_has_valid_pasid()? A quick grep makes it look like pasid_valid() could be *replaced* with mm_has_pasid_valid() since all the places doing pasid_valid() do it with mm->pasid.