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

[Xen-changelog] [xen-unstable] xen/vtimer: fixes and improvements


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 19 Feb 2013 15:22:28 +0000
  • Delivery-date: Tue, 19 Feb 2013 15:22:54 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1360935146 0
# Node ID 59161c5b3aa1e7c820adccecec216848e80375e8
# Parent  16857a81054736fb24e4b856bf3928f128445a01
xen/vtimer: fixes and improvements

Do not try to save and restore the vtimer for the idle domain.

Inject the vtimer interrupt from the Xen timer handler, taking care of
setting the timer as masked in the ctl field, so that at restore time it
is not going to fire the interrupt again.

No need to disable the vtimer before writing the new offset on restore:
the vtimer is already disabled.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 16857a810547 -r 59161c5b3aa1 xen/arch/arm/vtimer.c
--- a/xen/arch/arm/vtimer.c     Fri Feb 15 13:32:25 2013 +0000
+++ b/xen/arch/arm/vtimer.c     Fri Feb 15 13:32:26 2013 +0000
@@ -40,7 +40,8 @@ static void phys_timer_expired(void *dat
 static void virt_timer_expired(void *data)
 {
     struct vtimer *t = data;
-    vcpu_wake(t->v);
+    t->ctl |= CNTx_CTL_MASK;
+    vgic_vcpu_inject_irq(t->v, 27, 1);
 }
  
 int vcpu_vtimer_init(struct vcpu *v)
@@ -73,6 +74,9 @@ void vcpu_timer_destroy(struct vcpu *v)
 
 int virt_timer_save(struct vcpu *v)
 {
+    if ( is_idle_domain(v->domain) )
+        return 0;
+
     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);
@@ -86,9 +90,11 @@ int virt_timer_save(struct vcpu *v)
 
 int virt_timer_restore(struct vcpu *v)
 {
+    if ( is_idle_domain(v->domain) )
+        return 0;
+
     stop_timer(&v->arch.virt_timer.timer);
 
-    WRITE_CP32(v->arch.virt_timer.ctl & ~CNTx_CTL_ENABLE, CNTV_CTL);
     WRITE_CP64(v->arch.virt_timer.offset, CNTVOFF);
     WRITE_CP64(v->arch.virt_timer.cval, CNTV_CVAL);
     WRITE_CP32(v->arch.virt_timer.ctl, CNTV_CTL);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.