ia64/xen-unstable

changeset 7391:06ce728dcede

machine_specific_memory_setup() makes the following call to setup e820:

add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);

Since max_pfn is (rightly) an unsigned long, we overflow for the current
definition of PFN_PHYS. Attached is my preferred solution as it will
hopefully avoid similar situations that may come up in the future.

Signed-off-by: srparish@us.ibm.com
author kaf24@firebug.cl.cam.ac.uk
date Fri Oct 14 22:15:21 2005 +0100 (2005-10-14)
parents f9b300fab36e
children 768b04d09dde
files linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h	Fri Oct 14 18:27:25 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h	Fri Oct 14 22:15:21 2005 +0100
     1.3 @@ -8,7 +8,7 @@
     1.4  
     1.5  #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
     1.6  #define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
     1.7 -#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
     1.8 +#define PFN_PHYS(x)	((unsigned long long)(x) << PAGE_SHIFT)
     1.9  
    1.10  /*
    1.11   * Reserved space for vmalloc and iomap - defined in asm/page.h