]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm: split evaluation of CNTHCTL timer IRQ masks
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 24 Jun 2026 12:45:22 +0000 (13:45 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 29 Jun 2026 10:03:47 +0000 (11:03 +0100)
Whether the physical and virtual timer IRQs are masked are independent
of each other so the checking of CNTHCTL:CNTPMASK shouldn't depend of
not changing CNTVMASK.

While unlikely to be seen in real life we should still make sure we
behave correctly.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260624124527.1018912-2-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c

index ddca634538fb0b49f97c0bf6387935c1162fafc4..202ac99f69b6c653f761809128f11943cac764f1 100644 (file)
@@ -1802,7 +1802,8 @@ static void gt_cnthctl_write(CPUARMState *env, const ARMCPRegInfo *ri,
 
     if ((oldval ^ value) & R_CNTHCTL_CNTVMASK_MASK) {
         gt_update_irq(cpu, GTIMER_VIRT);
-    } else if ((oldval ^ value) & R_CNTHCTL_CNTPMASK_MASK) {
+    }
+    if ((oldval ^ value) & R_CNTHCTL_CNTPMASK_MASK) {
         gt_update_irq(cpu, GTIMER_PHYS);
     }
 }