[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] machine_specific_memory_setup() makes the following call to setup e820:



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 06ce728dcede08a5c555bc4be4d41cccf2daf158
# Parent  f9b300fab36e2a7fef2160ca2e6ab0db1f1b3280
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@xxxxxxxxxx

diff -r f9b300fab36e -r 06ce728dcede 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h     Fri Oct 14 
17:27:25 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h     Fri Oct 14 
21:15:21 2005
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.