From: "Jan Beulich" Subject: Re: [PATCH v6] Sanity check xsave area when migrating or restoring from older Xen verions Date: Thu, 23 Oct 2014 16:13:59 +0100 Message-ID: <54493757020000780004180B@mail.emea.novell.com> References: <1413989611-14280-1-git-send-email-dkoch@verizon.com> <5448CC84020000780004154D@mail.emea.novell.com> <20141023102005.dccb23873eba760e85526f87@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141023102005.dccb23873eba760e85526f87@verizon.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: Don Koch Cc: Andrew Cooper , Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 23.10.14 at 16:20, wrote: > On Thu, 23 Oct 2014 08:38:12 +0100 > Jan Beulich wrote: > >> >>> On 22.10.14 at 16:53, wrote: >> > @@ -2011,15 +2012,8 @@ static int hvm_load_cpu_xsave_states(struct domain > *d, hvm_domain_context_t *h) >> > save_area) + XSTATE_AREA_MIN_SIZE); >> > return -EINVAL; >> > } >> > - size = HVM_CPU_XSAVE_SIZE(xfeature_mask); >> > - if ( desc->length > size ) >> > - { >> > - printk(XENLOG_G_WARNING >> > - "HVM%d.%d restore mismatch: xsave length %u > %u\n", >> > - d->domain_id, vcpuid, desc->length, size); >> > - return -EOPNOTSUPP; >> > - } >> > h->cur += sizeof (*desc); >> > + overflow_start = h->cur; >> >> This variable badly named: What it points to is the payload, not the >> excess data. > > Wasn't fond of the name, anyway. (I'm horrid at picking variable names.) > Propose changing it to desc_start. Or data_start or payload_start, or just start. >> > @@ -2038,10 +2032,23 @@ static int hvm_load_cpu_xsave_states(struct domain > *d, hvm_domain_context_t *h) >> > size = HVM_CPU_XSAVE_SIZE(ctxt->xcr0_accum); >> > if ( desc->length > size ) >> > { >> > + /* >> > + * Xen-4.3 and older used to send longer-than-needed xsave regions. >> >> 4.3.0 please (also in the patch description), since from 4.3.1 >> onwards this isn't the case anymore. > > OK. I was unaware this had been ported to 4.3.1. Will change. > > Are there any versions of 4.2.x that said patch has been backported to? I think so; just go check. Jan