linux/arch/arm64/kvm
James Morse 0067df413b KVM: arm64: Handle RAS SErrors from EL2 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.

The current SError from EL2 code unmasks SError and tries to fence any
pending SError into a single instruction window. It then leaves SError
unmasked.

With the v8.2 RAS Extensions we may take an SError for a 'corrected'
error, but KVM is only able to handle SError from EL2 if they occur
during this single instruction window...

The RAS Extensions give us a new instruction to synchronise and
consume SErrors. The RAS Extensions document (ARM DDI0587),
'2.4.1 ESB and Unrecoverable errors' describes ESB as synchronising
SError interrupts generated by 'instructions, translation table walks,
hardware updates to the translation tables, and instruction fetches on
the same PE'. This makes ESB equivalent to KVMs existing
'dsb, mrs-daifclr, isb' sequence.

Use the alternatives to synchronise and consume any SError using ESB
instead of unmasking and taking the SError. Set ARM_EXIT_WITH_SERROR_BIT
in the exit_code so that we can restart the vcpu if it turns out this
SError has no impact on the vcpu.

Reviewed-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:36 +00:00
..
hyp KVM: arm64: Handle RAS SErrors from EL2 on guest exit 2018-01-16 15:09:36 +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 EL2 on guest exit 2018-01-16 15:09:36 +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