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-devel

[Xen-devel] [PATCH]Fixes for overflowed calculation in vHPET

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]Fixes for overflowed calculation in vHPET
From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Date: Fri, 4 Jan 2008 11:21:18 +0800
Cc: Mark McLoughlin <markmc@xxxxxxxxxx>, "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Delivery-date: Thu, 03 Jan 2008 19:23:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchIXkjedwVeiEy4RPSClG5JXO2lGgAACgGgAYh9u4A=
Thread-topic: [PATCH]Fixes for overflowed calculation in vHPET
This patch will fix the bugs in hpet_set_timer. Currently in hpet_tick_to_ns, the approach is multiplying first, which easily causes overflow when tick is quite large. The patch cannot handle arbitrate large ticks duo to the precision requirement and 64bit's value range. But by optimize the equation, a larger ticks than current code can be supported. Also an overflow check is added before the calculation.

This patch will also fix the wrong handling of wrap around case when timer is in 64bit mode.

Best Regards
Haitao Shan

Attachment: hpet2.patch
Description: hpet2.patch

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