return tlbe->word2 & (PPC44x_TLB_SW|PPC44x_TLB_UW);
}
-/* Must be called with mmap_sem locked for writing. */
static void kvmppc_44x_shadow_release(struct kvm_vcpu *vcpu,
unsigned int index)
{
/* Get reference to new page. */
down_read(¤t->mm->mmap_sem);
new_page = gfn_to_page(vcpu->kvm, gfn);
+ up_read(¤t->mm->mmap_sem);
if (is_error_page(new_page)) {
printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn);
kvm_release_page_clean(new_page);
- up_read(¤t->mm->mmap_sem);
return;
}
hpaddr = page_to_phys(new_page);
/* Drop reference to old page. */
kvmppc_44x_shadow_release(vcpu, victim);
- up_read(¤t->mm->mmap_sem);
vcpu->arch.shadow_pages[victim] = new_page;
int i;
/* XXX Replace loop with fancy data structures. */
- down_write(¤t->mm->mmap_sem);
for (i = 0; i <= tlb_44x_hwater; i++) {
struct tlbe *stlbe = &vcpu->arch.shadow_tlb[i];
unsigned int tid;
stlbe->tid, stlbe->word0, stlbe->word1,
stlbe->word2, handler);
}
- up_write(¤t->mm->mmap_sem);
}
/* Invalidate all mappings on the privilege switch after PID has been changed.
if (vcpu->arch.swap_pid) {
/* XXX Replace loop with fancy data structures. */
- down_write(¤t->mm->mmap_sem);
for (i = 0; i <= tlb_44x_hwater; i++) {
struct tlbe *stlbe = &vcpu->arch.shadow_tlb[i];
stlbe->tid, stlbe->word0, stlbe->word1,
stlbe->word2, handler);
}
- up_write(¤t->mm->mmap_sem);
vcpu->arch.swap_pid = 0;
}