public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS
Date: Tue, 07 Jun 2011 11:24:49 +0300	[thread overview]
Message-ID: <4DEDE051.2090908@redhat.com> (raw)
In-Reply-To: <20110606172747.GA30900@amt.cnet>

On 06/06/2011 08:27 PM, Marcelo Tosatti wrote:
> Only decache guest CR3 value if vcpu->arch.cr3 is stale.
> Fixes loadvm with live guest.
>
>
> @@ -2049,7 +2049,9 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
>   					unsigned long cr0,
>   					struct kvm_vcpu *vcpu)
>   {
> -	vmx_decache_cr3(vcpu);
> +
> +	if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail))
> +		vmx_decache_cr3(vcpu);
>   	if (!(cr0&  X86_CR0_PG)) {
>   		/* From paging/starting to nonpaging */
>   		vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,

Applied and queued, but I think there is something rotten here.  How 
does arch.cr3 get into GUEST_CR3 after KVM_SET_SREGS?  arch.cr3 is a 
supposed to be write-through cache - it only has a bit in regs_avail, 
not regs_dirty.


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


  reply	other threads:[~2011-06-07  8:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 17:27 KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS Marcelo Tosatti
2011-06-07  8:24 ` Avi Kivity [this message]
2011-06-09 17:11   ` Marcelo Tosatti
2011-06-12  8:50     ` 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=4DEDE051.2090908@redhat.com \
    --to=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