From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wei Wang2" Subject: [IOMMU][PATCH 2/4] Add a generic layer on top of intel and amd iommu code Date: Wed, 13 Feb 2008 17:46:56 +0100 Message-ID: <1202921216.3677.110.camel@gran.amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-n8pg+Nbb5AJxA8Yf0c4q" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-n8pg+Nbb5AJxA8Yf0c4q Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Signed-off-by: Wei Wang --=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=C3=A4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=C3=A4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=C3=A4ftsf=C3=BChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy=20 --=-n8pg+Nbb5AJxA8Yf0c4q Content-Disposition: attachment; filename=vtd.patch Content-Type: text/plain; charset=utf-8; name=vtd.patch Content-Transfer-Encoding: 7bit diff -r 2c343b0341d5 xen/arch/x86/hvm/vmx/vtd/intel-iommu.c --- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Wed Feb 13 14:24:17 2008 +0100 +++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Wed Feb 13 14:51:58 2008 +0100 @@ -1047,7 +1047,7 @@ static void free_iommu(struct iommu *iom agaw = 64; \ agaw; }) -int iommu_domain_init(struct domain *domain) +int intel_iommu_domain_init(struct domain *domain) { struct hvm_iommu *hd = domain_hvm_iommu(domain); struct iommu *iommu = NULL; @@ -1055,11 +1055,6 @@ int iommu_domain_init(struct domain *dom int adjust_width, agaw; unsigned long sagaw; struct acpi_drhd_unit *drhd; - - spin_lock_init(&hd->mapping_lock); - spin_lock_init(&hd->iommu_list_lock); - INIT_LIST_HEAD(&hd->pdev_list); - INIT_LIST_HEAD(&hd->g2m_ioport_list); if ( !vtd_enabled || list_empty(&acpi_drhd_units) ) return 0; @@ -1550,7 +1545,7 @@ static int domain_context_mapped(struct return 0; } -int iommu_map_page(struct domain *d, paddr_t gfn, paddr_t mfn) +int intel_iommu_map_page(struct domain *d, paddr_t gfn, paddr_t mfn) { struct acpi_drhd_unit *drhd; struct iommu *iommu; @@ -1589,7 +1584,7 @@ int iommu_map_page(struct domain *d, pad return 0; } -int iommu_unmap_page(struct domain *d, dma_addr_t gfn) +int intel_iommu_unmap_page(struct domain *d, dma_addr_t gfn) { struct acpi_drhd_unit *drhd; struct iommu *iommu; @@ -1921,7 +1916,7 @@ int device_assigned(u8 bus, u8 devfn) return 1; } -int assign_device(struct domain *d, u8 bus, u8 devfn) +int intel_iommu_assign_device(struct domain *d, u8 bus, u8 devfn) { struct acpi_rmrr_unit *rmrr; struct pci_dev *pdev; @@ -2151,6 +2146,14 @@ int iommu_resume(void) return 0; } +struct iommu_ops intel_iommu_ops = { + .init = intel_iommu_domain_init, + .assign_device = intel_iommu_assign_device, + .teardown = iommu_domain_teardown, + .map_page = intel_iommu_map_page, + .unmap_page = intel_iommu_unmap_page, +}; + /* * Local variables: * mode: C --=-n8pg+Nbb5AJxA8Yf0c4q Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-n8pg+Nbb5AJxA8Yf0c4q--