linux-stable/arch/arm64/kvm
Marc Zyngier 610e2c5699 KVM: arm64: Don't access PMCR_EL0 when no PMU is available
commit 2a5f1b67ec upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-17 14:17:05 +01:00
..
hyp kvm/arm64 fixes for 5.10, take #5 2020-12-10 11:34:24 -05:00
vgic KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace 2020-11-17 18:51:09 +00:00
aarch32.c KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception 2020-06-10 16:04:08 +01: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 KVM/arm64 fixes for v5.10, take #3 2020-11-13 06:28:23 -05: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: Move SPSR_EL1 to the system register array 2020-07-07 09:28:38 +01:00
handle_exit.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05: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: Fix inject_fault.c kernel-doc warnings 2020-09-18 16:17:22 +01:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
Kconfig KVM: arm64: Replace CONFIG_KVM_INDIRECT_VECTORS with CONFIG_RANDOMIZE_BASE 2020-09-29 16:08:15 +01:00
Makefile KVM: arm64: nVHE: Migrate hyp-init to SMCCC 2020-09-15 18:39:04 +01:00
mmio.c KVM/arm64 updates for Linux 5.9: 2020-08-09 12:58:23 -04:00
mmu.c KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort() 2020-12-02 09:53:29 +00:00
perf.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
pmu-emul.c ARM: 2020-10-23 11:17:56 -07: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 arm64/x86: KVM: Introduce steal-time cap 2020-08-21 14:05:19 +01:00
regmap.c KVM: arm64: Move SPSR_EL1 to the system register array 2020-07-07 09:28:38 +01:00
reset.c Merge branch 'kvm-arm64/hyp-pcpu' into kvmarm-master/next 2020-09-30 14:05:35 +01:00
sys_regs.c KVM: arm64: Don't access PMCR_EL0 when no PMU is available 2021-01-17 14:17:05 +01:00
sys_regs.h KVM: arm64: Check RAZ visibility in ID register accessors 2020-11-06 16:00:29 +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 KVM: arm64: Make nVHE ASLR conditional on RANDOMIZE_BASE 2020-07-28 10:41:11 +01:00
vgic-sys-reg-v3.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00