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] x86 hvm: fix missing ticks issue in c/s 20218

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] x86 hvm: fix missing ticks issue in c/s 20218
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 25 Sep 2009 13:37:41 +0900
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 24 Sep 2009 21:38:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Although c/s 20229 fixes missing ticks issue in c/s 20218,
it's not enough.

- set a timer to the next period more straightforwardly.
- fix an unexpected behavior of both timer_mode=2 and timer_mode=3.
  extra interrupts might be delivered to a guest.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 0f8376078dc1 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c    Wed Sep 23 18:19:30 2009 +0100
+++ b/xen/arch/x86/hvm/vpt.c    Thu Sep 24 17:19:56 2009 +0900
@@ -313,20 +313,23 @@ void pt_intr_post(struct vcpu *v, struct
         if ( mode_is(v->domain, one_missed_tick_pending) ||
              mode_is(v->domain, no_missed_ticks_pending) )
         {
+            pt_process_missed_ticks(pt);
+            set_timer(&pt->timer, pt->scheduled);
+
             pt->last_plt_gtime = hvm_get_guest_time(v);
             pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
         }
         else
         {
+            s_time_t now = NOW();
+
+            if ( pt->scheduled > now )
+            {
+                set_timer(&pt->timer, pt->scheduled);
+                pt->pending_intr_nr = 0;
+            }
+
             pt->last_plt_gtime += pt->period;
-            pt->pending_intr_nr--;
-        }
-
-        if ( pt->pending_intr_nr == 0 )
-        {
-            pt_process_missed_ticks(pt);
-            pt->do_not_freeze = 0;
-            set_timer(&pt->timer, pt->scheduled);
         }
     }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel