]> xenbits.xen.org Git - xenclient/xen.git/commitdiff
Patch to revert parts of the tboot patches from Wed Feb 4 10:47:48.
authorRoss Philipson <ross.philipson@citrix.com>
Fri, 13 Feb 2009 20:14:36 +0000 (15:14 -0500)
committerRoss Philipson <ross.philipson@citrix.com>
Fri, 13 Feb 2009 20:14:36 +0000 (15:14 -0500)
This addresses the hang on the Lenovo laptops. More investigation
needs to be done as to why the hang occurs since the original changes
are not really incorrect. For not this will prevent the hang.

 Changes to be committed:
modified:   xen/arch/x86/setup.c
modified:   xen/arch/x86/tboot.c
modified:   xen/drivers/passthrough/vtd/iommu.c

xen/arch/x86/setup.c
xen/arch/x86/tboot.c
xen/drivers/passthrough/vtd/iommu.c

index b8694e816dfeabb3cca37b8189be9ab2431ca5f8..e0a510ba0ac96c148f03a8af3483881c7605b34a 100644 (file)
@@ -1120,16 +1120,10 @@ void arch_get_xen_caps(xen_capabilities_info_t *info)
 
 int xen_in_range(paddr_t start, paddr_t end)
 {
-    /* CS 19060 removed xenheap_phys_start, CS 19081 fixed 64b range */
-#if defined(CONFIG_X86_32)
-    paddr_t xs = 0;
-    paddr_t xe = xenheap_phys_end;
-#else
-    paddr_t xs = __pa(&_stext);
-    paddr_t xe = __pa(&_etext);
-#endif
-
-    return (start < xe) && (end > xs);
+    start = max_t(paddr_t, start, xenheap_phys_start);
+    end = min_t(paddr_t, end, xenheap_phys_end);
+    
+    return start < end; 
 }
 
 /*
index 608d34d39a41abe1547f244c22b2363c1728b9f6..6b51bc32a97df9a2783c92828faadf4155ccd68f 100644 (file)
@@ -251,6 +251,18 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler)
     return rc;
 }
 
+int tboot_in_range(paddr_t start, paddr_t end)
+{
+    if ( g_tboot_shared == NULL || g_tboot_shared->version < 0x02 )
+        return 0;
+
+    start = max_t(paddr_t, start, g_tboot_shared->tboot_base);
+    end = min_t(paddr_t, end, 
+                g_tboot_shared->tboot_base + g_tboot_shared->tboot_size);
+    return start < end; 
+}
+
 /*
  * Local variables:
  * mode: C
index 48ba0381dfc1b92cb4639f7df0f8996097310f93..905104d76ff91853059549ae739b2d3bd217faa1 100644 (file)
@@ -1034,7 +1034,8 @@ static int intel_iommu_domain_init(struct domain *d)
 
     if ( d->domain_id == 0 )
     {
-        extern int xen_in_range(paddr_t start, paddr_t end);        
+        extern int xen_in_range(paddr_t start, paddr_t end);
+        extern int tboot_in_range(paddr_t start, paddr_t end);
 
         /* 
          * Set up 1:1 page table for dom0 except the critical segments
@@ -1043,8 +1044,11 @@ static int intel_iommu_domain_init(struct domain *d)
         for ( i = 0; i < max_page; i++ )
         {
             /* CS 19084 remove tboot_in_range, CS 19085 use page_is_conventional_ram */              
-            if ( !page_is_conventional_ram(i) ||
+            /*if ( !page_is_conventional_ram(i) ||
                  xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
+                continue;*/
+            if ( xen_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) ||
+                 tboot_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) )
                 continue;
 
             iommu_map_page(d, i, i);