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-8-git-send-email-joerg.roedel@amd.com>
Date:	Thu, 27 Nov 2008 16:40:52 +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 7/9] VT-d: add domain map and iova_to_phys functions for IOMMU API

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

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index a90c832..8fa0269 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2492,3 +2492,25 @@ static void intel_iommu_detach_device(struct iommu_domain *domain,
 
 	intel_iommu_detach_dev(dmar_domain, pdev->bus->number, pdev->devfn);
 }
+
+static int intel_iommu_map(struct iommu_domain *domain, dma_addr_t iova,
+			   phys_addr_t paddr, size_t size, int prot)
+{
+	struct dmar_domain *dmar_domain = domain->priv;
+
+	return intel_iommu_page_mapping(dmar_domain, iova, paddr, size, prot);
+}
+
+static phys_addr_t intel_iova_to_phys(struct iommu_domain *domain,
+				      dma_addr_t iova)
+{
+	struct dmar_domain *dmar_domain = domain->priv;
+	u64 pfn;
+	u64 offset = iova & ~PAGE_MASK;
+
+	pfn = intel_iommu_iova_to_pfn(dmar_domain, iova);
+	if (!pfn)
+		return pfn;
+
+	return (pfn << PAGE_SHIFT) & offset;
+}
-- 
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