xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: KeirFraser <keir@xen.org>,
	Donald D Dugger <donald.d.dugger@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Yang Z Zhang <yang.z.zhang@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: XSAVE save/restore shortcomings
Date: Fri, 6 Sep 2013 13:39:31 +0100	[thread overview]
Message-ID: <5229CD03.3080303@citrix.com> (raw)
In-Reply-To: <5229E82A02000078000F10C4@nat28.tlf.novell.com>

On 06/09/13 13:35, Jan Beulich wrote:
>>>> On 06.09.13 at 13:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Linux publishes the XSAVE blob to userspace as an NT_X86_XSTATE note in
>> core dumps, but does not include CPUID data.  If offsets change, it will
>> not be possible to examine a core dump without knowing the processor on
>> which it was produced.
> Design mistake.
>
>> For our beloved hypervisors, if offsets can change it will be
>> _impossible_ to migrate from a machine to another if they have different
>> offsets.  It will be impossible (lest you disable XSAVE and thus all
>> processor features starting with AVX) to have clusters of heterogeneous
>> virtualization hosts.  This is because (a) the guest might have stored
>> XSAVE areas at arbitrary places in the source, and the destination will
>> not be able to restore them; (b) there are no vmexits for
>> XSAVE/XSAVEOPT/XRSTOR, and anyway they would be too slow.
> No, this is precisely what this thread is about: Migration can work
> with the offsets varying, but only if the there's no attempt to save
> the whole blob in one go. There needs to be a save record per
> state component, and that save record needs to include (implicitly
> or explicitly) include the size of that blob; the offset within the
> save area is of no interest then - the consuming system simply
> needs to put it at the offset within its save area that corresponds
> to the respective state component.
>
> The fact that we're currently dependent on the offsets is again a
> design flaw.

There is a further complication - There would need to be full guest OS
support for the offsets possibly changing across migrate.  Simply having
Xen able to fix up the vcpu state doesn't prevent the guest OS from
getting it wrong.

~Andrew

>
>> So please Intel, pretty please do not modify the XSAVE offsets, and
>> clarify this as soon as possible.
> I'd like to ask for the exact opposite: Drop any mention of specific
> numbers from the documentation, except when used as an
> example for a particular implementation (it's that, btw, how I
> interpret the numbers given in the AVX-512 spec). Not allowing
> compaction is going to be harmful sooner or later (as processors
> show up that implement new state, but may not implement all
> previous features, namely if some of them turn out to be relatively
> useless: AMD's LWP appears to be an example of such a feature,
> at least judging by - as you alluded to - no OS actually making use
> of it by now, and at least some people seem to think of MPX as
> being pretty useless too).
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-09-06 12:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30  9:55 [PATCH] x86/xsave: fix migration from xsave-capable to xsave-incapable host Jan Beulich
2013-08-30 10:11 ` XSAVE save/restore shortcomings (was: [PATCH] x86/xsave: fix migration from xsave-capable to xsave-incapable host) Jan Beulich
2013-08-30 13:47   ` XSAVE save/restore shortcomings Andrew Cooper
2013-09-05 10:53   ` Paolo Bonzini
2013-09-05 12:01     ` Jan Beulich
2013-09-05 13:58       ` Paolo Bonzini
2013-09-05 14:34         ` Jan Beulich
2013-09-06  3:03           ` Zhang, Yang Z
2013-09-06  6:59             ` Jan Beulich
2013-09-06  7:20               ` Zhang, Yang Z
2013-09-06  7:31                 ` Jan Beulich
2013-09-06  7:45                   ` Zhang, Yang Z
2013-09-06 11:57                     ` Paolo Bonzini
2013-09-06 12:35                       ` Jan Beulich
2013-09-06 12:38                         ` Paolo Bonzini
2013-09-06 12:39                         ` Andrew Cooper [this message]
2013-09-06 14:44                       ` H. Peter Anvin
2013-09-06 15:03                         ` Paolo Bonzini
2013-09-06 15:04                           ` H. Peter Anvin
2013-09-03  5:47 ` [PATCH] x86/xsave: fix migration from xsave-capable to xsave-incapable host Zhang, Yang Z
2013-09-09 11:16 ` Keir Fraser

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=5229CD03.3080303@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=donald.d.dugger@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yang.z.zhang@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).