diff options
| author | Gleb Natapov <gleb@redhat.com> | 2010-03-09 05:01:10 -0500 |
|---|---|---|
| committer | Avi Kivity <avi@redhat.com> | 2010-04-20 05:55:04 -0400 |
| commit | 7567cae105e435b53e5a3e778546dd3ec53e3204 (patch) | |
| tree | a8a9651af97e24940e117f8f0d6adf49476cc394 | |
| parent | 01bf0b64579ead8a82e7cfc32ae44bc667e7ad0f (diff) | |
KVM: take srcu lock before call to complete_pio()
complete_pio() may use slot table which is protected by srcu.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com>
| -rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 24cd0ee896e9..2eb999dc9774 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -4483,7 +4483,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
| 4483 | kvm_set_cr8(vcpu, kvm_run->cr8); | 4483 | kvm_set_cr8(vcpu, kvm_run->cr8); |
| 4484 | 4484 | ||
| 4485 | if (vcpu->arch.pio.cur_count) { | 4485 | if (vcpu->arch.pio.cur_count) { |
| 4486 | vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); | ||
| 4486 | r = complete_pio(vcpu); | 4487 | r = complete_pio(vcpu); |
| 4488 | srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); | ||
| 4487 | if (r) | 4489 | if (r) |
| 4488 | goto out; | 4490 | goto out; |
| 4489 | } | 4491 | } |
