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

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



>>> On 21.12.15 at 02:50, <shuai.ruan@xxxxxxxxxxxxxxx> wrote:
> Refer to SDM 13.4.3. The value return by ecx[1] with cpuid

I think we've clarified before that SDM references should be by
section title, not section number.

> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -285,6 +285,7 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
>  #define XSAVEC          (1 << 1)
>  #define XGETBV1         (1 << 2)
>  #define XSAVES          (1 << 3)
> +#define XSTATE_ALIGN    (1 << 1)

XSTATE_ALIGN64? (There might well be another, higher aligment
flag in the future.)

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4619,7 +4619,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 & 0x2)

Needs a #define just like in libxc.

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®.