summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-12-02 20:34:12 +0300
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 16:11:55 +0300
commit98383fc301c6546af0f3a8a1d3cb8bf218f7e940 (patch)
treec376128da8396b1177996c60c63c1cc86aaf8458 /arch/x86
parentc156e347d6d3c36b6843c3b168eda61b9a02c827 (diff)
downloadlinux-98383fc301c6546af0f3a8a1d3cb8bf218f7e940.tar.xz
AMD IOMMU: add domain destroy function for IOMMU API
Impact: add a generic function for releasing protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/amd_iommu.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 6c0bd49cee5f..891d713d9c96 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1636,4 +1636,25 @@ out_free:
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