Skip to content

Commit ef18176

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/arm-smmu-v3: Make the blocked domain support PASID
The blocked domain is used to park RID to be blocking DMA state. This can be extended to PASID as well. By this, the remove_dev_pasid() op of ARM SMMUv3 can be dropped. Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Yi Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent b18301b commit ef18176

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,13 +3016,12 @@ int arm_smmu_set_pasid(struct arm_smmu_master *master,
30163016
return ret;
30173017
}
30183018

3019-
static void arm_smmu_remove_dev_pasid(struct device *dev, ioasid_t pasid,
3020-
struct iommu_domain *domain)
3019+
static int arm_smmu_blocking_set_dev_pasid(struct iommu_domain *new_domain,
3020+
struct device *dev, ioasid_t pasid,
3021+
struct iommu_domain *old_domain)
30213022
{
3023+
struct arm_smmu_domain *smmu_domain = to_smmu_domain(old_domain);
30223024
struct arm_smmu_master *master = dev_iommu_priv_get(dev);
3023-
struct arm_smmu_domain *smmu_domain;
3024-
3025-
smmu_domain = to_smmu_domain(domain);
30263025

30273026
mutex_lock(&arm_smmu_asid_lock);
30283027
arm_smmu_clear_cd(master, pasid);
@@ -3043,6 +3042,7 @@ static void arm_smmu_remove_dev_pasid(struct device *dev, ioasid_t pasid,
30433042
sid_domain->type == IOMMU_DOMAIN_BLOCKED)
30443043
sid_domain->ops->attach_dev(sid_domain, dev);
30453044
}
3045+
return 0;
30463046
}
30473047

30483048
static void arm_smmu_attach_dev_ste(struct iommu_domain *domain,
@@ -3124,6 +3124,7 @@ static int arm_smmu_attach_dev_blocked(struct iommu_domain *domain,
31243124

31253125
static const struct iommu_domain_ops arm_smmu_blocked_ops = {
31263126
.attach_dev = arm_smmu_attach_dev_blocked,
3127+
.set_dev_pasid = arm_smmu_blocking_set_dev_pasid,
31273128
};
31283129

31293130
static struct iommu_domain arm_smmu_blocked_domain = {
@@ -3551,7 +3552,6 @@ static struct iommu_ops arm_smmu_ops = {
35513552
.device_group = arm_smmu_device_group,
35523553
.of_xlate = arm_smmu_of_xlate,
35533554
.get_resv_regions = arm_smmu_get_resv_regions,
3554-
.remove_dev_pasid = arm_smmu_remove_dev_pasid,
35553555
.dev_enable_feat = arm_smmu_dev_enable_feature,
35563556
.dev_disable_feat = arm_smmu_dev_disable_feature,
35573557
.page_response = arm_smmu_page_response,

0 commit comments

Comments
 (0)