ia64/xen-unstable

changeset 17738:e265878e8f65

Fix 17725:c0c0f4fa8850: use type paddr_t instead of unsigned long for physcial memory address

Otherwise, the address overflows on PAE system with memory size > 4G.

Signed-off-by: Yang, Xiaowei <xiaowei.yang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 27 10:35:10 2008 +0100 (2008-05-27)
parents 80ee45e007e1
children 634fe9f86d62
files xen/arch/x86/setup.c xen/arch/x86/tboot.c xen/drivers/passthrough/vtd/iommu.c
line diff
     1.1 --- a/xen/arch/x86/setup.c	Tue May 27 10:31:55 2008 +0100
     1.2 +++ b/xen/arch/x86/setup.c	Tue May 27 10:35:10 2008 +0100
     1.3 @@ -1100,10 +1100,10 @@ void arch_get_xen_caps(xen_capabilities_
     1.4  #endif
     1.5  }
     1.6  
     1.7 -int xen_in_range(unsigned long start, unsigned long end)
     1.8 +int xen_in_range(paddr_t start, paddr_t end)
     1.9  {
    1.10 -    start = max_t(unsigned long, start, xenheap_phys_start);
    1.11 -    end = min_t(unsigned long, end, xenheap_phys_end);
    1.12 +    start = max_t(paddr_t, start, xenheap_phys_start);
    1.13 +    end = min_t(paddr_t, end, xenheap_phys_end);
    1.14   
    1.15      return start < end; 
    1.16  }
     2.1 --- a/xen/arch/x86/tboot.c	Tue May 27 10:31:55 2008 +0100
     2.2 +++ b/xen/arch/x86/tboot.c	Tue May 27 10:35:10 2008 +0100
     2.3 @@ -96,13 +96,13 @@ int tboot_in_measured_env(void)
     2.4      return (g_tboot_shared != NULL);
     2.5  }
     2.6  
     2.7 -int tboot_in_range(unsigned long start, unsigned long end)
     2.8 +int tboot_in_range(paddr_t start, paddr_t end)
     2.9  {
    2.10      if ( g_tboot_shared == NULL || g_tboot_shared->version < 0x02 )
    2.11          return 0;
    2.12  
    2.13 -    start = max_t(unsigned long, start, g_tboot_shared->tboot_base);
    2.14 -    end = min_t(unsigned long, end, 
    2.15 +    start = max_t(paddr_t, start, g_tboot_shared->tboot_base);
    2.16 +    end = min_t(paddr_t, end, 
    2.17                  g_tboot_shared->tboot_base + g_tboot_shared->tboot_size);
    2.18   
    2.19      return start < end; 
     3.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Tue May 27 10:31:55 2008 +0100
     3.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Tue May 27 10:35:10 2008 +0100
     3.3 @@ -1074,7 +1074,8 @@ static int intel_iommu_domain_init(struc
     3.4      struct hvm_iommu *hd = domain_hvm_iommu(d);
     3.5      struct iommu *iommu = NULL;
     3.6      int guest_width = DEFAULT_DOMAIN_ADDRESS_WIDTH;
     3.7 -    int i, adjust_width, agaw;
     3.8 +    int adjust_width, agaw;
     3.9 +    u64 i;
    3.10      unsigned long sagaw;
    3.11      struct acpi_drhd_unit *drhd;
    3.12  
    3.13 @@ -1102,8 +1103,8 @@ static int intel_iommu_domain_init(struc
    3.14  
    3.15      if ( d->domain_id == 0 )
    3.16      {
    3.17 -        extern int xen_in_range(unsigned long start, unsigned long end);
    3.18 -        extern int tboot_in_range(unsigned long start, unsigned long end);
    3.19 +        extern int xen_in_range(paddr_t start, paddr_t end);
    3.20 +        extern int tboot_in_range(paddr_t start, paddr_t end);
    3.21  
    3.22          /* 
    3.23           * Set up 1:1 page table for dom0 except the critical segments