KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available
authorMarc Zyngier <maz@kernel.org>
Fri, 5 Mar 2021 18:52:51 +0000 (18:52 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 6 Mar 2021 09:18:40 +0000 (04:18 -0500)
commitf27647b588c13647a60074b5a8dd39a86d919a1d
tree99a47bf8bf42dc6994eb98191dc0dd4dbbff080b
parent6b5b368fccd7109b052e45af8ba1464c8d140a49
KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available

When running under a nesting hypervisor, it isn't guaranteed that
the virtual HW will include a PMU. In which case, let's not try
to access the PMU registers in the world switch, as that'd be
deadly.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20210209114844.3278746-3-maz@kernel.org
Message-Id: <20210305185254.3730990-6-maz@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/arm64/kernel/image-vars.h
arch/arm64/kvm/hyp/include/hyp/switch.h