public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] do not call gva_to_gpa on physical address
@ 2010-07-14 15:38 Gleb Natapov
  2010-07-14 15:44 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Gleb Natapov @ 2010-07-14 15:38 UTC (permalink / raw)
  To: mtosatti, avi; +Cc: kvm

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@redhat.com>
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;
--
			Gleb.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-14 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 15:38 [PATCH] do not call gva_to_gpa on physical address Gleb Natapov
2010-07-14 15:44 ` Avi Kivity
2010-07-14 15:52   ` Gleb Natapov
2010-07-14 15:55     ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox