[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1227800454-9555-6-git-send-email-joerg.roedel@amd.com>
Date: Thu, 27 Nov 2008 16:40:50 +0100
From: Joerg Roedel <joerg.roedel@....com>
To: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
iommu@...ts.linux-foundation.org
CC: avi@...hat.com, weidong.han@...el.com, mingo@...hat.com,
dwmw2@...radead.org, amit.shah@...hat.com,
Joerg Roedel <joerg.roedel@....com>
Subject: [PATCH 5/9] VT-d: add domain init and destroy functions for IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@....com>
---
drivers/pci/intel-iommu.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 5c8baa4..b958b6f 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -35,6 +35,7 @@
#include <linux/mempool.h>
#include <linux/timer.h>
#include <linux/iova.h>
+#include <linux/iommu.h>
#include <linux/intel-iommu.h>
#include <asm/cacheflush.h>
#include <asm/iommu.h>
@@ -2436,3 +2437,26 @@ u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova)
return pfn >> VTD_PAGE_SHIFT;
}
EXPORT_SYMBOL_GPL(intel_iommu_iova_to_pfn);
+
+static int intel_iommu_domain_init(struct iommu_domain *domain,
+ struct device *dev)
+{
+ struct dmar_domain *dmar_domain;
+ struct pci_dev *pdev = to_pci_dev(dev);
+
+ if (!pdev)
+ return -EINVAL;
+
+ dmar_domain = intel_iommu_domain_alloc(pdev);
+ domain->priv = dmar_domain;
+
+ return 0;
+}
+
+static void intel_iommu_domain_destroy(struct iommu_domain *domain)
+{
+ struct dmar_domain *dmar_domain = domain->priv;
+
+ intel_iommu_domain_exit(dmar_domain);
+ domain->priv = NULL;
+}
--
1.5.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists