iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit
mainline inclusion from mainline-v5.18 commit 701fac40 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 701fac40 iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit. Incremental backporting patches for DSA/IAA on Intel Xeon platform. Deviation from upstream: Replace ioasid_put() with ioasid_free() in drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c for the change in out of tree commit: 7ca84842 iommu/arm-smmu-v3: Support auxiliary domains. -------------------------------- PASIDs are process-wide. It was attempted to use refcounted PASIDs to free them when the last thread drops the refcount. This turned out to be complex and error prone. Given the fact that the PASID space is 20 bits, which allows up to 1M processes to have a PASID associated concurrently, PASID resource exhaustion is not a realistic concern. Therefore, it was decided to simplify the approach and stick with lazy on demand PASID allocation, but drop the eager free approach and make an allocated PASID's lifetime bound to the lifetime of the process. Get rid of the refcounting mechanisms and replace/rename the interfaces to reflect this new approach. [ bp: Massage commit message. ] Suggested-by: NDave Hansen <dave.hansen@linux.intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NBorislav Petkov <bp@suse.de> Reviewed-by: NTony Luck <tony.luck@intel.com> Reviewed-by: NLu Baolu <baolu.lu@linux.intel.com> Reviewed-by: NJacob Pan <jacob.jun.pan@linux.intel.com> Reviewed-by: NThomas Gleixner <tglx@linutronix.de> Acked-by: NJoerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20220207230254.3342514-6-fenghua.yu@intel.comSigned-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
Showing
想要评论请 注册 或 登录