diff options
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 9a7e64b245a7..71773d0fb769 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2958,6 +2958,8 @@ static int amd_iommu_domain_init(struct iommu_domain *dom) | |||
2958 | if (!domain->pt_root) | 2958 | if (!domain->pt_root) |
2959 | goto out_free; | 2959 | goto out_free; |
2960 | 2960 | ||
2961 | domain->iommu_domain = dom; | ||
2962 | |||
2961 | dom->priv = domain; | 2963 | dom->priv = domain; |
2962 | 2964 | ||
2963 | return 0; | 2965 | return 0; |
@@ -3463,3 +3465,19 @@ int amd_iommu_complete_ppr(struct pci_dev *pdev, int pasid, | |||
3463 | return iommu_queue_command(iommu, &cmd); | 3465 | return iommu_queue_command(iommu, &cmd); |
3464 | } | 3466 | } |
3465 | EXPORT_SYMBOL(amd_iommu_complete_ppr); | 3467 | EXPORT_SYMBOL(amd_iommu_complete_ppr); |
3468 | |||
3469 | struct iommu_domain *amd_iommu_get_v2_domain(struct pci_dev *pdev) | ||
3470 | { | ||
3471 | struct protection_domain *domain; | ||
3472 | |||
3473 | domain = get_domain(&pdev->dev); | ||
3474 | if (IS_ERR(domain)) | ||
3475 | return NULL; | ||
3476 | |||
3477 | /* Only return IOMMUv2 domains */ | ||
3478 | if (!(domain->flags & PD_IOMMUV2_MASK)) | ||
3479 | return NULL; | ||
3480 | |||
3481 | return domain->iommu_domain; | ||
3482 | } | ||
3483 | EXPORT_SYMBOL(amd_iommu_get_v2_domain); | ||