KVM: arm64: Refuse illegal KVM_ARM_VCPU_PMU_V3 at reset time
authorMarc Zyngier <maz@kernel.org>
Thu, 12 Nov 2020 18:13:27 +0000 (18:13 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 27 Nov 2020 11:40:39 +0000 (11:40 +0000)
commit77da43039ab5cfc9631159fd87fe38d4c34cdaf5
treeaf88cfb7ef9128bad4f8517a7d6733ee8c18d35e
parent04355e41a60338206d6498fe463a86131d5ca06b
KVM: arm64: Refuse illegal KVM_ARM_VCPU_PMU_V3 at reset time

We accept to configure a PMU when a vcpu is created, even if the
HW (or the host) doesn't support it. This results in failures
when attributes get set, which is a bit odd as we should have
failed the vcpu creation the first place.

Move the check to the point where we check the vcpu feature set,
and fail early if we cannot support a PMU. This further simplifies
the attribute handling.

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/pmu-emul.c
arch/arm64/kvm/reset.c