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

[Xen-devel] [PATCH] pit-div_round.patch



Truly round off the div result to get right PIT frequency for guest. 
Otherwise, the guest's idea of time drifts away from that of the host.
 
Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

Index: trunk/xen/include/xen/lib.h
===================================================================
--- trunk/xen/include/xen/lib.h (revision 688)
+++ trunk/xen/include/xen/lib.h (working copy)
@@ -21,7 +21,7 @@
 #define SWAP(_a, _b) \
    do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
 
-#define DIV_ROUND(x, y) (((x) + (y) - 1) / (y))
+#define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
 
 #define reserve_bootmem(_p,_l) ((void)0)
 

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


 


Rackspace

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