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>
int r;
struct kvm_pv_mmu_op_buffer buffer;
- down_read(¤t->mm->mmap_sem);
-
buffer.ptr = buffer.buf;
buffer.len = min_t(unsigned long, bytes, sizeof buffer.buf);
buffer.processed = 0;
r = 1;
out:
*ret = buffer.processed;
- up_read(¤t->mm->mmap_sem);
return r;
}