All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Don Koch <dkoch@verizon.com>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [RFC PATCH] Drop error return if size mismatch is due to xcr0 settings
Date: Thu, 9 Oct 2014 17:20:53 +0100	[thread overview]
Message-ID: <5436B5E5.7030407@citrix.com> (raw)
In-Reply-To: <20141009121047.0c68d196aa2e3a873ab85cfd@verizon.com>

On 09/10/14 17:10, Don Koch wrote:
> On Thu, 9 Oct 2014 16:56:49 +0100
> Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
>> On 09/10/14 16:45, Don Koch wrote:
>>> On Wed, 8 Oct 2014 14:29:36 -0400
>>> Don Koch <dkoch@verizon.com> wrote:
>>>
>>>> This prevents migration from 4.3 to 4.4 (or newer) xen on AMD machines, at
>>>> least.
>>> A clarification: a previous change made migration from xen 4.3 to 4.4 on AMD
>>> machine fail. This patch provides a (minimal) fix for the problem. IMO, it should
>>> be targeted for 4.5 and 4.4.x (whatever the next 'x' is).
>>>
>>> If it's decided to add the other changes I've suggested, those could be provided
>>> in a separate patch, especially if we're time constrained (like for getting it
>>> into 4.5).
>>>
>>> -d
>> Can you explain what the bug is and why this is an appropriate fix?
>>
>> What is happening here is that the migration stream is providing an
>> xsave area larger than the size it should be based on the xcr0 sent with it.
> The old 4.3 system is providing a maximum size xsave area. The 4.4 xen
> is calculating a smaller area required for said xsave area. All this means
> is that the overflow at the end is meaningless and can be ignored (i.e.
> restoring it shouldn't hurt).  If the data sent was smaller than what was
> expected, i.e. something is missing, that would be an error.
>
> I consider leaving the check and warning message useful as it allows
> some debugging info if there indeed was something wrong. I tested this
> on an AMD migrating from 4.3 to 4.4 and checking various ymm registers
> with no data lost.

Right ok - given this info, the patch looks plausible, but these details
must be in the patch description.

Given this diagnosis, I think it is reasonable to not fail the hypercall
if we detect this condition and confirm that all unexpectedly-extra
bytes are 0.

In the case that there is a non-zero byte in there, we must fail the
hypercall to prevent VM data corruption.  The warning can be dropped for
the "fixing up from Xen 4.3" case, but a sentence of two comment in the
code will certainly be needed as justification.

~Andrew

  reply	other threads:[~2014-10-09 16:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 18:29 [RFC PATCH] Drop error return if size mismatch is due to xcr0 settings Don Koch
2014-10-08 18:31 ` Don Koch
2014-10-09 15:45 ` Don Koch
2014-10-09 15:56   ` Andrew Cooper
2014-10-09 16:10     ` Don Koch
2014-10-09 16:20       ` Andrew Cooper [this message]
2014-10-10  6:36         ` Jan Beulich
2014-10-10 15:30           ` Don Koch

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=5436B5E5.7030407@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=dkoch@verizon.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.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.