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] AMD IOMMU: add support for PV guest

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: add support for PV guest
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2008 03:40:20 -0700
Delivery-date: Tue, 10 Jun 2008 03:40:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 1213001061 -3600
# Node ID 5009f5d093cea2e55a3838bb7e6ee42c12b0f68a
# Parent  041f67ddcd7b2e34e0bd5c4e7c8b260a3a2944be
AMD IOMMU: add support for PV guest

Assuming iommu_populate_page_table() is only used for PV guest, a new
check is added into assign_device() to avoid duplicating the work done
by amd_iommu_sync_p2m() for hvm guest.

Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
---
 xen/drivers/passthrough/iommu.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff -r 041f67ddcd7b -r 5009f5d093ce xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Mon Jun 09 09:42:51 2008 +0100
+++ b/xen/drivers/passthrough/iommu.c   Mon Jun 09 09:44:21 2008 +0100
@@ -68,7 +68,7 @@ int assign_device(struct domain *d, u8 b
     if ( (rc = hd->platform_ops->assign_device(d, bus, devfn)) )
         return rc;
 
-    if ( has_iommu_pdevs(d) && !need_iommu(d) )
+    if ( has_iommu_pdevs(d) && !is_hvm_domain(d) && !need_iommu(d) )
     {
         d->need_iommu = 1;
         return iommu_populate_page_table(d);
@@ -114,6 +114,16 @@ void iommu_domain_destroy(struct domain 
     if ( !iommu_enabled || !hd->platform_ops )
         return;
 
+    if ( !is_hvm_domain(d) && !need_iommu(d)  )
+        return;
+
+    if ( need_iommu(d) )
+    {
+        d->need_iommu = 0;
+        hd->platform_ops->teardown(d);
+        return;
+    }
+
     if ( hvm_irq_dpci != NULL )
     {
         for ( i = 0; i < NR_IRQS; i++ )
@@ -207,10 +217,10 @@ static int iommu_setup(void)
     iommu_enabled = (rc == 0);
 
  out:
-    if ( !iommu_enabled || !vtd_enabled )
+    if ( !iommu_enabled )
         iommu_pv_enabled = 0;
     printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
-    if (iommu_enabled)
+    if ( iommu_enabled )
         printk("I/O virtualisation for PV guests %sabled\n",
                iommu_pv_enabled ? "en" : "dis");
     return rc;

_______________________________________________
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] AMD IOMMU: add support for PV guest, Xen patchbot-unstable <=