Skip to contentSkip to conversation

xen/arm: don't set the internal Xen timer if virt_timer is masked

PATCH Superseded Stefano Stabellini 2 participants 2 messages Feb 18, 2013 – Apr 10, 2013

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 4/4 xen/arm: don't set the internal Xen timer if virt_timer is masked

Changes in v2:
- do not disable interrupts in virt_timer_save because they are already disabled during the entirety of ctxt_switch_from by a previous patch.

---
 xen/arch/arm/vtimer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
xen/arch/arm/vtimer.c +2 -1
index fec363b..5d650d7 100644
@@ -87,7 +87,8 @@ int virt_timer_save(struct vcpu *v)
     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 )
+    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
#1 lore raw
Quoted 5 lines · Stefano Stabellini

Changes in v2:
- do not disable interrupts in virt_timer_save because they are already disabled during the entirety of ctxt_switch_from by a previous patch.

Acked + applied. I have to fixup the context due to the change to 64-but register names.

Quoted 18 lines
---
 xen/arch/arm/vtimer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
xen/arch/arm/vtimer.c +2 -1
index fec363b..5d650d7 100644
@@ -87,7 +87,8 @@ int virt_timer_save(struct vcpu *v)
     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 )
+    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));