qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/arm/helper: Fix timer interrupt masking when HCR_EL2.E2H == 0
@ 2024-06-15 18:54 Florian Lugou
  2024-06-20 10:43 ` Peter Maydell
  0 siblings, 1 reply; 12+ messages in thread
From: Florian Lugou @ 2024-06-15 18:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Florian Lugou, Peter Maydell, open list:ARM TCG CPUs

CNTHCTL_EL2 based masking of timer interrupts was introduced in
f6fc36deef6abcee406211f3e2f11ff894b87fa4. This masking was however
effective no matter whether EL2 was enabled in the current security
state or not, contrary to arm specification.

Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
---
 target/arm/helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index ce31957235..60e2344c68 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2684,7 +2684,8 @@ static void gt_update_irq(ARMCPU *cpu, int timeridx)
      * If bit CNTHCTL_EL2.CNT[VP]MASK is set, it overrides IMASK.
      * It is RES0 in Secure and NonSecure state.
      */
-    if ((ss == ARMSS_Root || ss == ARMSS_Realm) &&
+    if ((arm_hcr_el2_eff(env) & HCR_E2H) &&
+        (ss == ARMSS_Root || ss == ARMSS_Realm) &&
         ((timeridx == GTIMER_VIRT && (cnthctl & R_CNTHCTL_CNTVMASK_MASK)) ||
          (timeridx == GTIMER_PHYS && (cnthctl & R_CNTHCTL_CNTPMASK_MASK)))) {
         irqstate = 0;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-02-10  9:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-15 18:54 [PATCH] target/arm/helper: Fix timer interrupt masking when HCR_EL2.E2H == 0 Florian Lugou
2024-06-20 10:43 ` Peter Maydell
2024-06-20 13:56   ` Florian Lugou
2024-06-20 19:01     ` Peter Maydell
2024-06-21 14:07       ` Florian Lugou
2024-08-13 12:13         ` Peter Maydell
2024-08-20 11:30           ` Florian Lugou
2025-02-06 15:41             ` Peter Maydell
2025-02-07 15:45               ` Peter Maydell
2025-02-07 17:22                 ` Richard Henderson
2025-02-07 18:29                   ` Alex Bennée
2025-02-10  9:33                     ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).