Skip to content

Commit

Permalink
KVM: MMU: kvm_pv_mmu_op should not take mmap_sem
Browse files Browse the repository at this point in the history
kvm_pv_mmu_op should not take mmap_sem. All gfn_to_page() callers down
in the MMU processing will take it if necessary, so as it is it can
deadlock.

Apparently a leftover from the days before slots_lock.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Marcelo Tosatti authored and Avi Kivity committed Apr 27, 2008
1 parent 1336028 commit 960b399
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,8 +2173,6 @@ int kvm_pv_mmu_op(struct kvm_vcpu *vcpu, unsigned long bytes,
int r;
struct kvm_pv_mmu_op_buffer buffer;

down_read(&current->mm->mmap_sem);

buffer.ptr = buffer.buf;
buffer.len = min_t(unsigned long, bytes, sizeof buffer.buf);
buffer.processed = 0;
Expand All @@ -2194,7 +2192,6 @@ int kvm_pv_mmu_op(struct kvm_vcpu *vcpu, unsigned long bytes,
r = 1;
out:
*ret = buffer.processed;
up_read(&current->mm->mmap_sem);
return r;
}

Expand Down

0 comments on commit 960b399

Please sign in to comment.