1
0
Fork 0
alistair23-linux/arch/arm64/kvm
Marc Zyngier 2a5f1b67ec KVM: arm64: Don't access PMCR_EL0 when no PMU is available
We reset the guest's view of PMCR_EL0 unconditionally, based on
the host's view of this register. It is however legal for an
implementation not to provide any PMU, resulting in an UNDEF.

The obvious fix is to skip the reset of this shadow register
when no PMU is available, sidestepping the issue entirely.
If no PMU is available, the guest is not able to request
a virtual PMU anyway, so not doing nothing is the right thing
to do!

It is unlikely that this bug can hit any HW implementation
though, as they all provide a PMU. It has been found using nested
virt with the host KVM not implementing the PMU itself.

Fixes: ab9468340d ("arm64: KVM: Add access handler for PMCR register")
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201210083059.1277162-1-maz@kernel.org
2020-12-22 10:47:09 +00:00
..
hyp Merge remote-tracking branch 'origin/kvm-arm64/psci-relay' into kvmarm-master/next 2020-12-09 10:00:24 +00:00
vgic KVM: arm64: Delay the polling of the GICR_VPENDBASER.Dirty bit 2020-11-30 11:18:29 +00:00
Kconfig KVM: arm64: Replace CONFIG_KVM_INDIRECT_VECTORS with CONFIG_RANDOMIZE_BASE 2020-09-29 16:08:15 +01:00
Makefile KVM: arm64: Get rid of the AArch32 register mapping code 2020-11-10 08:34:27 +00:00
arch_timer.c KVM: arm64: timers: Move timer registers to the sys_regs file 2020-07-07 09:28:38 +01:00
arm.c Merge remote-tracking branch 'origin/kvm-arm64/psci-relay' into kvmarm-master/next 2020-12-09 10:00:24 +00:00
debug.c KVM: arm64: Write arch.mdcr_el2 changes since last vcpu_load on VHE 2020-01-22 18:38:04 +00:00
fpsimd.c KVM: arm64: Make struct kvm_regs userspace-only 2020-07-07 09:28:38 +01:00
guest.c KVM: arm64: Drop kvm_coproc.h 2020-11-10 11:22:52 +00:00
handle_exit.c KVM: arm64: Drop kvm_coproc.h 2020-11-10 11:22:52 +00:00
hypercalls.c KVM: arm64: ARM_SMCCC_ARCH_WORKAROUND_1 doesn't return SMCCC_RET_NOT_REQUIRED 2020-10-28 11:13:36 +00:00
inject_fault.c KVM: arm64: Move AArch32 exceptions over to AArch64 sysregs 2020-11-10 11:22:51 +00:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
mmio.c KVM: arm64: Make kvm_skip_instr() and co private to HYP 2020-11-10 08:34:24 +00:00
mmu.c Merge branch 'kvm-arm64/el2-pc' into kvmarm-master/next 2020-11-27 11:33:10 +00:00
perf.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
pmu-emul.c KVM: arm64: Get rid of the PMU ready state 2020-11-27 11:41:24 +00:00
pmu.c kvm: arm64: Set up hyp percpu data for nVHE 2020-09-30 08:37:14 +01:00
psci.c KVM: arm64: Convert ARCH_WORKAROUND_2 to arm64_get_spectre_v4_state() 2020-09-29 16:08:17 +01:00
pvtime.c KVM: arm64: Use kvm_write_guest_lock when init stolen time 2020-12-03 19:02:18 +00:00
reset.c Merge branch 'kvm-arm64/misc-5.11' into kvmarm-master/next 2020-11-27 19:48:24 +00:00
sys_regs.c KVM: arm64: Don't access PMCR_EL0 when no PMU is available 2020-12-22 10:47:09 +00:00
sys_regs.h Merge branch 'kvm-arm64/copro-no-more' into kvmarm-master/next 2020-11-27 11:33:16 +00:00
trace.h KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
trace_arm.h KVM: arm64: Fix address truncation in traces 2020-09-04 10:53:48 +01:00
trace_handle_exit.h KVM: arm64: Fix address truncation in traces 2020-09-04 10:53:48 +01:00
va_layout.c Merge remote-tracking branch 'origin/kvm-arm64/psci-relay' into kvmarm-master/next 2020-12-09 10:00:24 +00:00
vgic-sys-reg-v3.c KVM: arm64: Drop is_aarch32 trap attribute 2020-11-10 11:22:52 +00:00