From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH 2/2] x86: Don't use BAD_APICID for non-APICID fields Date: Tue, 24 Mar 2015 09:50:56 -0400 Message-ID: <55116BC0.3030401@oracle.com> References: <1427140475-32133-1-git-send-email-boris.ostrovsky@oracle.com> <1427140475-32133-3-git-send-email-boris.ostrovsky@oracle.com> <55112966020000780006CD76@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55112966020000780006CD76@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: 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 03/24/2015 04:07 AM, Jan Beulich wrote: >>>> 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? I did want to use XEN_* macros but then I realized that I need a new #define for cpuinfo_x86.compute_unit_id as well. This #define does not need to be public so for consistency I thought that having hypervisor-internal INVALID_* macros would be better. -boris