From: Stefano Stabellini Date: Wed, 8 May 2013 11:41:11 +0000 (+0100) Subject: xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus X-Git-Tag: 4.3.0-rc2~70 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0c899a9f6fa9272c74ccdb659bcbfc0e74dcef45;p=people%2Fiwj%2Fxen.git xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus 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 Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 5d242c871e..0e9cc4a136 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -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)); } /*