Re: [kvm-devel] [PATCH 7/8] KVM: MMU: VMX cr3 cache support

2008-03-06 Thread Zhao Forrest
@@ -1219,53 +1229,75 @@ static void nonpaging_prefetch_page(struct kvm_vcpu *vcpu, static void mmu_free_roots(struct kvm_vcpu *vcpu) { - int i; + int i, j; struct kvm_mmu_page *sp; - if (!VALID_PAGE(vcpu-arch.mmu.root_hpa)) - return; + /*

Re: [kvm-devel] [PATCH 7/8] KVM: MMU: VMX cr3 cache support

2008-03-06 Thread Marcelo Tosatti
Hi Zhao, On Thu, Mar 06, 2008 at 09:15:59PM +0800, Zhao Forrest wrote: @@ -1219,53 +1229,75 @@ static void nonpaging_prefetch_page(struct kvm_vcpu *vcpu, static void mmu_free_roots(struct kvm_vcpu *vcpu) { - int i; + int i, j; struct kvm_mmu_page *sp; -

Re: [kvm-devel] [PATCH 7/8] KVM: MMU: VMX cr3 cache support

2008-03-06 Thread Avi Kivity
Marcelo Tosatti wrote: Here CR3_TARGET_VALUEx is written. My question is: 1 why is vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); called by vmx_set_cr3(), but not called by mmu_free_roots()? By clearing guest_cr3 entry of the shared area we avoid the guest from using it. So its

Re: [kvm-devel] [PATCH 7/8] KVM: MMU: VMX cr3 cache support

2008-03-06 Thread Marcelo Tosatti
On Thu, Mar 06, 2008 at 04:44:26PM +0200, Avi Kivity wrote: Marcelo Tosatti wrote: Here CR3_TARGET_VALUEx is written. My question is: 1 why is vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); called by vmx_set_cr3(), but not called by mmu_free_roots()? By clearing guest_cr3 entry of