# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1240485689 -3600
# Node ID 3ccd0f0dba5bc3491095bc0f72f41e17190eacf8
# Parent 855e2f5ddb6702fddc4fb5afa15a323d8ef93c48
x86 numa: Fix left shift overflows
Signed-off-by: Yang Xiaowei <xiaowei.yang@xxxxxxxxx>
---
xen/arch/x86/numa.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff -r 855e2f5ddb67 -r 3ccd0f0dba5b xen/arch/x86/numa.c
--- a/xen/arch/x86/numa.c Thu Apr 23 12:19:14 2009 +0100
+++ b/xen/arch/x86/numa.c Thu Apr 23 12:21:29 2009 +0100
@@ -74,7 +74,7 @@ populate_memnodemap(const struct node *n
if (memnodemap[addr >> shift] != 0xff)
return -1;
memnodemap[addr >> shift] = i;
- addr += (1UL << shift);
+ addr += (1ULL << shift);
} while (addr < end);
res = 1;
}
@@ -290,7 +290,7 @@ static void dump_numa(unsigned char key)
(u32)(now>>32), (u32)now);
for_each_online_node(i) {
- paddr_t pa = (NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT;
+ paddr_t pa = (paddr_t)(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,
@@ -314,7 +314,7 @@ static void dump_numa(unsigned char key)
page_list_for_each(page, &d->page_list)
{
- i = phys_to_nid(page_to_mfn(page) << PAGE_SHIFT);
+ i = phys_to_nid((paddr_t)page_to_mfn(page) <<
PAGE_SHIFT);
page_num_node[i]++;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|