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

[Embedded-pv-devel] [PATCH RFC 05/18] xen/arm: allow reassigning of hw interrupts to guest domain



From: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx>

Patch allows reassigning of hardware interrupts from dom0 to
other guest domain.

Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx>
Signed-off-by: Iurii Konovalenko <iurii.konovalenko@xxxxxxxxxxxxxxx>
---
 xen/arch/arm/irq.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 1f38605..c470613 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -481,12 +481,23 @@ int route_irq_to_guest(struct domain *d, unsigned int 
virq,
         }
 
         if ( test_bit(_IRQ_GUEST, &desc->status) )
-            printk(XENLOG_G_ERR "IRQ %u is already used by domain %u\n",
-                   irq, ad->domain_id);
+        {
+            printk(XENLOG_G_DEBUG "IRQ %u is reassigned from domain %u to 
domain %u\n",
+                    irq, ad->domain_id, d->domain_id);
+
+            retval = gic_remove_irq_from_guest(ad, irq, desc);
+            if ( retval )
+                printk(XENLOG_G_ERR "failed to remove IRQ %u from domain %u 
(%d)\n",
+                        irq, ad->domain_id, retval);
+            xfree(desc->action);
+            desc->action = NULL;
+        }
         else
+        {
             printk(XENLOG_G_ERR "IRQ %u is already used by Xen\n", irq);
-        retval = -EBUSY;
-        goto out;
+                       retval = -EBUSY;
+                       goto out;
+        }
     }
 
     retval = __setup_irq(desc, 0, action);
-- 
2.8.2


_______________________________________________
Embedded-pv-devel mailing list
Embedded-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/embedded-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.