Skip to content

Commit 4f0bdab

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Make the blocked domain support PASID
The blocked domain can be extended to park PASID of a device to be the DMA blocking state. By this the remove_dev_pasid() op is dropped. Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Lu Baolu <[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 ef18176 commit 4f0bdab

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,10 +3250,15 @@ static int blocking_domain_attach_dev(struct iommu_domain *domain,
32503250
return 0;
32513251
}
32523252

3253+
static int blocking_domain_set_dev_pasid(struct iommu_domain *domain,
3254+
struct device *dev, ioasid_t pasid,
3255+
struct iommu_domain *old);
3256+
32533257
static struct iommu_domain blocking_domain = {
32543258
.type = IOMMU_DOMAIN_BLOCKED,
32553259
.ops = &(const struct iommu_domain_ops) {
32563260
.attach_dev = blocking_domain_attach_dev,
3261+
.set_dev_pasid = blocking_domain_set_dev_pasid,
32573262
}
32583263
};
32593264

@@ -4099,13 +4104,16 @@ void domain_remove_dev_pasid(struct iommu_domain *domain,
40994104
kfree(dev_pasid);
41004105
}
41014106

4102-
static void intel_iommu_remove_dev_pasid(struct device *dev, ioasid_t pasid,
4103-
struct iommu_domain *domain)
4107+
static int blocking_domain_set_dev_pasid(struct iommu_domain *domain,
4108+
struct device *dev, ioasid_t pasid,
4109+
struct iommu_domain *old)
41044110
{
41054111
struct device_domain_info *info = dev_iommu_priv_get(dev);
41064112

41074113
intel_pasid_tear_down_entry(info->iommu, dev, pasid, false);
4108-
domain_remove_dev_pasid(domain, dev, pasid);
4114+
domain_remove_dev_pasid(old, dev, pasid);
4115+
4116+
return 0;
41094117
}
41104118

41114119
struct dev_pasid_info *
@@ -4478,7 +4486,6 @@ const struct iommu_ops intel_iommu_ops = {
44784486
.dev_disable_feat = intel_iommu_dev_disable_feat,
44794487
.is_attach_deferred = intel_iommu_is_attach_deferred,
44804488
.def_domain_type = device_def_domain_type,
4481-
.remove_dev_pasid = intel_iommu_remove_dev_pasid,
44824489
.pgsize_bitmap = SZ_4K,
44834490
.page_response = intel_iommu_page_response,
44844491
.default_domain_ops = &(const struct iommu_domain_ops) {

0 commit comments

Comments
 (0)