From: "Jan Beulich" Subject: Re: [PATCH v4] Sanity check xsave area when migrating or restoring from older Xen verions Date: Wed, 22 Oct 2014 15:21:19 +0100 Message-ID: <5447D97F020000780004115B@mail.emea.novell.com> References: <1413916854-18831-1-git-send-email-dkoch@verizon.com> <5446AD65.5070501@citrix.com> <20141021152520.401fa80fb66538d1bb5de16b@verizon.com> <54479C740200007800040EF2@mail.emea.novell.com> <20141022091906.61751e3ff7a9fce1863c97e8@verizon.com> <5447D54B02000078000410E1@mail.emea.novell.com> <20141022101157.0d003cb0eef489a311d43e70@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141022101157.0d003cb0eef489a311d43e70@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 22.10.14 at 16:11, wrote: > On Wed, 22 Oct 2014 15:03:23 +0100 > Jan Beulich wrote: > >> >>> On 22.10.14 at 15:19, wrote: >> > On Wed, 22 Oct 2014 11:00:52 +0100 >> > Jan Beulich wrote: >> > >> >> >>> On 21.10.14 at 21:25, wrote: >> >> > On Tue, 21 Oct 2014 20:00:53 +0100 >> >> > Andrew Cooper wrote: >> >> > >> >> >> On 21/10/14 19:40, Don Koch wrote: > [...] >> >> >> > + printk(XENLOG_G_WARNING >> >> >> > + "HVM%u.%u restore mismatch: xsave length %u > >> > %u\n", >> >> >> > + d->domain_id, vcpuid, desc->length, size); >> >> >> > + printk(XENLOG_G_WARNING >> >> >> > + "HVM%u.%u restore mismatch: xsave has non-zero > data >> > starting at %#x\n", >> >> >> > + d->domain_id, vcpuid, i); >> >> >> >> >> >> This should be one message. Also note that, while a lot of code gets it >> >> >> wrong, domain_id is signed while vcpuid is unsigned. >> >> > >> >> > I had suggested one message. Jan said it should be two. >> >> >> >> Right, and I still think it should be two. Just not the way you did it. >> >> I specifically said in the reply to the previous version " just add your >> >> new check ahead of the existing printk()". In case this was ambiguous >> >> to you - I think the pre-existing printk() should continue to get >> >> issued (even if not being on an error path anymore) so that we have >> >> some kind of indication that the truncating path was taken. After all >> >> this shouldn't happen frequently, considering that the most recent >> >> stable releases of the older branches already don't do this anymore. >> > >> > I thought that's where I had it. If the block size mismatch is detected, >> > issue the first message then go into the loop to check for non-zero data >> > and, if any is found, then issue the second and exit. >> > >> > Andrew, IIUC, didn't want the first one issued unless the non-zero data >> > case was found, i.e. issue no message unless both conditions were met. >> > >> > So, which should I do? >> >> I'm really getting tired of this; I don't think it's that difficult: >> >> if size too large >> loop over extra data >> if non-zero >> issue error message >> return >> issue warning message > > My only issue with this is seeing just the error: > HVM1.1 restore mismatch: xsave has non-zero data starting at 0x232 > would make one wonder, "What's wrong with non-zero data? If it's supposed > to be zero, why is it being sent in the first place?" Just make the message text meaningful enough for your liking then. I personally don't think the text matters too much here - you'll want to look at the source code anyway when you see this triggering. Jan