WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] iommu: Move some 'boot_cpu_data.x86_vendo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] iommu: Move some 'boot_cpu_data.x86_vendor' related stuff into
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Oct 2008 04:50:19 -0700
Delivery-date: Wed, 15 Oct 2008 04:50:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] iommu: Move some 'boot_cpu_data.x86_vendor' related stuff into, Xen patchbot-unstable <=