]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Restore hyp when panicking in guest context
authorAndrew Scull <ascull@google.com>
Tue, 15 Sep 2020 10:46:34 +0000 (11:46 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 15 Sep 2020 17:39:02 +0000 (18:39 +0100)
commitd173b32feaff96042dd3d533c44337d1f65b1387
treeb82fcec803426f124714480a6973972293016416
parent7553d73969a5fbb4d0e9662973685cc7af5b9a0d
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
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kvm/hyp/entry.S
arch/arm64/kvm/hyp/hyp-entry.S
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/nvhe/host.S