linux/arch/arm64/kvm
James Morse 3368bd8097 KVM: arm64: Handle RAS SErrors from EL1 on guest exit
We expect to have firmware-first handling of RAS SErrors, with errors
notified via an APEI method. For systems without firmware-first, add
some minimal handling to KVM.

There are two ways KVM can take an SError due to a guest, either may be a
RAS error: we exit the guest due to an SError routed to EL2 by HCR_EL2.AMO,
or we take an SError from EL2 when we unmask PSTATE.A from __guest_exit.

For SError that interrupt a guest and are routed to EL2 the existing
behaviour is to inject an impdef SError into the guest.

Add code to handle RAS SError based on the ESR. For uncontained and
uncategorized errors arm64_is_fatal_ras_serror() will panic(), these
errors compromise the host too. All other error types are contained:
For the fatal errors the vCPU can't make progress, so we inject a virtual
SError. We ignore contained errors where we can make progress as if
we're lucky, we may not hit them again.

If only some of the CPUs support RAS the guest will see the cpufeature
sanitised version of the id registers, but we may still take RAS SError
on this CPU. Move the SError handling out of handle_exit() into a new
handler that runs before we can be preempted. This allows us to use
this_cpu_has_cap(), via arm64_is_ras_serror().

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-01-16 15:09:13 +00:00
..
hyp KVM: arm64: Save ESR_EL2 on guest SError 2018-01-16 15:09:00 +00:00
debug.c KVM: arm/arm64: debug: Introduce helper for single-step 2017-11-29 16:46:19 +01:00
guest.c KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace 2017-06-08 16:59:57 +02:00
handle_exit.c KVM: arm64: Handle RAS SErrors from EL1 on guest exit 2018-01-16 15:09:13 +00:00
hyp-init.S KVM: arm64: Stop save/restoring host tpidr_el1 on VHE 2018-01-13 10:44:40 +00:00
hyp.S arm64: hyp-stub/KVM: Kill __hyp_get_vectors 2017-04-09 07:49:34 -07:00
inject_fault.c KVM: arm64: Set an impdef ESR for Virtual-SError using VSESR_EL2. 2018-01-16 15:08:41 +00:00
irq.h KVM: arm/arm64: Enable irqchip routing 2016-07-22 18:52:01 +01:00
Kconfig GICv4 Support for KVM/ARM for v4.15 2017-11-17 13:20:01 +01:00
Makefile GICv4 Support for KVM/ARM for v4.15 2017-11-17 13:20:01 +01:00
regmap.c arm64: KVM: 32bit GP register access 2013-06-12 16:42:14 +01:00
reset.c KVM: arm/arm64: Move timer IRQ default init to arch_timer.c 2017-06-08 16:59:56 +02:00
sys_regs_generic_v8.c KVM: arm64: Use common sysreg definitions 2017-03-22 18:38:26 +00:00
sys_regs.c KVM: arm64: Save/Restore guest DISR_EL1 2018-01-16 15:08:52 +00:00
sys_regs.h Merge remote-tracking branch 'rutland/kvm/common-sysreg' into next-fix 2017-04-09 07:50:34 -07: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
vgic-sys-reg-v3.c KVM: arm/arm64: Extract GICv3 max APRn index calculation 2017-09-05 17:33:39 +02:00