KVM: arm64: pmu: Fix chained SW_INCR counters
authorEric Auger <eric.auger@redhat.com>
Fri, 24 Jan 2020 14:25:34 +0000 (15:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:34:17 +0000 (16:34 -0500)
commita17d21640453719e6f7a9de53d2982f0f7b2357b
tree86b35ee1ba2172f9650bfdac36dea9d38da3d111
parenta6229d1b5c223bdcbf031b1fd62ef751cc409d78
KVM: arm64: pmu: Fix chained SW_INCR counters

commit aa76829171e98bd75a0cc00b6248eca269ac7f4f upstream.

At the moment a SW_INCR counter always overflows on 32-bit
boundary, independently on whether the n+1th counter is
programmed as CHAIN.

Check whether the SW_INCR counter is a 64b counter and if so,
implement the 64b logic.

Fixes: 80f393a23be6 ("KVM: arm/arm64: Support chained PMU counters")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200124142535.29386-4-eric.auger@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/arm/pmu.c