Skip to contentSkip to conversation

Fix build failure x86_default_fixup_cpu_id() with !CONFIG_SMP

PATCH In review Kamalesh Babulal 3 participants 4 messages Dec 6, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build failure x86_default_fixup_cpu_id() with !CONFIG_SMP

Hi,

tip (a4a7e7e29333) build fails, when compiled with !CONFIG_SMP. I have only build tested the patch.

x86: Fix x86_default_fixup_cpu_id() build failure with !CONFIG_SMP

arch/x86/kernel/cpu/common.c: In function 'x86_default_fixup_cpu_id':
arch/x86/kernel/cpu/common.c:1149: error: 'struct cpuinfo_x86' has no member named 'phys_proc_id' make[3]: *** [arch/x86/kernel/cpu/common.o] Error 1

the code was introduced by commit 64be4c1c24. This patch introduced #ifdef to guard !SMP case.

--

 arch/x86/kernel/cpu/common.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/common.c +2 -0
index ad4da45..1154528 100644
@@ -1146,7 +1146,9 @@ static void dbg_restore_debug_regs(void)
  */
 void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node)
 {
+#ifdef CONFIG_SMP
 	pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id);
+#endif
 }
 
 /*
#1 lore raw

Hi Kamalesh,

Quoted 11 lines · Kamalesh Babulal

Hi,

tip (a4a7e7e29333) build fails, when compiled with !CONFIG_SMP. I have only build tested the patch.

x86: Fix x86_default_fixup_cpu_id() build failure with !CONFIG_SMP

arch/x86/kernel/cpu/common.c: In function 'x86_default_fixup_cpu_id':
arch/x86/kernel/cpu/common.c:1149: error: 'struct cpuinfo_x86' has no member named 'phys_proc_id' make[3]: *** [arch/x86/kernel/cpu/common.o] Error 1

Quoted 5 lines

the code was introduced by commit 64be4c1c24. This patch introduced #ifdef to guard !SMP case.

----

There was a similar build-fix patch by Steffen Persvold at:
https://lkml.org/lkml/2011/12/6/28

That would solve your case too, right?

Regards,
Srivatsa S. Bhat

#2 lore raw
Quoted 18 lines · Srivatsa S. Bhat

Hi Kamalesh,

Quoted 14 lines · Kamalesh Babulal

Hi,

tip (a4a7e7e29333) build fails, when compiled with !CONFIG_SMP. I have only build tested the patch.

x86: Fix x86_default_fixup_cpu_id() build failure with !CONFIG_SMP

arch/x86/kernel/cpu/common.c: In function 'x86_default_fixup_cpu_id':
arch/x86/kernel/cpu/common.c:1149: error: 'struct cpuinfo_x86' has no member named 'phys_proc_id' make[3]: *** [arch/x86/kernel/cpu/common.o] Error 1

the code was introduced by commit 64be4c1c24. This patch introduced #ifdef to guard !SMP case.

Quoted 9 lines
Quoted 2 lines

----

There was a similar build-fix patch by Steffen Persvold at:
https://lkml.org/lkml/2011/12/6/28

That would solve your case too, right?

I would hope so (I tested with !CONFIG_SMP also), albeit I used :

#ifdef CONFIG_NUMA

and not

#ifdef CONFIG_SMP

but I don't think you can compile with CONFIG_NUMA without having CONFIG_SMP (if I read the Kconfig correctly..).

I used CONFIG_NUMA because the code-path doesn't really make sense on non-numa nodes.

Cheers,

Signature · 3 lines
Steffen Persvold, Chief Architect NumaChip
Numascale AS - www.numascale.com
Tel: +47 92 49 25 54 Skype: spersvold
#3 lore raw
Quoted 23 lines · Steffen Persvold
Quoted 22 lines · Srivatsa S. Bhat

Hi Kamalesh,

Quoted 16 lines · Kamalesh Babulal

Hi,

tip (a4a7e7e29333) build fails, when compiled with !CONFIG_SMP. I have only build tested the patch.

x86: Fix x86_default_fixup_cpu_id() build failure with !CONFIG_SMP

arch/x86/kernel/cpu/common.c: In function 'x86_default_fixup_cpu_id':
arch/x86/kernel/cpu/common.c:1149: error: 'struct cpuinfo_x86' has no member named 'phys_proc_id' make[3]: *** [arch/x86/kernel/cpu/common.o] Error 1

the code was introduced by commit 64be4c1c24. This patch introduced #ifdef to guard !SMP case.

----

Quoted 5 lines
Quoted 5 lines

There was a similar build-fix patch by Steffen Persvold at:
https://lkml.org/lkml/2011/12/6/28

That would solve your case too, right?

Thanks for pointing out the patch.

Quoted 7 lines

I would hope so (I tested with !CONFIG_SMP also), albeit I used :

#ifdef CONFIG_NUMA

and not

Quoted 8 lines

#ifdef CONFIG_SMP

but I don't think you can compile with CONFIG_NUMA without having CONFIG_SMP (if I read the Kconfig correctly..).

I used CONFIG_NUMA because the code-path doesn't really make sense on non-numa nodes.

agree, cpuinfo_x86->phys_proc_id is protected within CONFIG_SMP but the right way is to fix using CONFIG_NUMA as explained by you in
https://lkml.org/lkml/2011/12/6/28.

Regards,
Kamalesh.