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] [linux-2.6.18-xen] xen/i386: follow-up to c/s 1101

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/i386: follow-up to c/s 1101
From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
Date: Fri, 19 Aug 2011 10:11:04 +0100
Delivery-date: Fri, 19 Aug 2011 02:11:20 -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 Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1313744027 -3600
# Node ID 0b8a9b22b70a2a69f829182368ec4590d5e93792
# Parent  82782f1361a9949554141eb2edeac18b92b27260
xen/i386: follow-up to c/s 1101

The numbers obtained from the hypervisor really can't ever lead to an
overflow here, only the original calculation going through the order
of the range could have. This avoids the (as Jeremy points outs)
somewhat ugly NULL-based calculation here.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r 82782f1361a9 -r 0b8a9b22b70a arch/i386/mach-xen/setup.c
--- a/arch/i386/mach-xen/setup.c        Mon Jul 25 13:49:25 2011 +0100
+++ b/arch/i386/mach-xen/setup.c        Fri Aug 19 09:53:47 2011 +0100
@@ -110,10 +110,8 @@
                machine_to_phys_nr = mapping.max_mfn + 1;
        } else
                machine_to_phys_nr = MACH2PHYS_NR_ENTRIES;
-       if (machine_to_phys_mapping + machine_to_phys_nr
-           < machine_to_phys_mapping)
-               machine_to_phys_nr = (unsigned long *)NULL
-                                    - machine_to_phys_mapping;
+       WARN_ON(machine_to_phys_mapping + (machine_to_phys_nr - 1)
+               < machine_to_phys_mapping);
 
        if (!xen_feature(XENFEAT_auto_translated_physmap))
                phys_to_machine_mapping =

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/i386: follow-up to c/s 1101, Xen patchbot-linux-2 . 6 . 18-xen <=