]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: hyp/kvm: Make hyp-stub reject kvm_call_hyp()
authorJames Morse <james.morse@arm.com>
Wed, 27 Apr 2016 16:47:04 +0000 (17:47 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 28 Apr 2016 11:05:46 +0000 (12:05 +0100)
commitbb2d9cf91e741e58133833716e97981ab62bf15a
tree9a1b36f51a6dc5d2886f36454a1e3ac63eae640f
parent54c3ced827b7c1b10b445b331bd229f80cc578fc
arm64: hyp/kvm: Make hyp-stub reject kvm_call_hyp()

A later patch implements kvm_arch_hardware_disable(), to remove kvm
from el2, and re-instate the hyp-stub.

This can happen while guests are running, particularly when kvm_reboot()
calls kvm_arch_hardware_disable() on each cpu. This can interrupt a guest,
remove kvm, then allow the guest to be scheduled again. This causes
kvm_call_hyp() to be run against the hyp-stub.

Change the hyp-stub to return a new exception type when this happens,
and add code to kvm's handle_exit() to tell userspace we failed to
enter the guest.

Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kernel/hyp-stub.S
arch/arm64/kvm/handle_exit.c