]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - arch/arm64/kvm/hyp/include/hyp/switch.h
KVM: arm64: Restore hyp when panicking in guest context
[mirror_ubuntu-hirsute-kernel.git] / arch / arm64 / kvm / hyp / include / hyp / switch.h
index afe714056b9761108d683303cb0fdf54590e47e6..821721b78ad9b518d5d5d3d5263e0274c3ec359e 100644 (file)
@@ -509,6 +509,7 @@ static inline void __set_host_arch_workaround_state(struct kvm_vcpu *vcpu)
 
 static inline void __kvm_unexpected_el2_exception(void)
 {
+       extern char __guest_exit_panic[];
        unsigned long addr, fixup;
        struct exception_table_entry *entry, *end;
        unsigned long elr_el2 = read_sysreg(elr_el2);
@@ -529,7 +530,8 @@ static inline void __kvm_unexpected_el2_exception(void)
                return;
        }
 
-       hyp_panic();
+       /* Trigger a panic after restoring the hyp context. */
+       write_sysreg(__guest_exit_panic, elr_el2);
 }
 
 #endif /* __ARM64_KVM_HYP_SWITCH_H__ */