Skip to contentSkip to conversation

linux-next: build failure after merge of the bitmap tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Sep 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the bitmap tree, today's linux-next build (powerpc allyesconfig) failed like this:

ld: arch/powerpc/kernel/head_64.o: in function `generic_secondary_common_init':
(.text+0x545e): undefined reference to `nr_cpu_ids'

Caused by commit

c90c5bd9f2d6 ("lib/cpumask: add FORCE_NR_CPUS config option")

This build has CONFIG_FORCE_NR_CPUS set but the (assembler) code expects nr_cpu_ids to be a variable ...

I have reverted that commit for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 8 lines · Stephen Rothwell

Hi all,

After merging the bitmap tree, today's linux-next build (powerpc allyesconfig) failed like this:

ld: arch/powerpc/kernel/head_64.o: in function `generic_secondary_common_init':
(.text+0x545e): undefined reference to `nr_cpu_ids'

Quoted 8 lines

Caused by commit

c90c5bd9f2d6 ("lib/cpumask: add FORCE_NR_CPUS config option")

This build has CONFIG_FORCE_NR_CPUS set but the (assembler) code expects nr_cpu_ids to be a variable ...

I have reverted that commit for today.

Thanks for report, Stephen.

I did PPC build for bitmap-for-next, and it was OK on top of v6-rc4. On today's -next I can reproduce the failure. It's weird because the code in trouble was added at 2011 in 768d18ad6d5e6 ("powerpc: Don't search for paca in freed memory").

Anyways, the fix is straightforward. I updated the bitmap-for-next with it, and will send it for review shortly.
--

arch/powerpc/kernel/head_64.S +4 -0
index cf2c08902c05..7cb97881635e 100644
@@ -400,7 +400,11 @@ generic_secondary_common_init:
 #else
        LOAD_REG_ADDR(r8, paca_ptrs)    /* Load paca_ptrs pointe         */
        ld      r8,0(r8)                /* Get base vaddr of array       */
+#if (NR_CPUS == 1) || defined(CONFIG_FORCE_NR_CPUS)
+       LOAD_REG_IMMEDIATE(r7, NR_CPUS)
+#else
        LOAD_REG_ADDR(r7, nr_cpu_ids)   /* Load nr_cpu_ids address       */
+#endif
        lwz     r7,0(r7)                /* also the max paca allocated   */
        li      r5,0                    /* logical cpu id                */
 1: