From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: always store APIC ID of CPU Date: Thu, 26 Jun 2014 13:41:29 +0100 Message-ID: <53AC14F9.2010106@citrix.com> References: <53AC0E06020000780001D873@mail.emea.novell.com> <53ABFDB3.1060204@citrix.com> <53AC2079020000780001D9A7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X08zd-0005A7-P1 for xen-devel@lists.xenproject.org; Thu, 26 Jun 2014 12:41:33 +0000 In-Reply-To: <53AC2079020000780001D9A7@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 26/06/14 12:30, Jan Beulich wrote: >>>> On 26.06.14 at 13:02, wrote: >> On 26/06/14 11:11, Jan Beulich wrote: >>> +/* >>> + * cpuid returns the value latched in the HW at reset, not the APIC ID >>> + * register's value. For any box whose BIOS changes APIC IDs, like >>> + * clustered APIC systems, we must use hard_smp_processor_id. >>> + * >>> + * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID. >>> + */ >>> +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) >> What is the point of the cpuid_apic parameter? It is unused. >> >> index_msb should probably be unsigned as it is used to shift with. > For both of these - yes, I agree, but no, I don't want to change > this here (I'm just moving the function up after all). The history of > this is a bit difficult to interpret: Before in change in 2006 some > variants of this function used both inputs, but some didn't. I > suppose Keir didn't want to risk breaking clustered APIC systems, > albeit as far as I looked only Summit systems were actually ignoring > the passed in APIC ID, and we're not supporting these anymore. > > As to shift counts, I don't think it really matters whether they're > signed or unsigned, as anything outside the range [0,bitwidth-1] > produce undefined operations anyway. > > Jan > Fair enough. Reviewed-by: Andrew Cooper