Fix 17725:c0c0f4fa8850: use type paddr_t instead of unsigned long for physcial memory...
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 27 May 2008 09:35:10 +0000 (10:35 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 27 May 2008 09:35:10 +0000 (10:35 +0100)
Otherwise, the address overflows on PAE system with memory size > 4G.

Signed-off-by: Yang, Xiaowei <xiaowei.yang@intel.com>
xen/arch/x86/setup.c
xen/arch/x86/tboot.c
xen/drivers/passthrough/vtd/iommu.c

index 94504c55612d9f9a78ce179b9e3e156d2f3b2284..ac1aa93891928dd76e8850bccda1f556d421f674 100644 (file)
@@ -1100,10 +1100,10 @@ void arch_get_xen_caps(xen_capabilities_info_t *info)
 #endif
 }
 
-int xen_in_range(unsigned long start, unsigned long end)
+int xen_in_range(paddr_t start, paddr_t end)
 {
-    start = max_t(unsigned long, start, xenheap_phys_start);
-    end = min_t(unsigned long, end, xenheap_phys_end);
+    start = max_t(paddr_t, start, xenheap_phys_start);
+    end = min_t(paddr_t, end, xenheap_phys_end);
  
     return start < end; 
 }
index 37841c41fa38277ceee7ac4719ba25f72a5e8ae6..ec4aa9436d5f4125e93aaa493a7fd17586d8fcb1 100644 (file)
@@ -96,13 +96,13 @@ int tboot_in_measured_env(void)
     return (g_tboot_shared != NULL);
 }
 
-int tboot_in_range(unsigned long start, unsigned long end)
+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(unsigned long, start, g_tboot_shared->tboot_base);
-    end = min_t(unsigned long, end, 
+    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; 
index 063d7132797270403a1a5c700389b6323f697417..fe17f4a77e209cdefce1d030ad22e2879dc3f57d 100644 (file)
@@ -1074,7 +1074,8 @@ static int intel_iommu_domain_init(struct domain *d)
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct iommu *iommu = NULL;
     int guest_width = DEFAULT_DOMAIN_ADDRESS_WIDTH;
-    int i, adjust_width, agaw;
+    int adjust_width, agaw;
+    u64 i;
     unsigned long sagaw;
     struct acpi_drhd_unit *drhd;
 
@@ -1102,8 +1103,8 @@ static int intel_iommu_domain_init(struct domain *d)
 
     if ( d->domain_id == 0 )
     {
-        extern int xen_in_range(unsigned long start, unsigned long end);
-        extern int tboot_in_range(unsigned long start, unsigned long 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