From: "Jan Beulich" Subject: Re: [PATCH v4 06/11] x86/intel_pstate: APERF/MPERF feature detect Date: Thu, 25 Jun 2015 12:46:03 +0100 Message-ID: <558C061B0200007800089914@mail.emea.novell.com> References: <1435230990-22473-1-git-send-email-wei.w.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435230990-22473-1-git-send-email-wei.w.wang@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Wang Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 25.06.15 at 13:16, 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 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