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

[Xen-devel] [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 <stefano.stabellini@xxxxxxxxxxxxx>
---
 xen/arch/arm/vtimer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index e033191..67fa513 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -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));
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.