KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl
authorChristoffer Dall <christoffer.dall@linaro.org>
Mon, 4 Dec 2017 20:35:36 +0000 (21:35 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Dec 2017 08:26:58 +0000 (09:26 +0100)
commit9b062471e52a1692c5563ba1535c84d708e2ff6f
tree93e7b9481a4f1b09c7e1cf535c65463cffd144d4
parent6a96bc7fa0cdd96bac2b8298d708a94f8de6f6d4
KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl

Move the calls to vcpu_load() and vcpu_put() in to the architecture
specific implementations of kvm_arch_vcpu_ioctl() which dispatches
further architecture-specific ioctls on to other functions.

Some architectures support asynchronous vcpu ioctls which cannot call
vcpu_load() or take the vcpu->mutex, because that would prevent
concurrent execution with a running VCPU, which is the intended purpose
of these ioctls, for example because they inject interrupts.

We repeat the separate checks for these specifics in the architecture
code for MIPS, S390 and PPC, and avoid taking the vcpu->mutex and
calling vcpu_load for these ioctls.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/mips.c
arch/powerpc/kvm/powerpc.c
arch/s390/kvm/kvm-s390.c
arch/x86/kvm/x86.c
virt/kvm/arm/arm.c
virt/kvm/kvm_main.c