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

Re: [Xen-devel] [PATCH 02/27] x86/cpuid: Introduce guest_cpuid() and struct cpuid_leaf



>>> On 04.01.17 at 15:47, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 04/01/17 14:01, Jan Beulich wrote:
>>> @@ -4502,15 +4502,15 @@ x86_emulate(
>>>  
>>>          case 0xfc: /* clzero */
>>>          {
>>> -            unsigned int eax = 1, ebx = 0, dummy = 0;
>>> +            struct cpuid_leaf res;
>> Please put a single instance of this at the top of the body of the giant
>> switch() statement (likely calling for it to be named other than "res").
> 
> struct cpuid_leaf cpuid_leaf?
> 
> I can't think of anything clearer.

Fine with me.

>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.h
>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.h
>>> @@ -164,6 +164,11 @@ enum x86_emulate_fpu_type {
>>>      X86EMUL_FPU_ymm  /* AVX/XOP instruction set (%ymm0-%ymm7/15) */
>>>  };
>>>  
>>> +struct cpuid_leaf
>>> +{
>>> +    uint32_t a, b, c, d;
>> Could you please consistently use uint32_t or unsigned int between
>> here and ...
>>
>>> @@ -415,10 +420,9 @@ struct x86_emulate_ops
>>>       * #GP[0].  Used to implement CPUID faulting.
>>>       */
>>>      int (*cpuid)(
>>> -        unsigned int *eax,
>>> -        unsigned int *ebx,
>>> -        unsigned int *ecx,
>>> -        unsigned int *edx,
>>> +        unsigned int leaf,
>>> +        unsigned int subleaf,
>>> +        struct cpuid_leaf *res,
>> ... here? I have no particular preference which of the two to use.
> 
> Will use uint32_t.

Having gone a little farther through the series, that's the option
which would apparently incur the higher amount of follow-on
changes.

Jan


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

 


Rackspace

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