ia64/xen-unstable

changeset 19571:3ccd0f0dba5b

x86 numa: Fix left shift overflows

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 23 12:21:29 2009 +0100 (2009-04-23)
parents 855e2f5ddb67
children 8b152638adaa
files xen/arch/x86/numa.c
line diff
     1.1 --- a/xen/arch/x86/numa.c	Thu Apr 23 12:19:14 2009 +0100
     1.2 +++ b/xen/arch/x86/numa.c	Thu Apr 23 12:21:29 2009 +0100
     1.3 @@ -74,7 +74,7 @@ populate_memnodemap(const struct node *n
     1.4  			if (memnodemap[addr >> shift] != 0xff)
     1.5  				return -1;
     1.6  			memnodemap[addr >> shift] = i;
     1.7 -			addr += (1UL << shift);
     1.8 +			addr += (1ULL << shift);
     1.9  		} while (addr < end);
    1.10  		res = 1;
    1.11  	} 
    1.12 @@ -290,7 +290,7 @@ static void dump_numa(unsigned char key)
    1.13  		  (u32)(now>>32), (u32)now);
    1.14  
    1.15  	for_each_online_node(i) {
    1.16 -		paddr_t pa = (NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT;
    1.17 +		paddr_t pa = (paddr_t)(NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT;
    1.18  		printk("idx%d -> NODE%d start->%lu size->%lu\n",
    1.19  			  i, NODE_DATA(i)->node_id,
    1.20  			  NODE_DATA(i)->node_start_pfn,
    1.21 @@ -314,7 +314,7 @@ static void dump_numa(unsigned char key)
    1.22  
    1.23  		page_list_for_each(page, &d->page_list)
    1.24  		{
    1.25 -			i = phys_to_nid(page_to_mfn(page) << PAGE_SHIFT);
    1.26 +			i = phys_to_nid((paddr_t)page_to_mfn(page) << PAGE_SHIFT);
    1.27  			page_num_node[i]++;
    1.28  		}
    1.29