]> xenbits.xensource.com Git - xen.git/commitdiff
x86, hvm: More fixes to no-missed-tick-accounting mode.
authorKeir Fraser <keir@xensource.com>
Mon, 5 Nov 2007 10:09:10 +0000 (10:09 +0000)
committerKeir Fraser <keir@xensource.com>
Mon, 5 Nov 2007 10:09:10 +0000 (10:09 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/vpt.c

index 49614997df237aa1ba95f11b8411806cbd1413bf..b1bd111f190d013de7625d2a9f3ca16a82771f30 100644 (file)
@@ -47,21 +47,26 @@ static void pt_unlock(struct periodic_time *pt)
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
 {
-    s_time_t missed_ticks;
-
-    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
-        return;
+    s_time_t missed_ticks, now = NOW();
 
     if ( pt->one_shot )
         return;
 
-    missed_ticks = NOW() - pt->scheduled;
+    missed_ticks = now - pt->scheduled;
     if ( missed_ticks <= 0 )
         return;
 
-    missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
-    pt->pending_intr_nr += missed_ticks;
-    pt->scheduled += missed_ticks * pt->period;
+    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
+    {
+        pt->pending_intr_nr = 1;
+        pt->scheduled = now + pt->scheduled;
+    }
+    else
+    {
+        missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
+        pt->pending_intr_nr += missed_ticks;
+        pt->scheduled += missed_ticks * pt->period;
+    }
 }
 
 static void pt_freeze_time(struct vcpu *v)