diff options
author | Andrew Scull <ascull@google.com> | 2020-09-15 13:46:34 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2020-09-15 20:39:02 +0300 |
commit | 7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba (patch) | |
tree | b82fcec803426f124714480a6973972293016416 /arch/arm64/kvm/hyp/hyp-entry.S | |
parent | 7c2e76d87f9ce7af47a07ca803343fd5f4aa4ab5 (diff) | |
download | linux-7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba.tar.xz |
KVM: arm64: Restore hyp when panicking in guest context
If the guest context is loaded when a panic is triggered, restore the
hyp context so e.g. the shadow call stack works when hyp_panic() is
called and SP_EL0 is valid when the host's panic() is called.
Use the hyp context's __hyp_running_vcpu field to track when hyp
transitions to and from the guest vcpu so the exception handlers know
whether the context needs to be restored.
Signed-off-by: Andrew Scull <ascull@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200915104643.2543892-11-ascull@google.com
Diffstat (limited to 'arch/arm64/kvm/hyp/hyp-entry.S')
-rw-r--r-- | arch/arm64/kvm/hyp/hyp-entry.S | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S index f92489250dfc..bc9f53df46f5 100644 --- a/arch/arm64/kvm/hyp/hyp-entry.S +++ b/arch/arm64/kvm/hyp/hyp-entry.S @@ -145,7 +145,7 @@ el2_error: eret sb -.macro invalid_vector label, target = hyp_panic +.macro invalid_vector label, target = __guest_exit_panic .align 2 SYM_CODE_START(\label) b \target @@ -186,10 +186,9 @@ check_preamble_length 661b, 662b .macro invalid_vect target .align 7 661: - b \target nop + stp x0, x1, [sp, #-16]! 662: - ldp x0, x1, [sp], #16 b \target check_preamble_length 661b, 662b |