diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-04-03 19:37:58 +0100 |
---|---|---|
committer | Christoffer Dall <cdall@linaro.org> | 2017-04-09 07:49:31 -0700 |
commit | 386627d825d82ed3f7261a0de71a7cc4144e3c4b (patch) | |
tree | 5a94a31477de5fbf3cf77e21196e448e2e42d6ff /arch/arm/kvm | |
parent | 4d5f9c14fb638cbe36795cb4b8a0b05ceba0a526 (diff) | |
download | talos-obmc-linux-386627d825d82ed3f7261a0de71a7cc4144e3c4b.tar.gz talos-obmc-linux-386627d825d82ed3f7261a0de71a7cc4144e3c4b.zip |
ARM: KVM: Gracefully handle hyp-stubs being restored from under our feet
Should kvm_reboot() be invoked while guest is running, an IPI
wil be issued, forcing the guest to exit and HYP being reset to
the stubs. We will then try to reenter the guest, only to get
an error (HVC_STUB_ERR).
This patch allows this case to be gracefully handled by exiting
the run loop.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/handle_exit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/kvm/handle_exit.c b/arch/arm/kvm/handle_exit.c index 96af65a30d78..5fd7968cdae9 100644 --- a/arch/arm/kvm/handle_exit.c +++ b/arch/arm/kvm/handle_exit.c @@ -160,6 +160,14 @@ int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run, case ARM_EXCEPTION_DATA_ABORT: kvm_inject_vabt(vcpu); return 1; + case ARM_EXCEPTION_HYP_GONE: + /* + * HYP has been reset to the hyp-stub. This happens + * when a guest is pre-empted by kvm_reboot()'s + * shutdown call. + */ + run->exit_reason = KVM_EXIT_FAIL_ENTRY; + return 0; default: kvm_pr_unimpl("Unsupported exception type: %d", exception_index); |