[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] iommu: Move some 'boot_cpu_data.x86_vendor' related stuff into



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1223980154 -3600
# Node ID 3ff2461bb5a17b2571d95f402cd9d4999b85ef39
# Parent  0feedf7dcc7375d2d21723f55522060d10a8b755
iommu: Move some 'boot_cpu_data.x86_vendor' related stuff into
arch-specific directory.

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/drivers/passthrough/iommu.c |   52 +++-------------------------------------
 1 files changed, 5 insertions(+), 47 deletions(-)

diff -r 0feedf7dcc73 -r 3ff2461bb5a1 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Tue Oct 14 11:28:37 2008 +0100
+++ b/xen/drivers/passthrough/iommu.c   Tue Oct 14 11:29:14 2008 +0100
@@ -15,6 +15,7 @@
 
 #include <xen/sched.h>
 #include <xen/iommu.h>
+#include <asm/hvm/iommu.h>
 #include <xen/paging.h>
 #include <xen/guest_access.h>
 
@@ -77,18 +78,7 @@ int iommu_domain_init(struct domain *dom
     if ( !iommu_enabled )
         return 0;
 
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
-        hd->platform_ops = &intel_iommu_ops;
-        break;
-    case X86_VENDOR_AMD:
-        hd->platform_ops = &amd_iommu_ops;
-        break;
-    default:
-        BUG();
-    }
-
+    hd->platform_ops = iommu_get_ops();
     return hd->platform_ops->init(domain);
 }
 
@@ -239,15 +229,7 @@ static int iommu_setup(void)
     if ( !iommu_enabled )
         goto out;
 
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
-        rc = intel_vtd_setup();
-        break;
-    case X86_VENDOR_AMD:
-        rc = amd_iov_detect();
-        break;
-    }
+    rc = iommu_hardware_setup();
 
     iommu_enabled = (rc == 0);
 
@@ -308,37 +290,13 @@ void iommu_update_ire_from_apic(
 void iommu_update_ire_from_apic(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
-    struct iommu_ops *ops = NULL;
-
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
-        ops = &intel_iommu_ops;
-        break;
-    case X86_VENDOR_AMD:
-        ops = &amd_iommu_ops;
-        break;
-    default:
-        BUG();
-    }
+    struct iommu_ops *ops = iommu_get_ops();
     ops->update_ire_from_apic(apic, reg, value);
 }
 void iommu_update_ire_from_msi(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
-    struct iommu_ops *ops = NULL;
-
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
-        ops = &intel_iommu_ops;
-        break;
-    case X86_VENDOR_AMD:
-        ops = &amd_iommu_ops;
-        break;
-    default:
-        BUG();
-    }
+    struct iommu_ops *ops = iommu_get_ops();
     ops->update_ire_from_msi(msi_desc, msg);
 }
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.