From: "Jan Beulich" Subject: Re: XSAVE save/restore shortcomings Date: Fri, 06 Sep 2013 13:35:22 +0100 Message-ID: <5229E82A02000078000F10C4@nat28.tlf.novell.com> References: <5220884102000078000EFA99@nat28.tlf.novell.com> <52208BD602000078000EFACC@nat28.tlf.novell.com> <5228629C.2090103@redhat.com> <52288EC302000078000F0CDD@nat28.tlf.novell.com> <52288E16.2030205@redhat.com> <5228B2A502000078000F0E10@nat28.tlf.novell.com> <5229996F02000078000F0FB1@nat28.tlf.novell.com> <5229A0DE02000078000F0FCA@nat28.tlf.novell.com> <5229C326.8050009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VHvFz-0003iN-NM for xen-devel@lists.xenproject.org; Fri, 06 Sep 2013 12:35:23 +0000 In-Reply-To: <5229C326.8050009@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Yang Z Zhang , Paolo Bonzini Cc: xen-devel , "H. Peter Anvin" , KeirFraser , Jun Nakajima , Donald D Dugger List-Id: xen-devel@lists.xenproject.org >>> On 06.09.13 at 13:57, Paolo Bonzini 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. > 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