OpenCloudOS-Kernel/arch/arm64/kvm
Marc Zyngier 0225fd5e0a KVM: arm64: Fix 32bit PC wrap-around
In the unlikely event that a 32bit vcpu traps into the hypervisor
on an instruction that is located right at the end of the 32bit
range, the emulation of that instruction is going to increment
PC past the 32bit range. This isn't great, as userspace can then
observe this value and get a bit confused.

Conversly, userspace can do things like (in the context of a 64bit
guest that is capable of 32bit EL0) setting PSTATE to AArch64-EL0,
set PC to a 64bit value, change PSTATE to AArch32-USR, and observe
that PC hasn't been truncated. More confusion.

Fix both by:
- truncating PC increments for 32bit guests
- sanitizing all 32bit regs every time a core reg is changed by
  userspace, and that PSTATE indicates a 32bit mode.

Cc: stable@vger.kernel.org
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
2020-05-01 09:51:08 +01:00
..
hyp KVM: arm64: Save/restore sp_el0 as part of __guest_enter 2020-04-30 12:01:35 +01:00
Kconfig vhost: refine vhost and vringh kconfig 2020-04-01 12:06:26 -04:00
Makefile KVM: arm64: Implement PV_TIME_FEATURES call 2019-10-21 19:20:27 +01: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: Remove unnecessary asm/kvm_host.h includes 2020-03-16 17:57:34 +01:00
guest.c KVM: arm64: Fix 32bit PC wrap-around 2020-05-01 09:51:08 +01:00
handle_exit.c KVM: arm/arm64: Factor out hypercall handling from PSCI code 2019-10-21 19:20:26 +01:00
hyp-init.S arm64: use mov_q instead of literal ldr 2020-03-24 11:48:24 +00:00
hyp.S arm64: kvm: Annotate assembly using modern annoations 2020-03-09 17:35:29 +00:00
inject_fault.c KVM: arm64: Correct PSTATE on exception entry 2020-01-19 18:06:13 +00:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pmu.c KVM: arm64: Move pmu hyp code under hyp's Makefile to avoid instrumentation 2019-05-24 14:53:20 +01:00
regmap.c arm64: KVM: regmap: Fix unexpected switch fall-through 2019-07-26 15:33:41 +01:00
reset.c KVM: Drop kvm_arch_vcpu_init() and kvm_arch_vcpu_uninit() 2020-01-27 19:59:33 +01:00
sys_regs.c ARM: 2020-04-02 15:13:15 -07:00
sys_regs.h KVM: arm64: Sanely ratelimit sysreg messages 2019-12-06 11:41:45 +00:00
sys_regs_generic_v8.c KVM: Remove unnecessary asm/kvm_host.h includes 2020-03-16 17:57:34 +01:00
trace.h arm64: KVM: Add trapped system register access tracepoint 2018-12-19 17:47:08 +00:00
va_layout.c arm64: kvm: Fix IDMAP overlap with HYP VA 2020-01-19 16:05:23 +00:00
vgic-sys-reg-v3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00