Commit 9b00833dfd for qemu.org

commit 9b00833dfd9e031e2319c9ea85eeb2b622f80f5b
Author: Fuad Tabba <fuad.tabba@linux.dev>
Date:   Tue Nov 24 10:23:09 2026 +0000

    hw/intc/arm_gicv3_cpuif: Don't count a virtual EOI in EOImode 1

    icv_eoir_write() increments ICH_HCR_EL2.EOIcount for a virtual EOI with
    no matching list register, in either EOImode. The VirtualWriteEOIR0()
    and VirtualWriteEOIR1() pseudocode in the GICv3 architecture
    specification only does so in EOImode 0 (ICH_VMCR_EL2.VEOIM clear),
    since in EOImode 1 the DIR write increments EOIcount instead.

    In EOImode 1 an interrupt with no list register is therefore counted
    twice, and KVM running under TCG deactivates an interrupt that its guest
    has yet to deactivate.

    Increment EOIcount on EOIR only when EOImode is 0.

    Fixes: b3b48f529fe8 ("hw/intc/arm_gicv3: Implement ICV_ registers EOIR and IAR")
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
    Message-id: 20261119091922.1380805-1-fuad.tabba@linux.dev
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c
index 67a0bba4b0..02e1e7c254 100644
--- a/hw/intc/arm_gicv3_cpuif.c
+++ b/hw/intc/arm_gicv3_cpuif.c
@@ -1617,9 +1617,10 @@ static void icv_eoir_write(CPUARMState *env, const ARMCPRegInfo *ri,
     if (idx < 0) {
         /*
          * No valid list register corresponding to EOI ID; if this is a vLPI
-         * not in the list regs then do nothing; otherwise increment EOI count
+         * not in the list regs then do nothing; otherwise increment EOI count,
+         * unless drop and deactivate are split, when the DIR write does so.
          */
-        if (irq < GICV3_LPI_INTID_START) {
+        if (irq < GICV3_LPI_INTID_START && !icv_eoi_split(env, cs)) {
             icv_increment_eoicount(cs);
         }
     } else {