[PATCH v9 18/22] KVM: arm64: pkvm: Preserve pending SError on exit from AArch32

Marc Zyngier maz at kernel.org
Wed Oct 13 05:03:42 PDT 2021


Don't drop a potential SError when a guest gets caught red-handed
running AArch32 code.

Signed-off-by: Marc Zyngier <maz at kernel.org>
---
 arch/arm64/kvm/hyp/nvhe/switch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c
index f25b6353a598..481c365ef144 100644
--- a/arch/arm64/kvm/hyp/nvhe/switch.c
+++ b/arch/arm64/kvm/hyp/nvhe/switch.c
@@ -256,7 +256,8 @@ static bool handle_aarch32_guest(struct kvm_vcpu *vcpu, u64 *exit_code)
 		 * protected VMs.
 		 */
 		vcpu->arch.target = -1;
-		*exit_code = ARM_EXCEPTION_IL;
+		*exit_code &= BIT(ARM_EXIT_WITH_SERROR_BIT);
+		*exit_code |= ARM_EXCEPTION_IL;
 		return false;
 	}
 
-- 
2.30.2




More information about the linux-arm-kernel mailing list