]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Don't zero the cycle count register when PMCR_EL0.P is set
authorAlexandru Elisei <alexandru.elisei@arm.com>
Fri, 18 Jun 2021 10:51:39 +0000 (11:51 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 18 Jun 2021 12:23:50 +0000 (13:23 +0100)
commite5f422af148f82ce0675fc0e39cd62dcc7073ad0
treee4fe0dd7f6022ca1a496c85aa04e5bb2e7f39482
parent522fa64953e0d3fbb5fa5fd7565121714af2a489
KVM: arm64: Don't zero the cycle count register when PMCR_EL0.P is set

According to ARM DDI 0487G.a, page D13-3895, setting the PMCR_EL0.P bit to
1 has the following effect:

"Reset all event counters accessible in the current Exception level, not
including PMCCNTR_EL0, to zero."

Similar behaviour is described for AArch32 on page G8-7022. Make it so.

Fixes: fe04201e2ebb ("KVM: arm64: pmu: Only handle supported event counters")
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210618105139.83795-1-alexandru.elisei@arm.com
arch/arm64/kvm/pmu-emul.c