@@ -57,6 +57,7 @@ static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
static DEFINE_PER_CPU(uint64_t, lr_mask);
static unsigned nr_lrs;
+#define lr_all_full() (this_cpu(lr_mask) == ((1 << nr_lrs) - 1))
/* The GIC mapping of CPU interfaces does not necessarily match the
* logical CPU numbering. Let's use mapping as returned by the GIC
@@ -738,6 +739,11 @@ void gic_inject(void)
vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
gic_restore_pending_irqs(current);
+
+ if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() )
+ GICH[GICH_HCR] |= GICH_HCR_UIE;
+ else
+ GICH[GICH_HCR] &= ~GICH_HCR_UIE;
}
int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,