[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] x86: Don't use BAD_APICID for non-APICID fields



>>> On 23.03.15 at 20:54, <boris.ostrovsky@xxxxxxxxxx> 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 <boris.ostrovsky@xxxxxxxxxx>
> Reported-by: Julien Grall <julien.grall@xxxxxxxxxx>
> ---
> 
> 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 <asm/mpspec.h>
>  #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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.