[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/3] x86/xsaves: ebx may return wrong value using CPUID eax=0xdh, ecx =1



>>> On 24.02.16 at 06:42, <shuai.ruan@xxxxxxxxxxxxxxx> wrote:
> On Mon, Feb 22, 2016 at 10:18:42AM -0700, Jan Beulich wrote:
>> > @@ -4703,7 +4703,19 @@ void hvm_cpuid(unsigned int input, unsigned int 
>> > *eax, 
> unsigned int *ebx,
>> >                      for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
>> >                          if ( (v->arch.xcr0 | v->arch.hvm_vcpu.msr_xss) &
>> >                               (1ULL << sub_leaf) )
>> > +                        {
>> > +                            domain_cpuid(d, input, sub_leaf, &_eax, &_ebx,
>> > +                                         &_ecx, &_edx);
>> > +                            /*
>> > +                             * The value return by _ecx[1] indicates the
>> > +                             * alignment of the state component i when the
>> > +                             * compacted format of the extended region of
>> > +                             *  an xsave area is used.
>> > +                             */
>> > +                            if (_ecx & XSTATE_ALIGN64)
>> > +                                *ebx = ROUNDUP(*ebx, 64);
>> >                              *ebx += xstate_sizes[sub_leaf];
>> > +                  }
>> >              }
>> 
>> Besides the various coding style issues I wonder how you get
>> away without any similar adjustment to pv_cpuid().
> Current pv does not support xsaves , and ebx return by CPUID (eax= 0xd,
> ecx =1 ) is depend on xcr0 | msr_xss. msr_xss is only support in hvm.

My reading of the manual didn't result in such a connection. Mind
pointing out where this is being stated? (From an abstract
perspective I also can't see why the alignment flag would be tied
to XSAVES.)

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.