From: Don Koch Subject: Re: [RFC PATCH] Drop error return if size mismatch is due to xcr0 settings Date: Thu, 9 Oct 2014 11:45:39 -0400 Message-ID: <20141009114539.e701a4337830f2330fb5e729@verizon.com> References: <1412792976-6696-1-git-send-email-dkoch@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1412792976-6696-1-git-send-email-dkoch@verizon.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Koch Cc: Keir Fraser , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 8 Oct 2014 14:29:36 -0400 Don Koch 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 > Signed-off-by: Don Koch > --- > The question I have is whether to drop just the error return, leaving > a warning which might be useful for debugging, or drop the entire test > and the assigment before it. I think it would be prudent to test for > desc->length > max_size (i.e. XSTATE_CPUID's ecx value). > > Personally, I think the warning is useful and a check against the max > size test should print an error/warning message and return an error; > the latter would require a new function. > > The change that introduced this was 4cc134444. > > The following is the minimum change "fix." > > xen/arch/x86/hvm/hvm.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index f0e1edc..dfedfb3 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -2041,7 +2041,6 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h) > printk(XENLOG_G_WARNING > "HVM%d.%d restore mismatch: xsave length %u > %u\n", > d->domain_id, vcpuid, desc->length, size); > - return -EOPNOTSUPP; > } > /* Checking finished */ > > -- > 1.8.3.1 >