Re: Voyager phys_cpu_present_map compile error

From: James Bottomley
Date: Fri Apr 25 2008 - 10:50:58 EST


On Mon, 2008-04-21 at 22:14 +0200, Ingo Molnar wrote:
> * Adrian Bunk <bunk@xxxxxxxxxx> wrote:
>
> > > +#ifndef CONFIG_X86_VOYAGER
> > > /* Bitmask of physically existing CPUs */
> > > physid_mask_t phys_cpu_present_map;
> > > +#endif
> > >...
> >
> > Alexey noted that phys_cpu_present_map for Voyager and !Voyager also
> > have different types and suggested to make the Voyager one static
> > instead (additional renaming of the Voyager one also makes sense).
>
> yep, done by the patch below.

Actually, this isn't the right patch. The point is not to avoid the
symbol clash, it's to let voyager identify correctly that you have a
leaking symbol. In this case phys_cpu_present_map is exposed outside of
SMP. The correct fix (and one which sweeps op other storage for
unnecessary symbols is this):

James

---

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index c0c68c1..d68aa53 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -12,6 +12,7 @@
#include <asm/mpspec.h>
#include <asm/apicdef.h>

+#ifdef CONIFG_X86_SMP
unsigned int num_processors;
unsigned disabled_cpus __cpuinitdata;
/* Processor that is doing the boot up */
@@ -23,8 +24,9 @@ EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);

/* Bitmask of physically existing CPUs */
physid_mask_t phys_cpu_present_map;
+#endif

-#if defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) && defined(CONFIG_SMP)
+#if defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) && defined(CONFIG_X86_SMP)
/*
* Copy data used in early init routines from the initial arrays to the
* per cpu data areas. These arrays then become expendable and the


--
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/