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: Do not allow gcc-3.4 to turn loo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen: Do not allow gcc-3.4 to turn loop on a 64-bit variable into
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 May 2008 05:40:11 -0700
Delivery-date: Thu, 22 May 2008 05:40:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 1211385877 -3600
# Node ID 446c39a967fc0904e2d27ca876c671b414fb5917
# Parent  1e8c3287b395f53d91c5e1951325563b5942d2c0
xen: Do not allow gcc-3.4 to turn loop on a 64-bit variable into
64-bit division, which the kernel does not support.

Signed-off-by: Guillaume Rousse <guillaume.rousse@xxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 arch/i386/kernel/time-xen.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -r 1e8c3287b395 -r 446c39a967fc arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Wed May 21 11:11:00 2008 +0100
+++ b/arch/i386/kernel/time-xen.c       Wed May 21 17:04:37 2008 +0100
@@ -137,13 +137,21 @@ static void __clock_was_set(void *unused
 }
 static DECLARE_WORK(clock_was_set_work, __clock_was_set, NULL);
 
+/*
+ * GCC 4.3 can turn loops over an induction variable into division. We do
+ * not support arbitrary 64-bit division, and so must break the induction.
+ */
+#define clobber_induction_variable(v) asm ( "" : "+r" (v) )
+
 static inline void __normalize_time(time_t *sec, s64 *nsec)
 {
        while (*nsec >= NSEC_PER_SEC) {
+               clobber_induction_variable(*nsec);
                (*nsec) -= NSEC_PER_SEC;
                (*sec)++;
        }
        while (*nsec < 0) {
+               clobber_induction_variable(*nsec);
                (*nsec) += NSEC_PER_SEC;
                (*sec)--;
        }

_______________________________________________
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: Do not allow gcc-3.4 to turn loop on a 64-bit variable into, Xen patchbot-linux-2.6.18-xen <=