]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
commit7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba
treeb82fcec803426f124714480a6973972293016416
parent7c2e76d87f9ce7af47a07ca803343fd5f4aa4ab5
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