]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 8 May 2013 11:41:11 +0000 (12:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 8 May 2013 11:59:30 +0000 (12:59 +0100)
If we need to inject an irq into a VCPU that is running on a different
processor, we shouldn't just enqueue the irq into the lr_pending and
inflight lists and wait for something to interrupt the guest execution.
Send an IPI to the target pcpu so that Xen can inject the new interrupt
returning to guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/vgic.c

index 5d242c871e94885667a86d50306965c04df90741..0e9cc4a1369570de742e5f2e1e807c712df5aef4 100644 (file)
@@ -648,6 +648,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     struct vgic_irq_rank *rank = vgic_irq_rank(v, 8, idx);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
+    bool_t running;
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
@@ -683,7 +684,10 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
+    running = v->is_running;
     vcpu_unblock(v);
+    if ( running && v != current )
+        smp_send_event_check_mask(cpumask_of(v->processor));
 }
 
 /*