From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shuai Ruan Subject: Re: [PATCH V3 5/6] x86/xsaves: support compact format for hvm save/restore Date: Wed, 12 Aug 2015 19:23:09 +0800 Message-ID: <10175.0745591291$1439378597@news.gmane.org> References: <1438739842-31658-1-git-send-email-shuai.ruan@linux.intel.com> <1438739842-31658-6-git-send-email-shuai.ruan@linux.intel.com> <55C259DF.7040401@citrix.com> <20150811080143.GC14406@shuai.ruan@linux.intel.com> <55C9BFF8.3050309@citrix.com> Reply-To: Shuai Ruan Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <55C9BFF8.3050309@citrix.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: Andrew Cooper Cc: Xen-devel List List-Id: xen-devel@lists.xenproject.org On Tue, Aug 11, 2015 at 10:27:20AM +0100, Andrew Cooper wrote: > On 11/08/15 09:01, Shuai Ruan wrote: > > > >>> + > >>> + /* > >>> + * The FP xstates and SSE xstates are legacy states. They are always > >>> + * in the fixed offsets in the xsave area in either compacted form > >>> + * or standard form. > >>> + */ > >>> + xstate_comp_offsets[0] = 0; > >>> + xstate_comp_offsets[1] = XSAVE_SSE_OFFSET; > >>> + > >>> + xstate_comp_offsets[2] = FXSAVE_SIZE + XSAVE_HDR_SIZE; > >>> + > >>> + for (i = 2; i < xstate_features; i++) > >> This loop will run off the end of xstate_comp_sizes[] for any processor > >> supporting AVX512 or greater. > >> > > For the length of xsate_comp_sizes is 64, I think the case you mentioned > > above will not happen. > > xstate_features is a bitmap. The comparison "i < xstate_features" is > bogus, and loops many more times than you intend. > Ok. Thanks for your review, Andrew > ~Andrew > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >