git: 7081201eb073 - main - arm64/vmm: vgic_v3: Set EOI for level-triggered interrupts

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Fri, 09 Oct 2026 12:07:57 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=7081201eb07367be73e43c5f878dfec51e8fe0d7

commit 7081201eb07367be73e43c5f878dfec51e8fe0d7
Author:     Kajetan Puchalski <kajetan.puchalski@arm.com>
AuthorDate: 2026-09-17 14:19:27 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-10-09 11:55:17 +0000

    arm64/vmm: vgic_v3: Set EOI for level-triggered interrupts
    
    ICH_LR_EL2 bit 41 (EOI) determines whether a maintenance interrupt will
    be asserted if the interrupt identified by the LR's vINTID is
    deactivated. For level-triggered interrupts, that maintenance interrupt
    is necessary for the host to resample the current level once the
    interrupt is deactivated.
    
    Set the EOI bit when flushing level-triggered interrupts into LRs.
    
    Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
    Reviewed by:    andrew
    Sponsored by:   Arm Ltd
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/2437
---
 sys/arm64/vmm/io/vgic_v3.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/arm64/vmm/io/vgic_v3.c b/sys/arm64/vmm/io/vgic_v3.c
index 39579ce99dd6..447026fdcf60 100644
--- a/sys/arm64/vmm/io/vgic_v3.c
+++ b/sys/arm64/vmm/io/vgic_v3.c
@@ -1992,11 +1992,10 @@ vgic_v3_flush_hwstate(device_t dev, struct hypctx *hypctx)
 			    ICH_LR_EL2_STATE_ACTIVE;
 		}
 
-#ifdef notyet
-		/* TODO: Check why this is needed */
-		if ((irq->config & _MASK) == LEVEL)
-			*hypctx_sys_reg(hypctx, HOST_ICH_LR_EL2(i)) |= ICH_LR_EL2_EOI;
-#endif
+		if ((irq->config & VGIC_CONFIG_MASK) == VGIC_CONFIG_LEVEL) {
+			*hypctx_sys_reg(hypctx,
+			    HOST_ICH_LR_EL2(i)) |= ICH_LR_EL2_EOI;
+		}
 
 		if (!irq->active && vgic_v3_irq_pending(irq)) {
 			*hypctx_sys_reg(hypctx, HOST_ICH_LR_EL2(i)) |=