aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 87eee7a7f16e..6249810b2155 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1505,7 +1505,6 @@ static int init_rmode_tss(struct kvm *kvm)
1505 int ret = 0; 1505 int ret = 0;
1506 int r; 1506 int r;
1507 1507
1508 down_read(&kvm->slots_lock);
1509 r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE); 1508 r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
1510 if (r < 0) 1509 if (r < 0)
1511 goto out; 1510 goto out;
@@ -1528,7 +1527,6 @@ static int init_rmode_tss(struct kvm *kvm)
1528 1527
1529 ret = 1; 1528 ret = 1;
1530out: 1529out:
1531 up_read(&kvm->slots_lock);
1532 return ret; 1530 return ret;
1533} 1531}
1534 1532
@@ -1730,6 +1728,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
1730 u64 msr; 1728 u64 msr;
1731 int ret; 1729 int ret;
1732 1730
1731 down_read(&vcpu->kvm->slots_lock);
1733 if (!init_rmode_tss(vmx->vcpu.kvm)) { 1732 if (!init_rmode_tss(vmx->vcpu.kvm)) {
1734 ret = -ENOMEM; 1733 ret = -ENOMEM;
1735 goto out; 1734 goto out;
@@ -1833,9 +1832,10 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
1833 1832
1834 vpid_sync_vcpu_all(vmx); 1833 vpid_sync_vcpu_all(vmx);
1835 1834
1836 return 0; 1835 ret = 0;
1837 1836
1838out: 1837out:
1838 up_read(&vcpu->kvm->slots_lock);
1839 return ret; 1839 return ret;
1840} 1840}
1841 1841