* [PATCH] make mach-generic/summit.c compile on UP
@ 2006-10-05 17:16 Jiri Kosina
2006-10-05 20:31 ` keith mannthey
0 siblings, 1 reply; 7+ messages in thread
From: Jiri Kosina @ 2006-10-05 17:16 UTC (permalink / raw)
To: keith mannthey; +Cc: linux-kernel, Linus Torvalds
Hi,
arch/i386/mach-generic/summit.c doesn't compile (neither in current
mainline git tree, nor in 2.6.18-mm3) when CONFIG_SMP is not set:
In file included from arch/i386/mach-generic/summit.c:17:
include/asm/mach-summit/mach_apic.h: In function 'apicid_to_node':
include/asm/mach-summit/mach_apic.h:91: error: 'apicid_2_node' undeclared (first use in this function)
include/asm/mach-summit/mach_apic.h:91: error: (Each undeclared identifier is reported only once
include/asm/mach-summit/mach_apic.h:91: error: for each function it appears in.)
Is the patch below correct?
Signed-off-by: Jiri Kosina <jikos@jikos.cz>
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -88,7 +88,11 @@ static inline void clustered_apic_check(
static inline int apicid_to_node(int logical_apicid)
{
+#ifdef CONFIG_SMP
return apicid_2_node[hard_smp_processor_id()];
+#else
+ return 0;
+#endif
}
/* Mapping from cpu number to logical apicid */
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
--
Jiri Kosina
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-05 17:16 [PATCH] make mach-generic/summit.c compile on UP Jiri Kosina
@ 2006-10-05 20:31 ` keith mannthey
2006-10-05 21:18 ` Jiri Kosina
2006-10-05 23:11 ` Andi Kleen
0 siblings, 2 replies; 7+ messages in thread
From: keith mannthey @ 2006-10-05 20:31 UTC (permalink / raw)
To: Jiri Kosina; +Cc: lkml, Linus Torvalds
On Thu, 2006-10-05 at 19:16 +0200, Jiri Kosina wrote:
> Hi,
>
> arch/i386/mach-generic/summit.c doesn't compile (neither in current
> mainline git tree, nor in 2.6.18-mm3) when CONFIG_SMP is not set:
>
> In file included from arch/i386/mach-generic/summit.c:17:
> include/asm/mach-summit/mach_apic.h: In function 'apicid_to_node':
> include/asm/mach-summit/mach_apic.h:91: error: 'apicid_2_node' undeclared (first use in this function)
> include/asm/mach-summit/mach_apic.h:91: error: (Each undeclared identifier is reported only once
> include/asm/mach-summit/mach_apic.h:91: error: for each function it appears in.)
> Is the patch below correct?
Well I guess it would fix the apicid_2_node build error but I can't
think of a single good reason to be in a config where you would need any
of the summit code in UP. Perhaps a kconfig or makefile change in the
right spot would be better.
Can you send along your config file so I can better understand? I seem
to be able to build i386 UP just fine.
Thanks,
Keith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-05 20:31 ` keith mannthey
@ 2006-10-05 21:18 ` Jiri Kosina
2006-10-05 22:24 ` keith mannthey
2006-10-05 23:11 ` Andi Kleen
1 sibling, 1 reply; 7+ messages in thread
From: Jiri Kosina @ 2006-10-05 21:18 UTC (permalink / raw)
To: keith mannthey; +Cc: lkml
On Thu, 5 Oct 2006, keith mannthey wrote:
> > In file included from arch/i386/mach-generic/summit.c:17:
> > include/asm/mach-summit/mach_apic.h: In function 'apicid_to_node':
> > include/asm/mach-summit/mach_apic.h:91: error: 'apicid_2_node' undeclared (first use in this function)
> > include/asm/mach-summit/mach_apic.h:91: error: (Each undeclared identifier is reported only once
> > include/asm/mach-summit/mach_apic.h:91: error: for each function it appears in.)
> > Is the patch below correct?
> Well I guess it would fix the apicid_2_node build error but I can't
> think of a single good reason to be in a config where you would need any
> of the summit code in UP. Perhaps a kconfig or makefile change in the
> right spot would be better.
Yes, this was in fact a product of a random .config (but allowed by
Kconfig rules). There should definitely be a Kconfig rule not allowing
having this non-working .config settings.
I guess that probably making CONFIG_X86_GENERIC dependent on CONFIG_SMP
would not be good, because the mach-default/ makes sense even on UP, am I
right?
Thanks,
--
Jiri Kosina
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-05 21:18 ` Jiri Kosina
@ 2006-10-05 22:24 ` keith mannthey
2006-10-06 9:11 ` Jiri Kosina
0 siblings, 1 reply; 7+ messages in thread
From: keith mannthey @ 2006-10-05 22:24 UTC (permalink / raw)
To: Jiri Kosina; +Cc: lkml
On Thu, 2006-10-05 at 23:18 +0200, Jiri Kosina wrote:
> On Thu, 5 Oct 2006, keith mannthey wrote:
>
> > > In file included from arch/i386/mach-generic/summit.c:17:
> > > include/asm/mach-summit/mach_apic.h: In function 'apicid_to_node':
> > > include/asm/mach-summit/mach_apic.h:91: error: 'apicid_2_node' undeclared (first use in this function)
> > > include/asm/mach-summit/mach_apic.h:91: error: (Each undeclared identifier is reported only once
> > > include/asm/mach-summit/mach_apic.h:91: error: for each function it appears in.)
> > > Is the patch below correct?
> > Well I guess it would fix the apicid_2_node build error but I can't
> > think of a single good reason to be in a config where you would need any
> > of the summit code in UP. Perhaps a kconfig or makefile change in the
> > right spot would be better.
>
> Yes, this was in fact a product of a random .config (but allowed by
> Kconfig rules). There should definitely be a Kconfig rule not allowing
> having this non-working .config settings.
>
> I guess that probably making CONFIG_X86_GENERIC dependent on CONFIG_SMP
> would not be good, because the mach-default/ makes sense even on UP, am I
> right
Yea I am pretty sure CONFIG_X86_GENERIC is ment to boot UP and SMP
kernels.
Maybe just moving apicid_2_node to a UP safe location would be a good
way to go as well. I overlooked the fact that CONFIG_X86_GENERIC wasn't
always SMP.
Thanks,
Keith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-05 20:31 ` keith mannthey
2006-10-05 21:18 ` Jiri Kosina
@ 2006-10-05 23:11 ` Andi Kleen
1 sibling, 0 replies; 7+ messages in thread
From: Andi Kleen @ 2006-10-05 23:11 UTC (permalink / raw)
To: kmannth; +Cc: lkml, Linus Torvalds
keith mannthey <kmannth@us.ibm.com> writes:
> On Thu, 2006-10-05 at 19:16 +0200, Jiri Kosina wrote:
> > Hi,
> >
> > arch/i386/mach-generic/summit.c doesn't compile (neither in current
> > mainline git tree, nor in 2.6.18-mm3) when CONFIG_SMP is not set:
> >
> > In file included from arch/i386/mach-generic/summit.c:17:
> > include/asm/mach-summit/mach_apic.h: In function 'apicid_to_node':
> > include/asm/mach-summit/mach_apic.h:91: error: 'apicid_2_node' undeclared (first use in this function)
> > include/asm/mach-summit/mach_apic.h:91: error: (Each undeclared identifier is reported only once
> > include/asm/mach-summit/mach_apic.h:91: error: for each function it appears in.)
> > Is the patch below correct?
>
> Well I guess it would fix the apicid_2_node build error but I can't
> think of a single good reason to be in a config where you would need any
> of the summit code in UP.
The reason I allowed it originally was that it would allow UP distribution
boot kernels to find all devices on Summit where you need the special
APIC drivers etc. for that.
But then distributions are mostly switching to SMP kernels by default
anyways so it's a bit obsolete.
-Andi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-05 22:24 ` keith mannthey
@ 2006-10-06 9:11 ` Jiri Kosina
2006-10-06 17:23 ` keith mannthey
0 siblings, 1 reply; 7+ messages in thread
From: Jiri Kosina @ 2006-10-06 9:11 UTC (permalink / raw)
To: keith mannthey; +Cc: lkml, Andrew Morton, Linus Torvalds
On Thu, 5 Oct 2006, keith mannthey wrote:
> Yea I am pretty sure CONFIG_X86_GENERIC is ment to boot UP and SMP
> kernels.
> Maybe just moving apicid_2_node to a UP safe location would be a good
> way to go as well. I overlooked the fact that CONFIG_X86_GENERIC wasn't
> always SMP.
Below is the patch doing exactly this. Fixes compilation of Linus' git
tree, applicable also to -mm. Please apply.
[PATCH] make kernels with CONFIG_X86_GENERIC and !CONFIG_SMP compilable
CONFIG_X86_GENERIC is not exclusively CONFIG_SMP, as mach-default/ could
be compiled also for UP archs. The patch fixes compilation error in
include/asm/mach-summit/mach_apic.h in case CONFIG_X86_GENERIC && !CONFIG_SMP
Signed-off-by: Jiri Kosina <jikos@jikos.cz>
include/asm-i386/smp.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -46,8 +46,6 @@ extern u8 x86_cpu_to_apicid[];
#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
-extern u8 apicid_2_node[];
-
#ifdef CONFIG_HOTPLUG_CPU
extern void cpu_exit_clear(void);
extern void cpu_uninit(void);
@@ -101,6 +99,9 @@ #define NO_PROC_ID 0xFF /* No processo
#endif
#ifndef __ASSEMBLY__
+
+extern u8 apicid_2_node[];
+
#ifdef CONFIG_X86_LOCAL_APIC
static __inline int logical_smp_processor_id(void)
{
--
Jiri Kosina
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] make mach-generic/summit.c compile on UP
2006-10-06 9:11 ` Jiri Kosina
@ 2006-10-06 17:23 ` keith mannthey
0 siblings, 0 replies; 7+ messages in thread
From: keith mannthey @ 2006-10-06 17:23 UTC (permalink / raw)
To: Jiri Kosina; +Cc: lkml, Andrew Morton, Linus Torvalds
On Fri, 2006-10-06 at 11:11 +0200, Jiri Kosina wrote:
> On Thu, 5 Oct 2006, keith mannthey wrote:
>
> > Yea I am pretty sure CONFIG_X86_GENERIC is ment to boot UP and SMP
> > kernels.
> > Maybe just moving apicid_2_node to a UP safe location would be a good
> > way to go as well. I overlooked the fact that CONFIG_X86_GENERIC wasn't
> > always SMP.
>
> Below is the patch doing exactly this. Fixes compilation of Linus' git
> tree, applicable also to -mm. Please apply.
>
> [PATCH] make kernels with CONFIG_X86_GENERIC and !CONFIG_SMP compilable
>
> CONFIG_X86_GENERIC is not exclusively CONFIG_SMP, as mach-default/ could
> be compiled also for UP archs. The patch fixes compilation error in
> include/asm/mach-summit/mach_apic.h in case CONFIG_X86_GENERIC && !CONFIG_SMP
>
> Signed-off-by: Jiri Kosina <jikos@jikos.cz>
>
> include/asm-i386/smp.h | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> --- a/include/asm-i386/smp.h
> +++ b/include/asm-i386/smp.h
> @@ -46,8 +46,6 @@ extern u8 x86_cpu_to_apicid[];
>
> #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
>
> -extern u8 apicid_2_node[];
> -
> #ifdef CONFIG_HOTPLUG_CPU
> extern void cpu_exit_clear(void);
> extern void cpu_uninit(void);
> @@ -101,6 +99,9 @@ #define NO_PROC_ID 0xFF /* No processo
> #endif
>
> #ifndef __ASSEMBLY__
> +
> +extern u8 apicid_2_node[];
> +
> #ifdef CONFIG_X86_LOCAL_APIC
> static __inline int logical_smp_processor_id(void)
> {
Look good to me. Thanks for fixing this.
Acked-by: Keith Mannthey <kmannth@us.ibm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-10-06 17:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 17:16 [PATCH] make mach-generic/summit.c compile on UP Jiri Kosina
2006-10-05 20:31 ` keith mannthey
2006-10-05 21:18 ` Jiri Kosina
2006-10-05 22:24 ` keith mannthey
2006-10-06 9:11 ` Jiri Kosina
2006-10-06 17:23 ` keith mannthey
2006-10-05 23:11 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox