From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH V3 5/6] x86/xsaves: support compact format for hvm save/restore Date: Tue, 11 Aug 2015 10:27:20 +0100 Message-ID: <55C9BFF8.3050309@citrix.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150811080143.GC14406@shuai.ruan@linux.intel.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: Shuai Ruan Cc: Xen-devel List List-Id: xen-devel@lists.xenproject.org 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. ~Andrew