lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1227800454-9555-7-git-send-email-joerg.roedel@amd.com>
Date:	Thu, 27 Nov 2008 16:40:51 +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 6/9] VT-d: add device attach and detach functions for IOMMU API

Signed-off-by: Joerg Roedel <joerg.roedel@....com>
---
 drivers/pci/intel-iommu.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index b958b6f..a90c832 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2460,3 +2460,35 @@ static void intel_iommu_domain_destroy(struct iommu_domain *domain)
 	intel_iommu_domain_exit(dmar_domain);
 	domain->priv = NULL;
 }
+
+static int intel_iommu_attach_device(struct iommu_domain *domain,
+				     struct device *dev)
+{
+	struct dmar_domain *dmar_domain;
+	struct pci_dev *pdev;
+
+	dmar_domain = domain->priv;
+	pdev = to_pci_dev(dev);
+
+	if (!pdev)
+		return -EINVAL;
+
+	intel_iommu_context_mapping(dmar_domain, pdev);
+
+	return 0;
+}
+
+static void intel_iommu_detach_device(struct iommu_domain *domain,
+				      struct device *dev)
+{
+	struct dmar_domain *dmar_domain;
+	struct pci_dev *pdev;
+
+	dmar_domain = domain->priv;
+	pdev = to_pci_dev(dev);
+
+	if (!pdev)
+		return;
+
+	intel_iommu_detach_dev(dmar_domain, pdev->bus->number, pdev->devfn);
+}
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ