aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/hyp/hyp-entry.S
diff options
context:
space:
mode:
authorAndrew Scull <ascull@google.com>2020-09-15 11:46:34 +0100
committerMarc Zyngier <maz@kernel.org>2020-09-15 18:39:02 +0100
commit7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba (patch)
treeb82fcec803426f124714480a6973972293016416 /arch/arm64/kvm/hyp/hyp-entry.S
parentKVM: arm64: Update context references from host to hyp (diff)
downloadlinux-dev-7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba.tar.xz
linux-dev-7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba.zip
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.S5
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