diff options
author | Avi Kivity <avi@qumranet.com> | 2007-12-31 17:10:22 +0200 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-12-31 17:10:22 +0200 |
commit | a089279c866ddf3a69c4fa13fb9935b143853f97 (patch) | |
tree | e1ca82c78a5f06125d094d11c72d7ce12a5a6a05 | |
parent | 91f0ad972111addf2d694b1f2237e5eae72ca454 (diff) |
KVM: MMU: Broaden scope of mmap_sem to include actual mappingkvm-59rc1
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index bfdff1a4daa4..c478ee25de66 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1018,12 +1018,14 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn) down_read(¤t->mm->mmap_sem); page = gfn_to_page(vcpu->kvm, gfn); - up_read(¤t->mm->mmap_sem); spin_lock(&vcpu->kvm->mmu_lock); kvm_mmu_free_some_pages(vcpu); r = __nonpaging_map(vcpu, v, write, gfn, page); spin_unlock(&vcpu->kvm->mmu_lock); + + up_read(¤t->mm->mmap_sem); + return r; } |