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

[Xen-changelog] [xen-unstable] x86 hvm: Fix VLAPIC TMCCT register when timer is one-shot



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1291745446 0
# Node ID f5d6afa46dd796d46dee028a28c97d29491e288c
# Parent  de851b79600c1e782201873eb1387d922ab872eb
x86 hvm: Fix VLAPIC TMCCT register when timer is one-shot

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/x86/hvm/vlapic.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -r de851b79600c -r f5d6afa46dd7 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Fri Dec 03 06:37:48 2010 +0000
+++ b/xen/arch/x86/hvm/vlapic.c Tue Dec 07 18:10:46 2010 +0000
@@ -430,7 +430,7 @@ static uint32_t vlapic_get_tmcct(struct 
 
     counter_passed = ((hvm_get_guest_time(v) - vlapic->timer_last_update)
                       / APIC_BUS_CYCLE_NS / vlapic->hw.timer_divisor);
-    tmcct = tmict - counter_passed;
+    tmcct = (counter_passed < tmict) ? tmict - counter_passed : 0;
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER,
                 "timer initial count %d, timer current count %d, "
@@ -677,7 +677,8 @@ static int vlapic_write(struct vcpu *v, 
                   (uint32_t)val * vlapic->hw.timer_divisor);
         create_periodic_time(current, &vlapic->pt, period, 
                              vlapic_lvtt_period(vlapic) ? period : 0,
-                             vlapic->pt.irq, vlapic_pt_cb,
+                             vlapic->pt.irq,
+                             vlapic_lvtt_period(vlapic) ? vlapic_pt_cb : NULL,
                              &vlapic->timer_last_update);
         vlapic->timer_last_update = vlapic->pt.last_plt_gtime;
 
@@ -874,7 +875,8 @@ static void lapic_rearm(struct vlapic *s
     s->pt.irq = vlapic_get_reg(s, APIC_LVTT) & APIC_VECTOR_MASK;
     create_periodic_time(vlapic_vcpu(s), &s->pt, period,
                          vlapic_lvtt_period(s) ? period : 0,
-                         s->pt.irq, vlapic_pt_cb,
+                         s->pt.irq,
+                         vlapic_lvtt_period(s) ? vlapic_pt_cb : NULL,
                          &s->timer_last_update);
     s->timer_last_update = s->pt.last_plt_gtime;
 }

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