]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommufd: Enable PRI when doing the iommufd_hwpt_alloc
authorJoel Granados <joel.granados@kernel.org>
Mon, 4 Nov 2024 01:40:37 +0000 (09:40 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 Nov 2024 12:32:26 +0000 (13:32 +0100)
Add IOMMU_HWPT_FAULT_ID_VALID as part of the valid flags when doing an
iommufd_hwpt_alloc allowing the use of an iommu fault allocation
(iommu_fault_alloc) with the IOMMU_HWPT_ALLOC ioctl.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Link: https://lore.kernel.org/r/20241015-jag-iopfv8-v4-4-b696ca89ba29@kernel.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/iommufd/hw_pagetable.c

index d0c325115b45c35b4b2280072d1ec24c00cb128a..0ac4ce192baae5b8399f03ed087fa8360a4b0e25 100644 (file)
@@ -3315,7 +3315,8 @@ intel_iommu_domain_alloc_user(struct device *dev, u32 flags,
        }
 
        if (flags &
-           (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
+           (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING
+              | IOMMU_HWPT_FAULT_ID_VALID)))
                return ERR_PTR(-EOPNOTSUPP);
        if (nested_parent && !nested_supported(iommu))
                return ERR_PTR(-EOPNOTSUPP);
index d06bf6e6c19fd207a1b84d018920865b12a5b571..8f020bc0815f3587b4154e6f0d811c65cc586248 100644 (file)
@@ -107,7 +107,8 @@ iommufd_hwpt_paging_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas,
                          const struct iommu_user_data *user_data)
 {
        const u32 valid_flags = IOMMU_HWPT_ALLOC_NEST_PARENT |
-                               IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
+                               IOMMU_HWPT_ALLOC_DIRTY_TRACKING |
+                               IOMMU_HWPT_FAULT_ID_VALID;
        const struct iommu_ops *ops = dev_iommu_ops(idev->dev);
        struct iommufd_hwpt_paging *hwpt_paging;
        struct iommufd_hw_pagetable *hwpt;