@samitouri / QOSamiQemu / commits / a6c23f8a20

target/arm: split evaluation of CNTHCTL timer IRQ masks

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>

Alex Bennée committed Jun 24, 2026 at 13:45 UTC a6c23f8a2083258eea3ed434a10095dc9ea0afbd
1 file changed +2 -1
target/arm/helper.c
+2 -1
@@ -1802,7 +1802,8 @@ static void gt_cnthctl_write(CPUARMState *env, const ARMCPRegInfo *ri,
1802
1803 if ((oldval ^ value) & R_CNTHCTL_CNTVMASK_MASK) {
1804 gt_update_irq(cpu, GTIMER_VIRT);
1805 - } else if ((oldval ^ value) & R_CNTHCTL_CNTPMASK_MASK) {
1805 + }
1806 + if ((oldval ^ value) & R_CNTHCTL_CNTPMASK_MASK) {
1807 gt_update_irq(cpu, GTIMER_PHYS);
1808 }
1809 }