]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3c5244eaa0d43911b8e13cf0b39e0d6162fb5a54
treeaf88cfb7ef9128bad4f8517a7d6733ee8c18d35e
parent6039f4fb1391c9eb0db607dc2f17d24dc038e0ea
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