Skip to content

Commit 001d85b

Browse files
author
Marc Zyngier
committed
KVM: arm64: PMU: Narrow the overflow checking when required
For 64bit counters that overflow on a 32bit boundary, make sure we only check the bottom 32bit to generate a CHAIN event. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Reiji Watanabe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c82d28c commit 001d85b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kvm/pmu-emul.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ static void kvm_pmu_counter_increment(struct kvm_vcpu *vcpu,
417417
reg = lower_32_bits(reg);
418418
__vcpu_sys_reg(vcpu, PMEVCNTR0_EL0 + i) = reg;
419419

420-
if (reg) /* No overflow? move on */
420+
/* No overflow? move on */
421+
if (kvm_pmu_idx_has_64bit_overflow(vcpu, i) ? reg : lower_32_bits(reg))
421422
continue;
422423

423424
/* Mark overflow */

0 commit comments

Comments
 (0)