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

[Minios-devel] [UNIKRAFT PATCH] plat/kvm: Acknowledge all interrupts



Acknowledge interrupts even in the case when there was no
handler for it. We do this to (1) compensate potential
spurious interrupts like currently happening on virtio,
and (2) to minimize impact on device drivers that share
one interrupt line that got previously disabled. Whenever
an interrupt was unhandled a critical warning is still
printed to the kernel console.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 plat/kvm/irq.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/plat/kvm/irq.c b/plat/kvm/irq.c
index 0b734f67..ef95a022 100644
--- a/plat/kvm/irq.c
+++ b/plat/kvm/irq.c
@@ -80,7 +80,6 @@ extern unsigned long sched_have_pending_events;
 void _ukplat_irq_handle(unsigned long irq)
 {
        struct irq_handler *h;
-       int handled = 0;
 
        UK_SLIST_FOREACH(h, &irq_handlers[irq], entries) {
                /* TODO define platform wise macro for timer IRQ number */
@@ -97,16 +96,19 @@ void _ukplat_irq_handle(unsigned long irq)
                         */
                        __uk_test_and_set_bit(0, &sched_have_pending_events);
 
-               if (h->func(h->arg) == 1) {
-                       handled = 1;
-                       break;
-               }
+               if (h->func(h->arg) == 1)
+                       goto exit_ack;
        }
-
-       if (!handled)
-               uk_pr_crit("Unhandled irq=%lu\n", irq);
-       else
-               intctrl_ack_irq(irq);
+       /*
+        * Acknowledge interrupts even in the case when there was no handler for
+        * it. We do this to (1) compensate potential spurious interrupts of
+        * devices, and (2) to minimize impact on drivers that share one
+        * interrupt line that would then stay disabled.
+        */
+       uk_pr_crit("Unhandled irq=%lu\n", irq);
+
+exit_ack:
+       intctrl_ack_irq(irq);
 }
 
 int ukplat_irq_init(struct uk_alloc *a)
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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