Re: [PATCH 04/16] x86: Replace cpu_2_logical_apicid[] with earlypercpu variable

From: Yinghai Lu
Date: Mon Jan 24 2011 - 14:58:29 EST


On Sun, Jan 23, 2011 at 5:37 AM, Tejun Heo <tj@xxxxxxxxxx> wrote:
> Unlike x86_64, on x86_32, the mapping from cpu to logical apicid may
> vary depending on apic in use.  cpu_2_logical_apicid[] array is used
> for this mapping.  Replace it with early percpu variable
> x86_cpu_to_logical_apicid to make it better aligned with other
> mappings.
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> ---
>  arch/x86/include/asm/apic.h      |    4 ----
>  arch/x86/include/asm/smp.h       |    3 +++
>  arch/x86/kernel/apic/apic.c      |   11 +++++++++++
>  arch/x86/kernel/apic/es7000_32.c |    2 +-
>  arch/x86/kernel/apic/numaq_32.c  |    2 +-
>  arch/x86/kernel/apic/summit_32.c |    4 ++--
>  arch/x86/kernel/setup_percpu.c   |    7 +++++++
>  arch/x86/kernel/smpboot.c        |    7 ++-----
>  8 files changed, 27 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 5e3969c..eb139ec 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -595,8 +595,4 @@ extern int default_check_phys_apicid_present(int phys_apicid);
>
>  #endif /* CONFIG_X86_LOCAL_APIC */
>
> -#ifdef CONFIG_X86_32
> -extern u8 cpu_2_logical_apicid[NR_CPUS];
> -#endif
> -
>  #endif /* _ASM_X86_APIC_H */
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index 4c2f63c..dc7c46a 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -38,6 +38,9 @@ static inline struct cpumask *cpu_core_mask(int cpu)
>
>  DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid);
>  DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
> +#if defined(CONFIG_SMP) && defined(CONFIG_X86_32)
> +DECLARE_EARLY_PER_CPU(int, x86_cpu_to_logical_apicid);
> +#endif

why changing it from u8 to int?

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/