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-4.1-testing] IOMMU: only try to share IOMMU and HAP

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] IOMMU: only try to share IOMMU and HAP tables for domains with P2M.
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Wed, 31 Aug 2011 09:22:15 +0100
Delivery-date: Wed, 31 Aug 2011 01:24:06 -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 Tim Deegan <tim@xxxxxxx>
# Date 1314092605 -3600
# Node ID 778723e052d5a67b4e44c8890af7e6cabb89343f
# Parent  b42d905cd0321094011e5c3ae5133fe406a2e01c
IOMMU: only try to share IOMMU and HAP tables for domains with P2M.
This makes the check more precise, and brings VTd in line with AMD code.

Signed-off-by: Tim Deegan <tim@xxxxxxx>
xen-unstable changeset:   23788:9d2a8912597d
xen-unstable date:        Tue Aug 23 10:43:25 2011 +0100
---


diff -r b42d905cd032 -r 778723e052d5 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Tue Aug 23 10:43:20 2011 +0100
+++ b/xen/drivers/passthrough/iommu.c   Tue Aug 23 10:43:25 2011 +0100
@@ -175,7 +175,7 @@
     if ( has_arch_pdevs(d) && !need_iommu(d) )
     {
         d->need_iommu = 1;
-        if ( !iommu_hap_pt_share )
+        if ( !iommu_use_hap_pt(d) )
             rc = iommu_populate_page_table(d);
         goto done;
     }
diff -r b42d905cd032 -r 778723e052d5 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Tue Aug 23 10:43:20 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Tue Aug 23 10:43:25 2011 +0100
@@ -1622,7 +1622,7 @@
     if ( list_empty(&acpi_drhd_units) )
         return;
 
-    if ( iommu_hap_pt_share )
+    if ( iommu_use_hap_pt(d) )
         return;
 
     spin_lock(&hd->mapping_lock);
@@ -1644,7 +1644,7 @@
     int iommu_domid;
 
     /* Do nothing if VT-d shares EPT page table */
-    if ( iommu_hap_pt_share )
+    if ( iommu_use_hap_pt(d) )
         return 0;
 
     /* do nothing if dom0 and iommu supports pass thru */
@@ -1769,7 +1769,7 @@
 
     ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled );
 
-    if ( !iommu_hap_pt_share )
+    if ( !iommu_use_hap_pt(d) )
         return;
 
     pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)));
diff -r b42d905cd032 -r 778723e052d5 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h   Tue Aug 23 10:43:20 2011 +0100
+++ b/xen/include/xen/iommu.h   Tue Aug 23 10:43:25 2011 +0100
@@ -34,6 +34,9 @@
 extern bool_t amd_iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
 
+/* Does this domain have a P2M table we can use as its IOMMU pagetable? */
+#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share)
+
 extern struct rangeset *mmio_ro_ranges;
 
 #define domain_hvm_iommu(d)     (&d->arch.hvm_domain.hvm_iommu)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] IOMMU: only try to share IOMMU and HAP tables for domains with P2M., Xen patchbot-4 . 1-testing <=