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] Re: [PATCH] x86 hvm: fix missing ticks bug of c/s 20218

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] x86 hvm: fix missing ticks bug of c/s 20218
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 18 Sep 2009 17:33:01 +0900
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 18 Sep 2009 01:33:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C6D8FAA5.1514E%keir.fraser@xxxxxxxxxxxxx>
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>
References: <7k8wgcdduj.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx> <C6D8FAA5.1514E%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Keir Fraser writes:
> Moving the line 'pt->scheduled += pt->period' inside the if statement looks
> pretty dubious. Does your fix still work if we don't move that line? For the
> default timer mode I'm not sure it should make any difference either way,
> but it would for timer mode 0.

Oops, my brain was dead. You are right. 
New one is attached. Of course it works. 

Thanks,
Kouya

> 
>  -- Keir
> 
> On 18/09/2009 06:24, "Kouya Shimura" <kouya@xxxxxxxxxxxxxx> wrote:
> 
> > With c/s 20218, timer ticks might be missed when IRQs of a timer are queued.
> > Next scheduled time is accumulated wrongly.
> > 
> > Thanks to Christoph for the report.
> > 
> > Thanks,
> > Kouya
> > 
> > Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
> > Reported-by: Christoph Egger <Christoph.Egger@xxxxxxx>
> > 
> 

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Reported-by: Christoph Egger <Christoph.Egger@xxxxxxx>

diff -r 72d130772f36 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c    Wed Sep 16 09:30:41 2009 +0100
+++ b/xen/arch/x86/hvm/vpt.c    Fri Sep 18 17:13:25 2009 +0900
@@ -309,7 +309,6 @@ void pt_intr_post(struct vcpu *v, struct
     else
     {
         pt->scheduled += pt->period;
-        pt_process_missed_ticks(pt);
 
         if ( mode_is(v->domain, one_missed_tick_pending) ||
              mode_is(v->domain, no_missed_ticks_pending) )
@@ -324,7 +323,11 @@ void pt_intr_post(struct vcpu *v, struct
         }
 
         if ( pt->pending_intr_nr == 0 )
+        {
+            pt_process_missed_ticks(pt);
+            pt->do_not_freeze = 0;
             set_timer(&pt->timer, pt->scheduled);
+        }
     }
 
     if ( mode_is(v->domain, delay_for_missed_ticks) &&
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>