KVM: arm64: Rewrite IMPDEF PMU version as NI
authorOliver Upton <oliver.upton@linux.dev>
Fri, 9 Jun 2023 19:00:47 +0000 (19:00 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 12 Jun 2023 23:08:33 +0000 (23:08 +0000)
commitf90f9360c3d7fbb731732fbb9a1228f55d178e10
treeac03304049c6359316a9e1549a9e20ebdc8a9373
parent2251e9ff1573a266102f40e507f0b8dc5861f3e4
KVM: arm64: Rewrite IMPDEF PMU version as NI

KVM allows userspace to write an IMPDEF PMU version to the corresponding
32bit and 64bit ID register fields for the sake of backwards
compatibility with kernels that lacked commit 3d0dba5764b9 ("KVM: arm64:
PMU: Move the ID_AA64DFR0_EL1.PMUver limit to VM creation"). Plumbing
that IMPDEF PMU version through to the gues is getting in the way of
progress, and really doesn't any sense in the first place.

Bite the bullet and reinterpret the IMPDEF PMU version as NI (0) for
userspace writes. Additionally, spill the dirty details into a comment.

Link: https://lore.kernel.org/r/20230609190054.1542113-5-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/sys_regs.c
include/kvm/arm_pmu.h