]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/vt-d: Add IOMMU_HWPT_ALLOC_PASID support
authorYi Liu <yi.l.liu@intel.com>
Fri, 21 Mar 2025 17:19:35 +0000 (10:19 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 25 Mar 2025 13:18:31 +0000 (10:18 -0300)
Intel iommu driver just treats it as a nop since Intel VT-d does not have
special requirement on domains attached to either the PASID or RID of a
PASID-capable device.

Link: https://patch.msgid.link/r/20250321171940.7213-14-yi.l.liu@intel.com
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/nested.c

index cc46098f875b16d455cd3a37296bfb3a9dbe0574..7bc890609b90c9914f1d23bbe9ed317fdec03a00 100644 (file)
@@ -3338,7 +3338,8 @@ intel_iommu_domain_alloc_paging_flags(struct device *dev, u32 flags,
        bool first_stage;
 
        if (flags &
-           (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
+           (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING |
+              IOMMU_HWPT_ALLOC_PASID)))
                return ERR_PTR(-EOPNOTSUPP);
        if (nested_parent && !nested_supported(iommu))
                return ERR_PTR(-EOPNOTSUPP);
index aba92c00b427407979b489478bc1e86a5975c229..6ac5c534bef437d9f4c635ac069772bca57b9751 100644 (file)
@@ -198,7 +198,7 @@ intel_iommu_domain_alloc_nested(struct device *dev, struct iommu_domain *parent,
        struct dmar_domain *domain;
        int ret;
 
-       if (!nested_supported(iommu) || flags)
+       if (!nested_supported(iommu) || flags & ~IOMMU_HWPT_ALLOC_PASID)
                return ERR_PTR(-EOPNOTSUPP);
 
        /* Must be nested domain */