1
0
Fork 0
alistair23-linux/arch/arm64/kvm
Marc Zyngier 0370964dd3 KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
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>
2020-06-10 16:04:08 +01:00
..
hyp KVM: arm64: Stop save/restoring ACTLR_EL1 2020-06-09 09:07:58 +01:00
vgic KVM: arm64: vgic-v3: Take cpu_if pointer directly instead of vcpu 2020-05-28 11:57:10 +01:00
Kconfig KVM: arm64: Change CONFIG_KVM to a menuconfig entry 2020-05-16 15:04:18 +01:00
Makefile KVM: arm64: Clean up kvm makefiles 2020-05-16 15:04:18 +01: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: Simplify __kvm_timer_set_cntvoff implementation 2020-05-16 15:04:18 +01:00
arm.c KVM: arm64: Flush the instruction cache if not unmapping the VM on reboot 2020-05-31 11:31:54 +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: Fix spelling in code comments 2020-05-16 15:05:01 +01:00
handle_exit.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +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
hypercalls.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
inject_fault.c KVM: arm64: Parametrize exception entry with a target EL 2020-05-28 13:16:55 +01:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
mmio.c KVM: Fix spelling in code comments 2020-05-16 15:05:01 +01:00
mmu.c KVM: arm64: Remove obsolete kvm_virt_to_phys abstraction 2020-05-25 16:16:27 +01: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: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
pmu.c KVM: arm64: Move pmu hyp code under hyp's Makefile to avoid instrumentation 2019-05-24 14:53:20 +01:00
psci.c KVM: Fix spelling in code comments 2020-05-16 15:05:01 +01:00
pvtime.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
regmap.c arm64: KVM: regmap: Fix unexpected switch fall-through 2019-07-26 15:33:41 +01:00
reset.c KVM: arm64: Don't use empty structures as CPU reset state 2020-05-28 12:00:40 +01:00
sys_regs.c KVM: arm64: Stop save/restoring ACTLR_EL1 2020-06-09 09:07:58 +01:00
sys_regs.h KVM: arm64: Sanely ratelimit sysreg messages 2019-12-06 11:41:45 +00:00
sys_regs_generic_v8.c KVM: arm64: Add emulation for 32bit guests accessing ACTLR2 2020-06-09 09:04:42 +01: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: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
trace_handle_exit.h KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01: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 KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00