KVM: arm64: Avoid BUG-ing from the host abort path
authorQuentin Perret <qperret@google.com>
Tue, 23 Apr 2024 15:05:14 +0000 (16:05 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 May 2024 15:46:58 +0000 (16:46 +0100)
commit02949f36bc7b723944bf754b71cfdf75e5e36f44
treed22ca24b0b8a199f4bd1d10767fc6010199a432c
parentcb16301626c339b3ccde93e5deea0569e508cb98
KVM: arm64: Avoid BUG-ing from the host abort path

Under certain circumstances __get_fault_info() may resolve the faulting
address using the AT instruction. Given that this is being done outside
of the host lock critical section, it is racy and the resolution via AT
may fail. We currently BUG() in this situation, which is obviously less
than ideal. Moving the address resolution to the critical section may
have a performance impact, so let's keep it where it is, but bail out
and return to the host to try a second time.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Acked-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240423150538.2103045-7-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/mem_protect.c