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] vtd: Fix iommu_inclusive_mapping to map a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vtd: Fix iommu_inclusive_mapping to map all under 4GB.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 07 Mar 2009 06:35:13 -0800
Delivery-date: Sat, 07 Mar 2009 06:35:05 -0800
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 1236264924 0
# Node ID 5dee49f3a86e8620042ed575c04306d9a8367fe2
# Parent  3673926b2375a10c55dafb1a6c478e22ee0b08f2
vtd: Fix iommu_inclusive_mapping to map all under 4GB.

Signed-off-by: Ross Philipson <ross.philipson@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/drivers/passthrough/vtd/x86/vtd.c |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff -r 3673926b2375 -r 5dee49f3a86e xen/drivers/passthrough/vtd/x86/vtd.c
--- a/xen/drivers/passthrough/vtd/x86/vtd.c     Thu Mar 05 09:32:37 2009 +0000
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c     Thu Mar 05 14:55:24 2009 +0000
@@ -27,8 +27,11 @@
 #include "../dmar.h"
 #include "../vtd.h"
 
-/* iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0 
1-1 iommu mappings except xen and unusable regions */
-static int iommu_inclusive_mapping = 0;
+/*
+ * iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0
+ * 1:1 iommu mappings except xen and unusable regions.
+ */
+static int iommu_inclusive_mapping;
 boolean_param("iommu_inclusive_mapping", iommu_inclusive_mapping);
 
 void *map_vtd_domain_page(u64 maddr)
@@ -151,25 +154,23 @@ void iommu_set_dom0_mapping(struct domai
 void iommu_set_dom0_mapping(struct domain *d)
 {
     u64 i, j, tmp;
+    unsigned long max_pfn = max(max_page, 0x100000000ul >> PAGE_SHIFT);
     extern int xen_in_range(paddr_t start, paddr_t end);
 
     BUG_ON(d->domain_id != 0);
 
-    for ( i = 0; i < max_page; i++ )
+    for ( i = 0; i < max_pfn; i++ )
     {
-        /* Set up 1:1 mapping for dom0 */
-        if ( !page_is_ram_type(i, RAM_TYPE_CONVENTIONAL) )
-        {
-            /* Default it to use only conventional RAM areas and let RMRRs 
include needed reserved regions */
-            if (iommu_inclusive_mapping)
-            {
-                /* When set, the inclusive mapping maps in everything below 
4GB except unusable ranges */
-                if ( (i >= 0x100000) || page_is_ram_type(i, RAM_TYPE_UNUSABLE) 
)
-                    continue;
-            }
-            else
-                continue;
-        }
+        /*
+         * Set up 1:1 mapping for dom0. Default to use only conventional RAM 
+         * areas and let RMRRs include needed reserved regions. When set, the 
+         * inclusive mapping maps in everything below 4GB except unusable
+         * ranges. 
+         */
+        if ( !page_is_ram_type(i, RAM_TYPE_CONVENTIONAL) &&
+             (!iommu_inclusive_mapping ||
+              page_is_ram_type(i, RAM_TYPE_UNUSABLE)) )
+            continue;
 
         /* Exclude Xen bits */
         if ( xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )

_______________________________________________
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] vtd: Fix iommu_inclusive_mapping to map all under 4GB., Xen patchbot-unstable <=