qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>,
	pbonzini@redhat.com, imammedo@redhat.com, kvm@vger.kernel.org,
	mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com,
	qemu-devel@nongnu.org, stefanha@redhat.com,
	dan.j.williams@intel.com, rth@twiddle.net, "Yu,
	Yu-cheng" <yu-cheng.yu@intel.com>,
	"Wang, Yong Y" <yong.y.wang@intel.com>,
	"Kasten, Robert A" <robert.a.kasten@intel.com>,
	"Lai, Paul C" <paul.c.lai@intel.com>,
	"Xiao, Guangrong" <guangrong.xiao@intel.com>,
	"ruwang@redhat.com" <ruwang@redhat.com>,
	"Shankar, Ravi V" <ravi.v.shankar@intel.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>
Subject: Re: [Qemu-devel] XSAVES in GET_SUPPORTED_CPUID (was Re: [PATCH] target-i386: add Skylake-Client cpu mode)
Date: Tue, 3 May 2016 11:29:37 -0700	[thread overview]
Message-ID: <5728EE11.3090601@intel.com> (raw)
In-Reply-To: <20160503182352.GO4457@thinpad.lan.raisama.net>

On 05/03/2016 11:23 AM, Eduardo Habkost wrote:
> On Tue, May 03, 2016 at 10:53:43AM -0700, Dave Hansen wrote:
>> On 05/03/2016 10:44 AM, Xiao Guangrong wrote:
>>>>> This is the reason why setup_clear_cpu_cap(X86_FEATURE_XSAVES)
>>>>> introduced by commit e88221c50
>>>>> caused XSAVES unreported by KVM.
>>>>
>>>> So, is this the right behavior, or KVM can support exposing
>>>> XSAVES to guests even if the cpu_cap bit is cleared? I don't know
>>>> if exposing XSAVES to KVM guests depend on reworking kernel xsave
>>>> code or not.
>>>
>>> I think current behavior is right. KVM uses kernel's APIs to
>>> save/restore FPU context that may
>>> cause XSAVE not properly switched if XSAVES is used in VM but host does
>>> not see it.
>>
>> I don't think this is a correct statement.
>>
>> The guest's use of XSAVES is completely independent of what instructions
>> the host (kernel) uses for its xsave buffer.
>>
>> For instance, just because the kernel doesn't use XSAVES to context
>> switch Processor Trace, it does not make Processor Trace unusable to a
>> guest.  Guests are still free to do what they want with it (including
>> using XSAVES for its MSRs too btw...).
>>
> 
> In this case, is it better to replace the
> setup_clear_cpu_cap(X86_FEATURE_XSAVES) quirk with some other
> workaround that won't affect GET_SUPPORTED_CPUID, or should we
> make GET_SUPPORTED_CPUID ignore cpu_cap in the case of
> X86_FEATURE_XSAVES?

I think we should introduce a X86_FEATURE_ in word 3 (the Linux-defined
ones) that says whether Linux is *using* XSAVES for its FPU buffers.

Then make sure that we leave X86_FEATURE_XSAVES alone so that it
accurately represents what the _hardware_ supports.  We might even want
to change the name of X86_FEATURE_XSAVES so we don't confuse it with the
software bit.

  reply	other threads:[~2016-05-03 18:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27  8:13 [Qemu-devel] [PATCH] target-i386: add Skylake-Client cpu mode Xiao Guangrong
2016-04-27 11:56 ` Eduardo Habkost
2016-04-28 17:34 ` Eduardo Habkost
2016-05-03  6:38   ` Xiao Guangrong
2016-05-03 16:11     ` [Qemu-devel] XSAVES in GET_SUPPORTED_CPUID (was Re: [PATCH] target-i386: add Skylake-Client cpu mode) Eduardo Habkost
2016-05-03 17:44       ` Xiao Guangrong
2016-05-03 17:53         ` Dave Hansen
2016-05-03 18:23           ` Eduardo Habkost
2016-05-03 18:29             ` Dave Hansen [this message]
2016-05-09 13:44           ` Paolo Bonzini
2016-05-12 12:03             ` Eduardo Habkost
2016-05-12 12:06               ` Paolo Bonzini
2016-05-20 21:39                 ` [Qemu-devel] [QEMU PATCH v2] target-i386: Add Skylake-Client CPU model Eduardo Habkost
2016-05-23 13:46                   ` Paolo Bonzini
2016-06-03  3:50                     ` Xiao Guangrong
2016-06-03 17:27                       ` Eduardo Habkost
2016-04-29  3:11 ` [Qemu-devel] [PATCH] target-i386: add Skylake-Client cpu mode Huang, Kai
2016-04-29  3:28   ` Xiao Guangrong

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=5728EE11.3090601@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=gleb@kernel.org \
    --cc=guangrong.xiao@intel.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=imammedo@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=paul.c.lai@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=robert.a.kasten@intel.com \
    --cc=rth@twiddle.net \
    --cc=ruwang@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=yong.y.wang@intel.com \
    --cc=yu-cheng.yu@intel.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;
as well as URLs for NNTP newsgroup(s).