From: "Jan Beulich" Subject: Re: [PATCH 2/2] x86: Don't use BAD_APICID for non-APICID fields Date: Tue, 24 Mar 2015 08:07:50 +0000 Message-ID: <55112966020000780006CD76@mail.emea.novell.com> References: <1427140475-32133-1-git-send-email-boris.ostrovsky@oracle.com> <1427140475-32133-3-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427140475-32133-3-git-send-email-boris.ostrovsky@oracle.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: Boris Ostrovsky Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, julien.grall@linaro.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 23.03.15 at 20:54, wrote: > BAD_APICID is used by cpuinfo_x86's phys_proc_id, cpu_core_id > and compute_unit_id even though these fields don't hold an APIC ID > itself but rather its derivative. > > Provide appropriate macros for each of those three (and make them > unsigned). > > This also fixes regression introduced by commit 2090f14c5cbd ("sysctl: > make XEN_SYSCTL_topologyinfo sysctl a little more efficient") which > leaked BAD_APICID into common code, breaking ARM. > > Signed-off-by: Boris Ostrovsky > Reported-by: Julien Grall > --- > > I left sysctl with > > cputopo.core = cpu_to_core(i); > if ( cputopo.core == INVALID_COREID ) > cputopo.core = XEN_INVALID_CORE_ID; > cputopo.socket = cpu_to_socket(i); > if ( cputopo.socket == INVALID_SOCKETID ) > cputopo.socket = XEN_INVALID_SOCKET_ID; > > since this is the only place that would use suggested inlines for external > (public) calls. But again - why did you not avoid the new #defines and use the XEN_-prefixed ones right away? > --- a/xen/include/asm-x86/smp.h > +++ b/xen/include/asm-x86/smp.h > @@ -16,7 +16,8 @@ > #include > #endif > > -#define BAD_APICID -1U > +#define BAD_APICID -1U > +#define INVALID_CUID (~0U) /* AMD Compute Unit ID */ Touching the BAD_APICID line should have resulted in also adding parentheses there. Jan