public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH] KVM: Fix OSXSAVE after migration
Date: Thu, 9 Dec 2010 09:17:42 +0800	[thread overview]
Message-ID: <201012090917.42363.sheng@linux.intel.com> (raw)
In-Reply-To: <4CFF5F07.6080403@redhat.com>

On Wednesday 08 December 2010 18:33:43 Avi Kivity wrote:
> On 12/08/2010 04:49 AM, Sheng Yang wrote:
> > CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the
> > CPUID after migration.
> 
> Applied, thanks.
> 
> > @@ -5585,6 +5585,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu
> > *vcpu,
> > 
> >   	mmu_reset_needed |= kvm_read_cr4(vcpu) != sregs->cr4;
> >   	kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
> > 
> > +	if (sregs->cr4&  X86_CR4_OSXSAVE)
> > +		update_cpuid(vcpu);
> > 
> >   	if (!is_long_mode(vcpu)&&  is_pae(vcpu)) {
> >   	
> >   		load_pdptrs(vcpu, vcpu->arch.walk_mmu, vcpu->arch.cr3);
> >   		mmu_reset_needed = 1;
> 
> We really should use kvm_set_crX() here.

Yeah, I suppose we use ops->set_cr4() here because we don't need to all kinds of 
check and operation for the value(which should already be done by other S/R code), 
so I just add update_cpuid() here.

--
regards
Yang, Sheng

  reply	other threads:[~2010-12-09  1:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08  2:49 [PATCH] KVM: Fix OSXSAVE after migration Sheng Yang
2010-12-08 10:33 ` Avi Kivity
2010-12-09  1:17   ` Sheng Yang [this message]
2010-12-09 10:04     ` 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=201012090917.42363.sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=stable@kernel.org \
    /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