[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.1-testing] x86: Fix time-scale calculation to avoid #DE fault.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192127020 -3600
# Node ID 3a5f2601ac57a89a77f41d1c5855a6fee624465f
# Parent  97c651bac87fffb6b099c53baef79567ea487b8f
x86: Fix time-scale calculation to avoid #DE fault.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   16098:f6a06b2eefc5931a9cd9ec71baec94d67fe06909
xen-unstable date:        Thu Oct 11 19:23:40 2007 +0100
---
 xen/arch/x86/time.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r 97c651bac87f -r 3a5f2601ac57 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Thu Oct 11 19:18:12 2007 +0100
+++ b/xen/arch/x86/time.c       Thu Oct 11 19:23:40 2007 +0100
@@ -215,6 +215,8 @@ static void set_time_scale(struct time_s
     u32 tps32;
     int shift = 0;
 
+    ASSERT(tps64 != 0);
+
     while ( tps64 > (MILLISECS(1000)*2) )
     {
         tps64 >>= 1;
@@ -222,7 +224,7 @@ static void set_time_scale(struct time_s
     }
 
     tps32 = (u32)tps64;
-    while ( tps32 < (u32)MILLISECS(1000) )
+    while ( tps32 <= (u32)MILLISECS(1000) )
     {
         tps32 <<= 1;
         shift++;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.