powerpc/xive: Add interrupt flag to disable automatic EOI
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 12 Jan 2018 02:39:28 +0000 (13:39 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 12 Jan 2018 04:24:44 +0000 (15:24 +1100)
This will be used by KVM in order to keep escalation interrupts
in the non-EOI (masked) state after they fire. They will be
re-enabled directly in HW by KVM when needed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/xive.h
arch/powerpc/sysdev/xive/common.c

index 0e77005cf021dcf4055beb69aeb28cb6f1b561d3..b619a5585cd68bae8834bf5b52ee95e77ff6fa6f 100644 (file)
@@ -58,6 +58,9 @@ struct xive_irq_data {
 #define XIVE_IRQ_FLAG_EOI_FW   0x10
 #define XIVE_IRQ_FLAG_H_INT_ESB        0x20
 
+/* Special flag set by KVM for excalation interrupts */
+#define XIVE_IRQ_NO_EOI                0x80
+
 #define XIVE_INVALID_CHIP_ID   -1
 
 /* A queue tracking structure in a CPU */
index a3b8d7d1316eb1863f19ffa19ff34f0c761ada33..2547b6021e6a05d105b2ac98c57161fc97327650 100644 (file)
@@ -367,7 +367,8 @@ static void xive_irq_eoi(struct irq_data *d)
         * EOI the source if it hasn't been disabled and hasn't
         * been passed-through to a KVM guest
         */
-       if (!irqd_irq_disabled(d) && !irqd_is_forwarded_to_vcpu(d))
+       if (!irqd_irq_disabled(d) && !irqd_is_forwarded_to_vcpu(d) &&
+           !(xd->flags & XIVE_IRQ_NO_EOI))
                xive_do_source_eoi(irqd_to_hwirq(d), xd);
 
        /*