[HVM] Only update guest time on timer interrupt delivery if the guest time is in...
authorChristian Limpach <Christian.Limpach@xensource.com>
Fri, 19 Jan 2007 11:58:52 +0000 (11:58 +0000)
committerChristian Limpach <Christian.Limpach@xensource.com>
Fri, 19 Jan 2007 11:58:52 +0000 (11:58 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
xen/arch/x86/hvm/vpt.c

index 8287289172124aff20748eabae2e5a51bf55a152..6bd9fab154a218f3f5e6a3676628eb2cf6f3af29 100644 (file)
@@ -163,13 +163,17 @@ struct periodic_time *is_pt_irq(struct vcpu *v, int vector, int type)
 void pt_intr_post(struct vcpu *v, int vector, int type)
 {
     struct periodic_time *pt = is_pt_irq(v, vector, type);
+    unsigned long long gtime;
 
     if ( pt == NULL )
         return;
 
     pt->pending_intr_nr--;
     pt->last_plt_gtime += pt->period_cycles;
-    hvm_set_guest_time(pt->vcpu, pt->last_plt_gtime);
+
+    gtime = hvm_get_guest_time(pt->vcpu);
+    if (gtime < pt->last_plt_gtime)
+        hvm_set_guest_time(pt->vcpu, pt->last_plt_gtime);
 
     if ( pt->cb != NULL )
         pt->cb(pt->vcpu, pt->priv);