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] [xen-unstable] [HVM][PIT] Fix missed_ticks() logic.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM][PIT] Fix missed_ticks() logic.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Jun 2006 14:20:13 +0000
Delivery-date: Wed, 07 Jun 2006 07:21:57 -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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID cca6641d40875d955654fc75506b49fe85e7f03f
# Parent  28128dafbe03758434bc947002758edf60a2747e
[HVM][PIT] Fix missed_ticks() logic.
Signed-off-by Xiaowei Yang <xiaowei.yang@xxxxxxxxx>
---
 xen/arch/x86/hvm/intercept.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 28128dafbe03 -r cca6641d4087 xen/arch/x86/hvm/intercept.c
--- a/xen/arch/x86/hvm/intercept.c      Wed Jun 07 13:38:08 2006 +0100
+++ b/xen/arch/x86/hvm/intercept.c      Wed Jun 07 13:42:21 2006 +0100
@@ -216,13 +216,14 @@ void hlt_timer_fn(void *data)
 
 static __inline__ void missed_ticks(struct periodic_time *pt)
 {
-    int missed_ticks;
-
-    missed_ticks = (NOW() - pt->scheduled)/(s_time_t) pt->period;
-    if ( missed_ticks++ >= 0 ) {
+    s_time_t missed_ticks;
+
+    missed_ticks = NOW() - pt->scheduled;
+    if ( missed_ticks > 0 ) {
+       missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
         if ( missed_ticks > 1000 ) {
             /* TODO: Adjust guest time togther */
-            pt->pending_intr_nr ++;
+            pt->pending_intr_nr++;
         }
         else {
             pt->pending_intr_nr += missed_ticks;
@@ -236,6 +237,9 @@ void pt_timer_fn(void *data)
 {
     struct vcpu *v = data;
     struct periodic_time *pt = 
&(v->domain->arch.hvm_domain.pl_time.periodic_tm);
+
+    pt->pending_intr_nr++;
+    pt->scheduled += pt->period;
 
     /* pick up missed timer tick */
     missed_ticks(pt);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM][PIT] Fix missed_ticks() logic., Xen patchbot-unstable <=