All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: kvm@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>, Avi Kivity <avi@redhat.com>
Subject: Re: KVM: VMX: remove GUEST_CR3 write from vmx_vcpu_run
Date: Thu, 22 Oct 2009 15:35:19 +0800	[thread overview]
Message-ID: <200910221535.20614.sheng@linux.intel.com> (raw)
In-Reply-To: <20091020123720.GA5679@amt.cnet>

On Tuesday 20 October 2009 20:37:20 Marcelo Tosatti wrote:
> GUEST_CR3 is updated via kvm_set_cr3 whenever CR3 value
> changes.

The description is not that accuracy... If CR3 value change in guest when EPT 
enabled, no VM Exit would happen, then no kvm_set_cr3...

-- 
regards
Yang, Sheng

>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 364263a..325075f 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
>  {
>  	struct vcpu_vmx *vmx = to_vmx(vcpu);
>
> -	if (enable_ept && is_paging(vcpu)) {
> -		vmcs_writel(GUEST_CR3, vcpu->arch.cr3);
> +	if (enable_ept && is_paging(vcpu))
>  		ept_load_pdptrs(vcpu);
> -	}
> +
>  	/* Record the guest's net vcpu time for enforced NMI injections. */
>  	if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
>  		vmx->entry_time = ktime_get();
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  parent reply	other threads:[~2009-10-22  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 12:37 KVM: VMX: remove GUEST_CR3 write from vmx_vcpu_run Marcelo Tosatti
2009-10-20 13:14 ` Avi Kivity
2009-10-20 13:59   ` Marcelo Tosatti
2009-10-22  7:06     ` Avi Kivity
2009-10-22  7:35 ` Sheng Yang [this message]
2009-10-22  7:48   ` 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=200910221535.20614.sheng@linux.intel.com \
    --to=sheng@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.