public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] do not call gva_to_gpa on physical address
Date: Wed, 14 Jul 2010 18:44:15 +0300	[thread overview]
Message-ID: <4C3DDB4F.3050208@redhat.com> (raw)
In-Reply-To: <20100714153858.GI4689@redhat.com>

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@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;
>    

Why not

     if (tdp_enabled)
               return false;

at the top?  Is there any reason ever to reexecute an instruction with 
tdp enabled?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  reply	other threads:[~2010-07-14 15:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14 15:38 [PATCH] do not call gva_to_gpa on physical address Gleb Natapov
2010-07-14 15:44 ` Avi Kivity [this message]
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=4C3DDB4F.3050208@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@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