remarkable-linux/arch/arm64
Marc Zyngier 21cbe3cc8a arm64: KVM: pmu: Reset PMSELR_EL0.SEL to a sane value before entering the guest
The ARMv8 architecture allows the cycle counter to be configured
by setting PMSELR_EL0.SEL==0x1f and then accessing PMXEVTYPER_EL0,
hence accessing PMCCFILTR_EL0. But it disallows the use of
PMSELR_EL0.SEL==0x1f to access the cycle counter itself through
PMXEVCNTR_EL0.

Linux itself doesn't violate this rule, but we may end up with
PMSELR_EL0.SEL being set to 0x1f when we enter a guest. If that
guest accesses PMXEVCNTR_EL0, the access may UNDEF at EL1,
despite the guest not having done anything wrong.

In order to avoid this unfortunate course of events (haha!), let's
sanitize PMSELR_EL0 on guest entry. This ensures that the guest
won't explode unexpectedly.

Cc: stable@vger.kernel.org #4.6+
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2016-12-09 15:47:00 +00:00
..
boot pci-v4.9-fixes-3 2016-11-11 16:38:26 -08:00
configs ZTE arm64 defconfig updates for 4.9: 2016-09-19 22:35:21 +02:00
crypto crypto: arm64/aes-ctr - fix NULL dereference in tail processing 2016-09-13 18:44:59 +08:00
include ARM fixes. There are a couple pending x86 patches but they'll have to 2016-11-13 10:28:53 -08:00
kernel arm64 fixes: 2016-10-20 10:17:13 -07:00
kvm arm64: KVM: pmu: Reset PMSELR_EL0.SEL to a sane value before entering the guest 2016-12-09 15:47:00 +00:00
lib Merge branch 'work.uaccess' into for-linus 2016-10-14 20:42:44 -04:00
mm arm64/numa: fix incorrect log for memory-less node 2016-10-26 18:21:51 +01:00
net
xen
Kconfig arm64: kaslr: keep modules close to the kernel when DYNAMIC_FTRACE=y 2016-10-17 16:24:02 +01:00
Kconfig.debug arm64: always enable DEBUG_RODATA and remove the Kconfig option 2016-08-26 10:13:41 +01:00
Kconfig.platforms arm64: uniphier: select ARCH_HAS_RESET_CONTROLLER 2016-10-22 18:25:52 +09:00
Makefile arm64: kernel: force ET_DYN ELF type for CONFIG_RELOCATABLE=y 2016-10-20 11:37:25 +01:00