]> Git Repo - qemu.git/commitdiff
target/arm: Don't corrupt high half of PMOVSR when cycle counter overflows
authorPeter Maydell <[email protected]>
Mon, 22 Aug 2022 13:23:49 +0000 (14:23 +0100)
committerRichard Henderson <[email protected]>
Wed, 14 Sep 2022 10:19:40 +0000 (11:19 +0100)
When the cycle counter overflows, we are intended to set bit 31 in PMOVSR
to indicate this. However a missing ULL suffix means that we end up
setting all of bits 63-31. Fix the bug.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220822132358.3524971[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
target/arm/helper.c

index 7ff03f1a4ba27eb4e5066f4b16c2e31456d25220..e4824e01b85957db6e283e584efe1e41756afc5d 100644 (file)
@@ -1186,7 +1186,7 @@ static void pmccntr_op_start(CPUARMState *env)
         uint64_t overflow_mask = env->cp15.c9_pmcr & PMCRLC ? \
                                  1ull << 63 : 1ull << 31;
         if (env->cp15.c15_ccnt & ~new_pmccntr & overflow_mask) {
-            env->cp15.c9_pmovsr |= (1 << 31);
+            env->cp15.c9_pmovsr |= (1ULL << 31);
             pmu_update_irq(env);
         }
 
This page took 0.041289 seconds and 4 git commands to generate.