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] x86 hvm: *really* fix missing ticks bug o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 hvm: *really* fix missing ticks bug of c/s 20218
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Sep 2009 07:25:11 -0700
Delivery-date: Fri, 25 Sep 2009 07:25:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86 hvm: *really* fix missing ticks bug of c/s 20218, Xen patchbot-unstable <=