Prev: Add a function to indicate if device use external buffer.
Next: KVM MMU: split kvm_sync_page() function
From: Avi Kivity on 25 Apr 2010 06:00 On 04/25/2010 10:02 AM, Xiao Guangrong wrote: > Let invlpg not depends on kvm_mmu_pte_write path, later patch will need > this feature > > > if (mmu_topup_memory_caches(vcpu)) > return; > - kvm_mmu_pte_write(vcpu, pte_gpa, NULL, sizeof(pt_element_t), 0); > + > + kvm_read_guest_page(vcpu->kvm, gfn,&gentry, offset, > + sizeof(pt_element_t)); > + > Need error check. > + mmu_guess_page_from_pte_write(vcpu, gfn_to_gpa(gfn) + offset, gentry); > This needs an undo operation to drop the page if we don't update_pte(); see the end of kvm_mmu_pte_write(). That needs to go into a helper to avoid duplication. > + spin_lock(&vcpu->kvm->mmu_lock); > + if (atomic_read(&vcpu->kvm->arch.invlpg_counter) == invlpg_counter&& > + sp->role.level == PT_PAGE_TABLE_LEVEL) { > + ++vcpu->kvm->stat.mmu_pte_updated; > + FNAME(update_pte)(vcpu, sp, sptep,&gentry); > + } > + > + spin_unlock(&vcpu->kvm->mmu_lock); > } > > static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access, > -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Xiao Guangrong on 25 Apr 2010 23:20
Avi Kivity wrote: > On 04/25/2010 10:02 AM, Xiao Guangrong wrote: >> Let invlpg not depends on kvm_mmu_pte_write path, later patch will need >> this feature >> >> >> if (mmu_topup_memory_caches(vcpu)) >> return; >> - kvm_mmu_pte_write(vcpu, pte_gpa, NULL, sizeof(pt_element_t), 0); >> + >> + kvm_read_guest_page(vcpu->kvm, gfn,&gentry, offset, >> + sizeof(pt_element_t)); >> + >> > > Need error check. > >> + mmu_guess_page_from_pte_write(vcpu, gfn_to_gpa(gfn) + offset, >> gentry); >> > > This needs an undo operation to drop the page if we don't update_pte(); > see the end of kvm_mmu_pte_write(). That needs to go into a helper to > avoid duplication. > Ah, i forgot those, will fix in v3, thanks for you point out. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |