From: Shuai Ruan Subject: Re: [V5 2/4] x86/xsaves: enable xsaves/xrstors/xsavec in xen Date: Fri, 9 Oct 2015 16:14:37 +0800 Message-ID: <26564.2733466395$1444378492@news.gmane.org> References: <1442835241-26983-1-git-send-email-shuai.ruan@linux.intel.com> <1442835241-26983-3-git-send-email-shuai.ruan@linux.intel.com> <560980E002000078000A64F4@prv-mh.provo.novell.com> <20151009054906.GA10028@shuai.ruan@linux.intel.com> <5617852702000078000A9954@prv-mh.provo.novell.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: <5617852702000078000A9954@prv-mh.provo.novell.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: Jan Beulich Cc: kevin.tian@intel.com, wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, Oct 09, 2015 at 01:13:11AM -0600, Jan Beulich wrote: > >>> On 09.10.15 at 07:49, wrote: > > On Mon, Sep 28, 2015 at 10:03:12AM -0600, Jan Beulich wrote: > >> >>> On 21.09.15 at 13:33, wrote: > >> > @@ -954,8 +975,13 @@ long arch_do_domctl( > >> > v->arch.xcr0_accum = _xcr0_accum; > >> > if ( _xcr0_accum & XSTATE_NONLAZY ) > >> > v->arch.nonlazy_xstate_used = 1; > >> > - memcpy(v->arch.xsave_area, _xsave_area, > >> > - evc->size - 2 * sizeof(uint64_t)); > >> > + if ( (cpu_has_xsaves || cpu_has_xsavec) && > >> > + !xsave_area_compressed(_xsave_area) ) > >> > >> Is it intended to support compact input here? Where would such > >> come from? And if so, don't you need to validate the input (e.g. > >> being a certain size)? > >> > > It is not intended to support compact input here.Just add some check here > > (According to Andrew suggestion). > > I think your reply only refers to the cpu_has_xsavec conditional, > but the question really was about the construct as a whole. > > Jan > There is no such case that input is compact. "!xsave_area_compressed(_xsave_area)" here just add some check to ensure _xsave_area is uncompact. It seem that it cause confusion. If so , I will deletesuch check. Is it Ok ? > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >