[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [V5 2/4] x86/xsaves: enable xsaves/xrstors/xsavec in xen
>>> On 09.10.15 at 10:14, <shuai.ruan@xxxxxxxxxxxxxxx> wrote: > On Fri, Oct 09, 2015 at 01:13:11AM -0600, Jan Beulich wrote: >> >>> On 09.10.15 at 07:49, <shuai.ruan@xxxxxxxxxxxxxxx> wrote: >> > On Mon, Sep 28, 2015 at 10:03:12AM -0600, Jan Beulich wrote: >> >> >>> On 21.09.15 at 13:33, <shuai.ruan@xxxxxxxxxxxxxxx> 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. >> > 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. How is there not? The if() above has an else branch, so you're taking care of both cases. > It seem that it cause confusion. If so , I will > deletesuch check. Is it Ok ? That depends on why Andrew had asked for it. If the input can't be compressed, check it's not and bail otherwise, instead of giving the impression of handling the case. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |