The current checks don't allow us to assign or release interrupts
with INTID greater than 1024. This patch adds an additional condition
to check whether the IRQ number is in the eSPI range and allows it to
be assigned to Xen and domains if it is.

Signed-off-by: Leonid Komarianskyi <leonid_komarians...@epam.com>
---
 xen/arch/arm/irq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 3f68257fde..8c47eeb7c3 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -444,8 +444,8 @@ err:
 
 bool is_assignable_irq(unsigned int irq)
 {
-    /* For now, we can only route SPIs to the guest */
-    return (irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines());
+    /* For now, we can only route SPIs and eSPIs to the guest */
+    return (((irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines())) || 
is_espi(irq));
 }
 
 /*
@@ -589,8 +589,8 @@ int release_guest_irq(struct domain *d, unsigned int virq)
     unsigned long flags;
     int ret;
 
-    /* Only SPIs are supported */
-    if ( virq < NR_LOCAL_IRQS || virq >= vgic_num_irqs(d) )
+    /* Only SPIs and eSPIs are supported */
+    if ( (virq < NR_LOCAL_IRQS || virq >= vgic_num_irqs(d)) && !is_espi(virq) )
         return -EINVAL;
 
     desc = vgic_get_hw_irq_desc(d, NULL, virq);
-- 
2.34.1

Reply via email to