KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_regs

Move vcpu_load() and vcpu_put() into the architecture specific
implementations of kvm_arch_vcpu_ioctl_get_regs().

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Christoffer Dall
2017-12-04 21:35:26 +01:00
committed by Paolo Bonzini
parent accb757d79
commit 1fc9b76b3d
6 changed files with 14 additions and 2 deletions

View File

@@ -2583,9 +2583,7 @@ static long kvm_vcpu_ioctl(struct file *filp,
kvm_regs = kzalloc(sizeof(struct kvm_regs), GFP_KERNEL);
if (!kvm_regs)
goto out;
vcpu_load(vcpu);
r = kvm_arch_vcpu_ioctl_get_regs(vcpu, kvm_regs);
vcpu_put(vcpu);
if (r)
goto out_free1;
r = -EFAULT;