diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-23 11:35:25 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:45 -0500 |
commit | f656ce0185cabbbb0cf96877306879661297c7ad (patch) | |
tree | e2c8e61642ae4849c901922552a1acf0112461b4 /arch/x86/kvm/vmx.c | |
parent | e93f8a0f821e290ac5149830110a5f704db7a1fc (diff) |
KVM: switch vcpu context to use SRCU
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f1cae7d6113d..22ab7137d1d0 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -2478,10 +2478,10 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | |||
2478 | { | 2478 | { |
2479 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 2479 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
2480 | u64 msr; | 2480 | u64 msr; |
2481 | int ret; | 2481 | int ret, idx; |
2482 | 2482 | ||
2483 | vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)); | 2483 | vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)); |
2484 | down_read(&vcpu->kvm->slots_lock); | 2484 | idx = srcu_read_lock(&vcpu->kvm->srcu); |
2485 | if (!init_rmode(vmx->vcpu.kvm)) { | 2485 | if (!init_rmode(vmx->vcpu.kvm)) { |
2486 | ret = -ENOMEM; | 2486 | ret = -ENOMEM; |
2487 | goto out; | 2487 | goto out; |
@@ -2589,7 +2589,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | |||
2589 | vmx->emulation_required = 0; | 2589 | vmx->emulation_required = 0; |
2590 | 2590 | ||
2591 | out: | 2591 | out: |
2592 | up_read(&vcpu->kvm->slots_lock); | 2592 | srcu_read_unlock(&vcpu->kvm->srcu, idx); |
2593 | return ret; | 2593 | return ret; |
2594 | } | 2594 | } |
2595 | 2595 | ||