]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: Fix MDCR_EL2.HPMN reset value
authorMarc Zyngier <maz@kernel.org>
Mon, 17 Feb 2025 10:17:20 +0000 (10:17 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 11 Apr 2025 11:58:51 +0000 (12:58 +0100)
commitc8823e51b534d490ec27d372596eb35d2bb7193c
tree4372b3b83fb68b0ed56ca3a5a246f66f8ee0503f
parentf12b54d7c24388886277598236b3eeea5c68eec4
KVM: arm64: Fix MDCR_EL2.HPMN reset value

The MDCR_EL2 documentation indicates that the HPMN field has
the following behaviour:

"On a Warm reset, this field resets to the expression NUM_PMU_COUNTERS."

However, it appears we reset it to zero, which is not very useful.

Add a reset helper for MDCR_EL2, and handle the case where userspace
changes the target PMU, which may force us to change HPMN again.

Reported-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/pmu-emul.c
arch/arm64/kvm/sys_regs.c