WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86 numa: Fix left shift overflows

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 numa: Fix left shift overflows
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Apr 2009 09:10:12 -0700
Delivery-date: Fri, 24 Apr 2009 09:10:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86 numa: Fix left shift overflows, Xen patchbot-unstable <=