qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data
Date: Tue, 14 Jun 2016 16:31:37 +0800	[thread overview]
Message-ID: <20160614083136.GD21465@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <7ce88285-2d4c-7b4a-767a-7e6c9eb25f2b@redhat.com>

On Tue, Jun 14, 2016 at 10:21:41AM +0200, Paolo Bonzini wrote:
> 
> 
> On 14/06/2016 07:01, Chao Peng wrote:
> >> > 
> >> > Which are the CPUID leaves for which KVM_GET_SUPPORTED_CPUID is not
> >> > stateless?  I cannot find any.
> > I have though leaf 0xd, sub leaf 1 is not stateless, as the size of
> > xsave buffer(EBX) is based on XCR0 | IA32_XSS. But after looking KVM
> > code more carefully, seems I was wrong. The code calculates EBX with the
> > host xcr0 but not guest xcr0, nor guest IA32_XSS (not sure if this is
> > the correct behavior), so it can always returns constant data on a
> > certain machine.
> 
> Indeed, KVM computes the correct value at runtime, but
> KVM_GET_SUPPORTED_CPUID runs before there is a value for guest XCR0 or
> guest IA32_XSS.

Yes, this is the point.

> 
> Thanks, I've queued the patch for QEMU 2.7.

Thanks :)

Chao

      reply	other threads:[~2016-06-14  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  2:21 [Qemu-devel] [PATCH] target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data Chao Peng
2016-06-13 10:02 ` Paolo Bonzini
2016-06-14  5:01   ` Chao Peng
2016-06-14  8:21     ` Paolo Bonzini
2016-06-14  8:31       ` Chao Peng [this message]

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=20160614083136.GD21465@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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;
as well as URLs for NNTP newsgroup(s).