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

Re: [Xen-devel] [PATCH v4 06/11] x86/intel_pstate: APERF/MPERF feature detect



>>> On 25.06.15 at 13:16, <wei.w.wang@xxxxxxxxx> wrote:
> Add support to detect the APERF/MPERF feature. Also, remove the identical
> code in cpufreq.c and powernow.c.
> 
> v4 changes:
> 1) this is a new consolidated patch dealing with the APERF/MPERF feature
> detection.
> 
> Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxx>

I would have taken this right away, if only it had been at the
beginning of the series (or stated that it's independent of the
earlier patches) and, more importantly, ...

> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -238,6 +238,9 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 
> *c)
>       if ( cpu_has(c, X86_FEATURE_CLFLSH) )
>               c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
>  
> +     if (cpuid_ecx(6) & 0x1)
> +             set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);

... if you hadn't used this plain 0x1 here when _both_ of the old
code pieces nicely used CPUID_6_ECX_APERFMPERF_CAPABILITY.
Bonus points for also giving a sensible name to leaf 6 and naming
its other bits code in the tree already uses (see CPUID_MWAIT_LEAF).

And of course you should check ->cpuid_level first.

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