target/arm: Stop unintentional sign extension in pmu_init
PATCH 1/1 target/arm: Stop unintentional sign extension in pmu_init
This was introduced by
commit bf8d09694ccc07487cd73d7562081fdaec3370c8 target/arm: Don't clear supported PMU events when initializing PMCEID1
and identified by Coverity (CID 1398645).
Signed-off-by Aaron Lindsay <[email protected]>
Reported-by Peter Maydell <[email protected]>
--- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/helper.c +1 -1
@@ -1167,7 +1167,7 @@ void pmu_init(ARMCPU *cpu)if (cnt->supported (&cpu->env)) { supported_event_map[cnt->number] = i; -uint64_t event_mask =1 << (cnt->number &0x1f ); +uint64_t event_mask =1ULL << (cnt->number &0x1f );if (cnt->number &0x20 ) { cpu->pmceid1 |= event_mask; }else {
Signature · 1 line
2.20.1
Peter Maydell
AppliedQuoted 8 lines · Aaron Lindsay OS
This was introduced by
commitbf8d09694ccc07487cd73d7562081fdaec3370c8target/arm: Don't clear supported PMU events when initializing PMCEID1
and identified by Coverity (CID 1398645).Signed-off-by Aaron Lindsay <[email protected]>Reported-by Peter Maydell <[email protected]>
Applied to target-arm.next, thanks.
-- PMM