Re: [PATCH v2 4/4] KVM: MMU: cleanup pte write path
From: Avi Kivity
Date: Thu Mar 10 2011 - 05:22:10 EST
On 03/09/2011 09:43 AM, Xiao Guangrong wrote:
This patch does:
- call vcpu->arch.mmu.update_pte directly
- use gfn_to_pfn_atomic in update_pte path
The suggestion is from Avi.
- mmu_guess_page_from_pte_write(vcpu, gpa, gentry);
+ mmu_seq = vcpu->kvm->mmu_notifier_seq;
+ smp_rmb();
smp_rmb() should come before, no? but the problem was present in the
original code, too.
+
spin_lock(&vcpu->kvm->mmu_lock);
if (atomic_read(&vcpu->kvm->arch.invlpg_counter) != invlpg_counter)
gentry = 0;
@@ -3365,7 +3345,8 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
if (gentry&&
!((sp->role.word ^ vcpu->arch.mmu.base_role.word)
& mask.word))
- mmu_pte_write_new_pte(vcpu, sp, spte,&gentry);
+ mmu_pte_write_new_pte(vcpu, sp, spte,&gentry,
+ mmu_seq);
Okay, we're only iterating over indirect pages, so we won't call
nonpaging_update_pte().
--
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/