From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v4 03/14] ARM: Factor out cpuid implementor and part number Date: Fri, 30 Nov 2012 10:21:59 +0000 Message-ID: <20121130102159.GA26305@mudshark.cambridge.arm.com> References: <20121110154203.2836.46686.stgit@chazy-air> <20121110154231.2836.24377.stgit@chazy-air> <20121119142126.GV3205@mudshark.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marcelo Tosatti To: Christoffer Dall Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:48137 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932610Ab2K3KW3 (ORCPT ); Fri, 30 Nov 2012 05:22:29 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 29, 2012 at 09:38:46PM +0000, Christoffer Dall wrote: > On Mon, Nov 19, 2012 at 9:21 AM, Will Deacon wrote: > > On Sat, Nov 10, 2012 at 03:42:31PM +0000, Christoffer Dall wrote: > >> Decoding the implementor and part number of the CPU id in the CPU ID > >> register is needed by KVM, so we factor it out to share the code. > >> > >> Reviewed-by: Marcelo Tosatti > >> Signed-off-by: Christoffer Dall [...] > >> +static inline unsigned int __attribute_const__ read_cpuid_implementor(void) > >> +{ > >> + return (read_cpuid_id() & 0xFF000000) >> 24; > >> +} > >> + > >> +static inline unsigned int __attribute_const__ read_cpuid_part_number(void) > >> +{ > >> + return (read_cpuid_id() & 0xFFF0); > >> +} > > > > Perhaps this should take the implementor as an argument, given that the > > part number is described differently between implementors. The xscale > > stuff can then move in here (we'll need to check the xscale docs in case > > perf is using a subfield -- I can't remember off-hand). [...] > > If you stick this one in a separate patch, I can take it via the perf > > tree (along with the CPUID rework above). > > > thanks, > I sent a separate patch. Looks like we still have the ugly xscale cpuid parsing inline. Could you move it as I suggested, please? Will