Re: [PATCH] take srcu lock before call to complete_pio()

2010-03-09 Thread Avi Kivity

On 03/09/2010 12:01 PM, Gleb Natapov wrote:

complete_pio() may use slot table which is protected by srcu.
   


Applied, thanks.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] take srcu lock before call to complete_pio()

2010-03-09 Thread Gleb Natapov
complete_pio() may use slot table which is protected by srcu.

Signed-off-by: Gleb Natapov 
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 703f637..3753c11 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4519,7 +4519,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
kvm_set_cr8(vcpu, kvm_run->cr8);
 
if (vcpu->arch.pio.cur_count) {
+   vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
r = complete_pio(vcpu);
+   srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
if (r)
goto out;
}
--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html