]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: PMU: Distinguish between 64bit counter and 64bit overflow
authorMarc Zyngier <maz@kernel.org>
Sun, 13 Nov 2022 16:38:20 +0000 (16:38 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 14:55:17 +0000 (16:55 +0200)
commit508d71a6770899facd26d4b92d9883656be67eaa
treef61108d2fd2a98d4dacec4e17300bf4a85864d09
parenteb3df961021b9c018cc609aa63aec9b3938e9fc3
KVM: arm64: PMU: Distinguish between 64bit counter and 64bit overflow

[ Upstream commit c82d28cbf1d4f9fe174041b4485c635cb970afa7 ]

The PMU architecture makes a subtle difference between a 64bit
counter and a counter that has a 64bit overflow. This is for example
the case of the cycle counter, which can generate an overflow on
a 32bit boundary if PMCR_EL0.LC==0 despite the accumulation being
done on 64 bits.

Use this distinction in the few cases where it matters in the code,
as we will reuse this with PMUv3p5 long counters.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221113163832.3154370-5-maz@kernel.org
Stable-dep-of: f6da81f650fa ("KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kvm/pmu-emul.c