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

Re: [Xen-devel] [PATCH v7 05/19] intel/VPMU: Clean up Intel VPMU code



>>> On 06.06.14 at 20:34, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 06/06/14 18:40, Boris Ostrovsky wrote:
>> -static int arch_pmc_cnt;
>> +    eax = cpuid_eax(0xa);
>> +    return ( (eax & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT );
>> +}
> 
> This (and later) can be made much simpler.  The style guidelines easily
> permit:
> 
> static int core2_get_arch_pmc_count(void)
> {
>     return (cpuid_eax(0xa) & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT;
> }

The above can be further simplified using MASK_EXTR(), at once
eliminating the need for *_SHIFT constants. 

> Unrelated to this code itself, I wonder whether Xen should gain some
> mnemonics for cpuid leaves.

We already have XSTATE_CPUID, so it would indeed seem desirable
to name 0xa too.

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