Skip to contentSkip to conversation

Add a generic layer on top of intel and amd iommu code

PATCH New Wei Wang2 1 participant 1 message Feb 13, 2008

lore
Share & tools
lore

Wei Wang2

author
#0 lore raw

PATCH 2/4 Add a generic layer on top of intel and amd iommu code

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy 
xen/arch/x86/hvm/vmx/vtd/intel-iommu.c +12 -9
diff -r 2c343b0341d5 xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
@@ -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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel