summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorChristoffer Dall2017-12-04 21:35:28 +0100
committerPaolo Bonzini2017-12-14 09:26:52 +0100
commitbcdec41cefbea525ad424050650acb0f2eed1378 (patch)
treea1dd3c7c025f5bc1dc1811d9bcace4bba063fca3 /arch/x86/kvm/x86.c
parentKVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_regs (diff)
downloadkernel-qcow2-linux-bcdec41cefbea525ad424050650acb0f2eed1378.tar.gz
kernel-qcow2-linux-bcdec41cefbea525ad424050650acb0f2eed1378.tar.xz
kernel-qcow2-linux-bcdec41cefbea525ad424050650acb0f2eed1378.zip
KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_sregs
Move vcpu_load() and vcpu_put() into the architecture specific implementations of kvm_arch_vcpu_ioctl_get_sregs(). 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>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f82e87bb3a51..66a8d8cd00f6 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7425,6 +7425,8 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
{
struct desc_ptr dt;
+ vcpu_load(vcpu);
+
kvm_get_segment(vcpu, &sregs->cs, VCPU_SREG_CS);
kvm_get_segment(vcpu, &sregs->ds, VCPU_SREG_DS);
kvm_get_segment(vcpu, &sregs->es, VCPU_SREG_ES);
@@ -7456,6 +7458,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
set_bit(vcpu->arch.interrupt.nr,
(unsigned long *)sregs->interrupt_bitmap);
+ vcpu_put(vcpu);
return 0;
}