PFN_PHYS PAE overflow (fixes bug 242)
PATCH 1/1 PFN_PHYS PAE overflow (fixes bug 242)
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.
sRp
Signature · 2 lines
Scott Parish Signed-off-by: [email protected]
linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h +1 -1
@@ -8,7 +8,7 @@#define PFN_UP (x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)#define PFN_DOWN (x) ((x) >> PAGE_SHIFT) -#define PFN_PHYS (x) ((x) << PAGE_SHIFT) +#define PFN_PHYS (x) ((unsigned long long)(x) << PAGE_SHIFT)/* * Reserved space for vmalloc and iomap - defined in asm/page.h
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel