linux/virt/kvm/arm
James Morse 4f5abad9e8 KVM: arm/arm64: mask/unmask daif around VHE guests
Non-VHE systems take an exception to EL2 in order to world-switch into the
guest. When returning from the guest KVM implicitly restores the DAIF
flags when it returns to the kernel at EL1.

With VHE none of this exception-level jumping happens, so KVMs
world-switch code is exposed to the host kernel's DAIF values, and KVM
spills the guest-exit DAIF values back into the host kernel.
On entry to a guest we have Debug and SError exceptions unmasked, KVM
has switched VBAR but isn't prepared to handle these. On guest exit
Debug exceptions are left disabled once we return to the host and will
stay this way until we enter user space.

Add a helper to mask/unmask DAIF around VHE guests. The unmask can only
happen after the hosts VBAR value has been synchronised by the isb in
__vhe_hyp_call (via kvm_call_hyp()). Masking could be as late as
setting KVMs VBAR value, but is kept here for symmetry.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-01-16 15:08:24 +00:00
..
hyp KVM: arm/arm64: Fix broken GICH_ELRSR big endian conversion 2017-12-04 14:25:33 +01:00
vgic KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner 2017-12-01 08:54:41 +01:00
aarch32.c KVM: arm/arm64: Unify 32bit fault injection 2017-11-06 16:23:20 +01:00
arch_timer.c KVM: arm/arm64: Avoid attempting to load timer vgic state without a vgic 2017-11-29 18:17:47 +01:00
arm.c KVM: arm/arm64: mask/unmask daif around VHE guests 2018-01-16 15:08:24 +00:00
mmio.c KVM: arm/arm64: Move shared files to virt/kvm/arm 2017-05-04 13:57:26 +02:00
mmu.c KVM: arm/arm64: fix HYP ID map extension to 52 bits 2018-01-15 18:20:26 +00:00
perf.c KVM: arm/arm64: Move shared files to virt/kvm/arm 2017-05-04 13:57:26 +02:00
pmu.c KVM: arm/arm64: PMU: Fix overflow interrupt injection 2017-07-25 14:18:01 +01:00
psci.c KVM: arm/arm64: change exit request to sleep request 2017-06-04 16:53:55 +02:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00