]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm: Remove IRQ acknowledgment from uk_intctlr_handle_irq
authorMichalis Pappas <michalis@unikraft.io>
Sun, 10 Sep 2023 21:59:12 +0000 (23:59 +0200)
committerRazvan Deaconescu <razvand@unikraft.io>
Fri, 20 Oct 2023 16:35:55 +0000 (19:35 +0300)
The method of interrupt acknowledgment varies between interrupt
controllers. On GIC interupts are implicitly ACKed when reading the
interrupt id from GICC_IAR before passing control to the interrupt
handler, and completion is signaled post handling via the GICC_EOIR.
On x86 controllers acknowledgment happens after interrupt handling
is complete.

Remove the explicit interrupt acknledgment from
`uk_intctlr_handle_irq()` as it causes duplicate acknowledgment on
Arm, and move it to `ops->handle_irq()` of the xPIC driver.

Notice: Picking individual commits in this PR will break the build.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1103

lib/ukintctlr/ukintctlr.c
plat/kvm/x86/cpu_vectors_x86_64.S

index 668bd796e1235d7d8502c0b3789aa21d66f51092..fd477c44e094894f7d5f9c0ff6f3088a74af1ca8 100644 (file)
@@ -125,7 +125,7 @@ void uk_intctlr_irq_handle(struct __regs *regs, unsigned int irq)
                /* Skip all normal handlers if an event handler handled the
                 * event
                 */
-               goto exit_ack;
+               goto exit;
        }
 
        for (i = 0; i < MAX_HANDLERS_PER_IRQ; i++) {
@@ -146,7 +146,7 @@ void uk_intctlr_irq_handle(struct __regs *regs, unsigned int irq)
                        __uk_test_and_set_bit(0, &sched_have_pending_events);
 
                if (h->func(h->arg) == 1)
-                       goto exit_ack;
+                       goto exit;
        }
        /*
         * Acknowledge interrupts even in the case when there was no handler for
@@ -156,11 +156,10 @@ void uk_intctlr_irq_handle(struct __regs *regs, unsigned int irq)
         */
        trace_uk_intctlr_unhandled_irq(irq);
 
-exit_ack:
+exit:
 #if CONFIG_LIBUKINTCTLR_ISR_ECTX_ASSERTIONS
        ukarch_ectx_assert_equal(ectx);
 #endif /* CONFIG_LIBUKINTCTLR_ISR_ECTX_ASSERTIONS */
-       intctrl_ack_irq(irq);
 
        return;
 }
index de7887c7bf07e9f1e202c0d2fafdc2bef95a9a22..9a9bab9d4bdd86c37dc6765dd8b608d2b492d6a0 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <x86/traps.h>
 #include <uk/asm/cfi.h>
+#include <uk/intctlr.h>
 
 #define ENTRY(X)     .global X ; .type X, @function ; X:
 
@@ -143,7 +144,7 @@ ENTRY(cpu_irq_\irqno)
 
        movq %rsp, %rdi
        movq $\irqno, %rsi
-       call _ukplat_irq_handle
+       call uk_intctlr_xpic_handle_irq
 
        addq $__REGS_PAD_SIZE, %rsp         /* we have some padding */
        .cfi_adjust_cfa_offset -__REGS_PAD_SIZE