From: Gleb Natapov <gleb@redhat.com>
To: mtosatti@redhat.com, avi@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH] do not call gva_to_gpa on physical address
Date: Wed, 14 Jul 2010 18:38:58 +0300 [thread overview]
Message-ID: <20100714153858.GI4689@redhat.com> (raw)
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.
next reply other threads:[~2010-07-14 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 15:38 Gleb Natapov [this message]
2010-07-14 15:44 ` [PATCH] do not call gva_to_gpa on physical address Avi Kivity
2010-07-14 15:52 ` Gleb Natapov
2010-07-14 15:55 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100714153858.GI4689@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox