]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Inject UNDEF on PMU access when no PMU configured
authorMarc Zyngier <maz@kernel.org>
Thu, 12 Nov 2020 18:49:28 +0000 (18:49 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 27 Nov 2020 11:40:47 +0000 (11:40 +0000)
commit37399ce584188dbdacbaa12b8d138586475c7c69
treec65c0e70f53ff2dcc9e3e4ec45844eeccbd4bc9b
parentc172c1359c2329bb2cf9bd6262b781bd7ac06854
KVM: arm64: Inject UNDEF on PMU access when no PMU configured

The ARMv8 architecture says that in the absence of FEAT_PMUv3,
all the PMU-related register generate an UNDEF. Let's make
sure that all our PMU handers catch this case by hooking into
check_pmu_access_disabled(), and add checks in a couple of
other places.

Note that we still cannot deliver an exception into the guest
as the offending cases are already caught by the RAZ/WI handling.
But this puts us one step away to architectural compliance.

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