xen/arm: more virt_timer fixes
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.
Signed-off-by Stefano Stabellini <[email protected]>
--- xen/arch/arm/vtimer.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
xen/arch/arm/vtimer.c +4 -1
@@ -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