]> xenbits.xen.org Git - xenclient/xen.git/commitdiff
Modification to RMRR workaround to include all 4GB when
authorRoss Philipson <ross.philipson@citrix.com>
Wed, 4 Mar 2009 15:12:44 +0000 (10:12 -0500)
committerRoss Philipson <ross.philipson@citrix.com>
Wed, 4 Mar 2009 15:12:44 +0000 (10:12 -0500)
iommu_inclusive_mapping=1. This handles cases where max usable
RAM is potentially less than some reserved ranges.

modified:   xen/drivers/passthrough/vtd/iommu.c

xen/drivers/passthrough/vtd/iommu.c

index 5bfedbbc0bcf018173c71e18a99826eacfcc4076..bb1ec8da58d7a76f3f95add2b661ca8c0b5968f3 100644 (file)
@@ -1029,6 +1029,7 @@ static int intel_iommu_domain_init(struct domain *d)
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct iommu *iommu = NULL;
     struct acpi_drhd_unit *drhd;
+    unsigned long max_pfn;
     u64 i;
 
     drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
@@ -1036,6 +1037,11 @@ static int intel_iommu_domain_init(struct domain *d)
 
     hd->agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
 
+    if (!iommu_inclusive_mapping)
+        max_pfn = max_page;
+    else
+        max_pfn = max(max_page, (unsigned long)(0x100000000 >> PAGE_SHIFT));
+
     if ( d->domain_id == 0 )
     {
         extern int xen_in_range(paddr_t start, paddr_t end);
@@ -1044,7 +1050,7 @@ static int intel_iommu_domain_init(struct domain *d)
          * Set up 1:1 page table for dom0 except the critical segments
          * like Xen and tboot.
          */
-        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) )
@@ -1053,7 +1059,7 @@ static int intel_iommu_domain_init(struct domain *d)
                 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) )
+                    if ( page_is_ram_type(i, RAM_TYPE_UNUSABLE) )
                         continue;
                 }
                 else