diff options
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c index aa649c7db99b..1c48d6164bd5 100644 --- a/arch/powerpc/kvm/44x_tlb.c +++ b/arch/powerpc/kvm/44x_tlb.c | |||
@@ -142,18 +142,19 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid, | |||
142 | stlbe = &vcpu->arch.shadow_tlb[victim]; | 142 | stlbe = &vcpu->arch.shadow_tlb[victim]; |
143 | 143 | ||
144 | /* Get reference to new page. */ | 144 | /* Get reference to new page. */ |
145 | down_write(¤t->mm->mmap_sem); | 145 | down_read(¤t->mm->mmap_sem); |
146 | new_page = gfn_to_page(vcpu->kvm, gfn); | 146 | new_page = gfn_to_page(vcpu->kvm, gfn); |
147 | if (is_error_page(new_page)) { | 147 | if (is_error_page(new_page)) { |
148 | printk(KERN_ERR "Couldn't get guest page!\n"); | 148 | printk(KERN_ERR "Couldn't get guest page!\n"); |
149 | kvm_release_page_clean(new_page); | 149 | kvm_release_page_clean(new_page); |
150 | up_read(¤t->mm->mmap_sem); | ||
150 | return; | 151 | return; |
151 | } | 152 | } |
152 | hpaddr = page_to_phys(new_page); | 153 | hpaddr = page_to_phys(new_page); |
153 | 154 | ||
154 | /* Drop reference to old page. */ | 155 | /* Drop reference to old page. */ |
155 | kvmppc_44x_shadow_release(vcpu, victim); | 156 | kvmppc_44x_shadow_release(vcpu, victim); |
156 | up_write(¤t->mm->mmap_sem); | 157 | up_read(¤t->mm->mmap_sem); |
157 | 158 | ||
158 | vcpu->arch.shadow_pages[victim] = new_page; | 159 | vcpu->arch.shadow_pages[victim] = new_page; |
159 | 160 | ||