aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/numa.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-03-17 11:18:06 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-03-17 11:18:06 +0000
commit70ee3b38284cb6bdf320f43ccb1bd33d4315b26f (patch)
treec5bcd44dad85e69c83da36e2872bffab68ab2ac5 /xen/arch/x86/numa.c
parent79e5898480cf02e7fe812afaea18dcd76457711d (diff)
downloadxen-70ee3b38284cb6bdf320f43ccb1bd33d4315b26f.tar.gz
xen-70ee3b38284cb6bdf320f43ccb1bd33d4315b26f.tar.bz2
xen-70ee3b38284cb6bdf320f43ccb1bd33d4315b26f.zip
x86 numa: Fix the overflow of physical addresses.
If memory address >4G, the address will overflow in some NUMA code if using unsigned long to statement a physical address in PAE arch. Replace "unsigned long" with paddr_t to avoid overflow. Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
Diffstat (limited to 'xen/arch/x86/numa.c')
-rw-r--r--xen/arch/x86/numa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index e80a3995a1..9f983db06d 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -57,7 +57,7 @@ populate_memnodemap(const struct node *nodes, int numnodes, int shift)
{
int i;
int res = -1;
- unsigned long addr, end;
+ paddr_t addr, end;
if (shift >= 64)
return -1;
@@ -286,13 +286,13 @@ static void dump_numa(unsigned char key)
(u32)(now>>32), (u32)now);
for_each_online_node(i) {
- unsigned long pa = (NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT;
+ paddr_t pa = (NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT;
printk("idx%d -> NODE%d start->%lu size->%lu\n",
i, NODE_DATA(i)->node_id,
NODE_DATA(i)->node_start_pfn,
NODE_DATA(i)->node_spanned_pages);
/* sanity check phys_to_nid() */
- printk("phys_to_nid(%lx) -> %d should be %d\n", pa, phys_to_nid(pa),
+ printk("phys_to_nid(%"PRIpaddr") -> %d should be %d\n", pa, phys_to_nid(pa),
NODE_DATA(i)->node_id);
}
for_each_online_cpu(i)