Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: arm64: nVHE: Don't consume host SErrors with ESB

The ESB at the start of the host vector may cause SErrors to be consumed
to DISR_EL1. However, this is not checked for the host so the SError
could go unhandled.

Remove the ESB so that SErrors are not consumed but are instead left
pending for the host to consume. __guest_enter already defers entry into
a guest if there are any SErrors pending.

Signed-off-by: Andrew Scull <ascull@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>
Link: https://lore.kernel.org/r/20200915104643.2543892-8-ascull@google.com

authored by

Andrew Scull and committed by
Marc Zyngier
472fc011 6e3bfbb2

+5 -1
+5 -1
arch/arm64/kvm/hyp/nvhe/host.S
··· 25 25 .macro host_el1_sync_vect 26 26 .align 7 27 27 .L__vect_start\@: 28 - esb 29 28 stp x0, x1, [sp, #-16]! 30 29 mrs x0, esr_el2 31 30 lsr x0, x0, #ESR_ELx_EC_SHIFT ··· 79 80 .endm 80 81 81 82 /* 83 + * The host vector does not use an ESB instruction in order to avoid consuming 84 + * SErrors that should only be consumed by the host. Guest entry is deferred by 85 + * __guest_enter if there are any pending asynchronous exceptions so hyp will 86 + * always return to the host without having consumerd host SErrors. 87 + * 82 88 * CONFIG_KVM_INDIRECT_VECTORS is not applied to the host vectors because the 83 89 * host knows about the EL2 vectors already, and there is no point in hiding 84 90 * them.