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

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



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192127020 -3600
# Node ID f6a06b2eefc5931a9cd9ec71baec94d67fe06909
# Parent  d5531095d06b5e4513e891b89fd3085311490304
x86: Fix time-scale calculation to avoid #DE fault.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/time.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r d5531095d06b -r f6a06b2eefc5 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
@@ -214,6 +214,8 @@ static void set_time_scale(struct time_s
     u32 tps32;
     int shift = 0;
 
+    ASSERT(tps64 != 0);
+
     while ( tps64 > (MILLISECS(1000)*2) )
     {
         tps64 >>= 1;
@@ -221,7 +223,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®.