All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Shuai Ruan <shuai.ruan@linux.intel.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: XSAVE flavors
Date: Tue, 02 Feb 2016 02:42:38 -0700	[thread overview]
Message-ID: <56B0881E02000078000CD58A@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20160202063110.GB3036@shuai.ruan@linux.intel.com>

>>> On 02.02.16 at 07:31, <shuai.ruan@linux.intel.com> wrote:
> On Tue, Jan 26, 2016 at 08:12:20AM -0700, Jan Beulich wrote:
>> >>> On 26.01.16 at 15:33, <JBeulich@suse.com> wrote:
>> > originally I only meant to inquire about the state of the promised
>> > alternatives improvement to the XSAVE code. However, while
>> > looking over the code in question again I stumbled across a
>> > separate issue: XSAVES, just like XSAVEOPT, may use the
>> > "modified" optimization. However, the fcs and fds handling code
>> > that has been present around the use of XSAVEOPT did not also
>> > get applied to the XSAVES path. I suppose this was just an
>> > oversight?
> Really sorry for late response. The alternatives on xsave code is ok a 
> couples 
> weeks ago, the patch solve xsaves use modified optimization problem.
> I will send it now.

Thanks, But this response of yours covers only one half of what
I've pointed out.

>> > With this another question then is whether, when both XSAVEC
>> > and XSAVEOPT are available, it is indeed always better to use
>> > XSAVEC (as the code is doing after your enabling).
> Yes.
> But current no machine only support xsavec not support xsaves.  
> I enable xsavec for "xsavec is a feature".

But this shouldn't preclude the code being in reasonable shape
also for the case where a CPU has XSAVEC but no XSAVES. The
more that right now we don't really need XSAVES (since we don't
yet allow any bit to get set in XSS).

>> And I'm afraid there's yet one more issue: If my reading of the
>> SDM is right, then the offsets at which components get saved
>> by XSAVEC / XSAVES aren't fixed, but depend on RFBM (as that's
>> what gets stored into xcomp_bv[62:0]). xstate_comp_offsets[],
>> otoh, gets computed based on all available features, irrespective
>> of vcpu_xsave_mask() returning four different values depending
>> on current guest state. I can't see how get_xsave_addr() can
>> work correctly without honoring xcomp_bv. Nor can I convince
>> myself that state can't get corrupted / lost, e.g. when a save
>> with v->fpu_dirtied set is followed by one with v->fpu_dirtied
>> clear.
>> 
>> Am I misunderstanding what the SDM writes?
>> 
> Yes. you are right. This is a issue. I will find a way to solve
> this.

Thanks.

Jan

  parent reply	other threads:[~2016-02-02  9:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 14:33 XSAVE flavors Jan Beulich
2016-01-26 15:12 ` Jan Beulich
2016-02-02  6:31   ` Shuai Ruan
     [not found]   ` <20160202063110.GB3036@shuai.ruan@linux.intel.com>
2016-02-02  9:42     ` Jan Beulich [this message]
2016-02-04  6:49       ` Shuai Ruan
     [not found]       ` <20160204064935.GB13660@shuai.ruan@linux.intel.com>
2016-02-04  8:51         ` Jan Beulich
2016-02-18  3:19           ` Shuai Ruan

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=56B0881E02000078000CD58A@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=shuai.ruan@linux.intel.com \
    --cc=xen-devel@lists.xenproject.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 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.