Skip to contentSkip to conversation

xen/arm: more virt_timer fixes

PATCH Superseded Stefano Stabellini 1 participant 1 message Feb 15, 2013

v1 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 xen/arm: more virt_timer fixes

Do not set the Xen internal timer if the virt_timer is masked.

Disable interrupts while saving the virt_timer registers to avoid conflicts with possible virt_timer interrupts coming through.

---
 xen/arch/arm/vtimer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
xen/arch/arm/vtimer.c +4 -1
index e033191..67fa513 100644
@@ -89,10 +89,13 @@ int virt_timer_save(struct vcpu *v)
     if ( is_idle_domain(v->domain) )
         return 0;
 
+    local_irq_disable();
     v->arch.virt_timer.ctl = READ_CP32(CNTV_CTL);
     WRITE_CP32(v->arch.virt_timer.ctl & ~CNTx_CTL_ENABLE, CNTV_CTL);
     v->arch.virt_timer.cval = READ_CP64(CNTV_CVAL);
-    if ( v->arch.virt_timer.ctl & CNTx_CTL_ENABLE )
+    local_irq_enable();
+    if ( (v->arch.virt_timer.ctl & CNTx_CTL_ENABLE) &&
+         !(v->arch.virt_timer.ctl & CNTx_CTL_MASK))
     {
         set_timer(&v->arch.virt_timer.timer, ticks_to_ns(v->arch.virt_timer.cval +
                   v->arch.virt_timer.offset - boot_count));
Signature · 1 line
1.7.2.5