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

[Xen-changelog] [xen-unstable] x86 hvm: *really* fix missing ticks bug of c/s 20218



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1253888458 -3600
# Node ID 623aa5c2eaa47b5a1ae1bad578beda06013a79d4
# Parent  731ea5884f8b343565ff5034be0369cf5e057b23
x86 hvm: *really* fix missing ticks bug of c/s 20218

With c/s 20218, timer ticks might be missed when IRQs of a timer are
queued. "Next scheduled time" is accumulated wrongly.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vpt.c |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff -r 731ea5884f8b -r 623aa5c2eaa4 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c    Fri Sep 25 15:12:45 2009 +0100
+++ b/xen/arch/x86/hvm/vpt.c    Fri Sep 25 15:20:58 2009 +0100
@@ -206,6 +206,7 @@ static void pt_timer_fn(void *data)
     pt_lock(pt);
 
     pt->pending_intr_nr++;
+    pt->scheduled += pt->period;
     pt->do_not_freeze = 0;
 
     vcpu_kick(pt->vcpu);
@@ -306,27 +307,22 @@ void pt_intr_post(struct vcpu *v, struct
         pt->on_list = 0;
         pt->pending_intr_nr = 0;
     }
+    else if ( mode_is(v->domain, one_missed_tick_pending) ||
+              mode_is(v->domain, no_missed_ticks_pending) )
+    {
+        pt->last_plt_gtime = hvm_get_guest_time(v);
+        pt_process_missed_ticks(pt);
+        pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
+        set_timer(&pt->timer, pt->scheduled);
+    }
     else
     {
-        pt->scheduled += pt->period;
-
-        if ( mode_is(v->domain, one_missed_tick_pending) ||
-             mode_is(v->domain, no_missed_ticks_pending) )
-        {
-            pt->last_plt_gtime = hvm_get_guest_time(v);
-            pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
-        }
-        else
-        {
-            pt->last_plt_gtime += pt->period;
-            pt->pending_intr_nr--;
-        }
-
-        if ( pt->pending_intr_nr == 0 )
+        pt->last_plt_gtime += pt->period;
+        if ( --pt->pending_intr_nr == 0 )
         {
             pt_process_missed_ticks(pt);
-            pt->do_not_freeze = 0;
-            set_timer(&pt->timer, pt->scheduled);
+            if ( pt->pending_intr_nr == 0 )
+                set_timer(&pt->timer, pt->scheduled);
         }
     }
 

_______________________________________________
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®.