提交 98383fc3 编写于 作者: J Joerg Roedel

AMD IOMMU: add domain destroy function for IOMMU API

Impact: add a generic function for releasing protection domains
Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
上级 c156e347
......@@ -1636,4 +1636,25 @@ static int amd_iommu_domain_init(struct iommu_domain *dom)
return -ENOMEM;
}
static void amd_iommu_domain_destroy(struct iommu_domain *dom)
{
struct protection_domain *domain = dom->priv;
if (!domain)
return;
if (domain->dev_cnt > 0)
cleanup_domain(domain);
BUG_ON(domain->dev_cnt != 0);
free_pagetable(domain);
domain_id_free(domain->id);
kfree(domain);
dom->priv = NULL;
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册