Skip to content

Commit 34b48c7

Browse files
jpbruckerjoergroedel
authored andcommitted
iommu: Separate IOMMU_DEV_FEAT_IOPF from IOMMU_DEV_FEAT_SVA
Some devices manage I/O Page Faults (IOPF) themselves instead of relying on PCIe PRI or Arm SMMU stall. Allow their drivers to enable SVA without mandating IOMMU-managed IOPF. The other device drivers now need to first enable IOMMU_DEV_FEAT_IOPF before enabling IOMMU_DEV_FEAT_SVA. Enabling IOMMU_DEV_FEAT_IOPF on its own doesn't have any effect visible to the device driver, it is used in combination with other features. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 434b73e commit 34b48c7

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

include/linux/iommu.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,24 @@ struct iommu_resv_region {
156156
enum iommu_resv_type type;
157157
};
158158

159-
/* Per device IOMMU features */
159+
/**
160+
* enum iommu_dev_features - Per device IOMMU features
161+
* @IOMMU_DEV_FEAT_AUX: Auxiliary domain feature
162+
* @IOMMU_DEV_FEAT_SVA: Shared Virtual Addresses
163+
* @IOMMU_DEV_FEAT_IOPF: I/O Page Faults such as PRI or Stall. Generally
164+
* enabling %IOMMU_DEV_FEAT_SVA requires
165+
* %IOMMU_DEV_FEAT_IOPF, but some devices manage I/O Page
166+
* Faults themselves instead of relying on the IOMMU. When
167+
* supported, this feature must be enabled before and
168+
* disabled after %IOMMU_DEV_FEAT_SVA.
169+
*
170+
* Device drivers query whether a feature is supported using
171+
* iommu_dev_has_feature(), and enable it using iommu_dev_enable_feature().
172+
*/
160173
enum iommu_dev_features {
161-
IOMMU_DEV_FEAT_AUX, /* Aux-domain feature */
162-
IOMMU_DEV_FEAT_SVA, /* Shared Virtual Addresses */
174+
IOMMU_DEV_FEAT_AUX,
175+
IOMMU_DEV_FEAT_SVA,
176+
IOMMU_DEV_FEAT_IOPF,
163177
};
164178

165179
#define IOMMU_PASID_INVALID (-1U)

0 commit comments

Comments
 (0)