public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] take srcu lock before call to complete_pio()
@ 2010-03-09 10:01 Gleb Natapov
  2010-03-09 12:46 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2010-03-09 10:01 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: kvm

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

Signed-off-by: Gleb Natapov <gleb@redhat.com>
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.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-09 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 10:01 [PATCH] take srcu lock before call to complete_pio() Gleb Natapov
2010-03-09 12:46 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox