1
0
Fork 0
alistair23-linux/virt/kvm/arm
Marc Zyngier 8128576788 KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
commit 0370964dd3 upstream.

On a VHE system, the EL1 state is left in the CPU most of the time,
and only syncronized back to memory when vcpu_put() is called (most
of the time on preemption).

Which means that when injecting an exception, we'd better have a way
to either:
(1) write directly to the EL1 sysregs
(2) synchronize the state back to memory, and do the changes there

For an AArch64, we already do (1), so we are safe. Unfortunately,
doing the same thing for AArch32 would be pretty invasive. Instead,
we can easily implement (2) by calling the put/load architectural
backends, and keep preemption disabled. We can then reload the
state back into EL1.

Cc: stable@vger.kernel.org
Reported-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-17 16:40:38 +02:00
..
hyp KVM: arm64: Fix 32bit PC wrap-around 2020-05-14 07:58:26 +02:00
vgic KVM: arm: vgic: Synchronize the whole guest on GIC{D,R}_I{S,C}ACTIVER read 2020-05-20 08:20:04 +02:00
aarch32.c KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception 2020-06-17 16:40:38 +02:00
arch_timer.c KVM: arm64: Treat emulated TVAL TimerValue as a signed 32-bit integer 2020-02-14 16:34:18 -05:00
arm.c KVM: arm/arm64: vgic: Allow more than 256 vcpus for KVM_IRQ_LINE 2019-09-09 12:29:09 +01:00
mmio.c KVM: arm64: Only sign-extend MMIO up to register width 2020-02-11 04:35:16 -08:00
mmu.c KVM: arm/arm64: Fix young bit from mmu notifier 2020-02-14 16:34:17 -05:00
perf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
pmu.c KVM: arm64: pmu: Fix chained SW_INCR counters 2020-02-14 16:34:17 -05:00
psci.c KVM: arm/arm64: Add save/restore support for firmware workaround state 2019-07-05 13:56:27 +01:00
trace.h KVM: arm/arm64: Fix TRACE_INCLUDE_PATH 2019-02-19 21:05:51 +00:00