On Wed, Jul 14, 2010 at 06:44:15PM +0300, Avi Kivity wrote: > On 07/14/2010 06:38 PM, Gleb Natapov wrote: > >When tdp is enabled cr2 passed to emulator is pga not gva, so no need to > >call gva_to_gpa on it. > > > >Signed-off-by: Gleb Natapov<gleb@xxxxxxxxxx> > >diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > >index fb08316..721bf0a 100644 > >--- a/arch/x86/kvm/x86.c > >+++ b/arch/x86/kvm/x86.c > >@@ -3944,10 +3944,13 @@ static bool reexecute_instruction(struct kvm_vcpu *vcpu, gva_t gva) > > if (kvm_mmu_unprotect_page_virt(vcpu, gva)) > > return true; > > > >- gpa = kvm_mmu_gva_to_gpa_system(vcpu, gva, NULL); > >+ if (!tdp_enabled) { > >+ gpa = kvm_mmu_gva_to_gpa_system(vcpu, gva, NULL); > > > >- if (gpa == UNMAPPED_GVA) > >- return true; /* let cpu generate fault */ > >+ if (gpa == UNMAPPED_GVA) > >+ return true; /* let cpu generate fault */ > >+ } else > >+ gpa = gva; > > > > if (!kvm_is_error_hva(gfn_to_hva(vcpu->kvm, gpa>> PAGE_SHIFT))) > > return true; > > Why not > > if (tdp_enabled) > return false; > > at the top? Is there any reason ever to reexecute an instruction > with tdp enabled? > Can't think of one now. If in the future we will shadow some other data structures in the guest except page tables (nested vmx/svm?) there may be the reason. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html