Skip to contentSkip to conversation

RISC-V: Add preprocessor directives for boot_sec_cpu

PATCH In review Zong Li 3 participants 3 messages Aug 2, 2018 – Aug 3, 2018 RISC-V

lore
Share & tools
lore

Zong Li

author
#0 lore raw

PATCH 1/1 RISC-V: Add preprocessor directives for boot_sec_cpu

The boot_sec_cpu is for hutplug CPU on SMP system. It should be conditional compiling. Otherwise, it causes undefined reference to `smp_callin' when compiling uniprocessor kernel.

---
 arch/riscv/kernel/head.S | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/kernel/head.S +2 -0
index 11066d5..9b6f601 100644
@@ -154,6 +154,7 @@ END(_start)
 .section .text
 .global boot_sec_cpu
 
+#ifdef CONFIG_HOTPLUG_CPU
 boot_sec_cpu:
 	/* clear all pending flags */
 	csrw sip, zero
@@ -162,6 +163,7 @@ boot_sec_cpu:
 	fence
 
 	tail smp_callin
+#endif
 
 __PAGE_ALIGNED_BSS
 	/* Empty zero page */
Signature · 1 line
2.7.4
#1 lore raw
Quoted 23 lines · Zong Li

The boot_sec_cpu is for hutplug CPU on SMP system. It should be conditional compiling. Otherwise, it causes undefined reference to `smp_callin' when compiling uniprocessor kernel.

---
  arch/riscv/kernel/head.S | 2 ++
  1 file changed, 2 insertions(+)
arch/riscv/kernel/head.S +1 -0
index 11066d5..9b6f601 100644
@@ -154,6 +154,7 @@ END(_start)
  .section .text
  .global boot_sec_cpu
 
+#ifdef CONFIG_HOTPLUG_CPU
  boot_sec_cpu:
  	/* clear all pending flags */
  	csrw sip, zero

arch/riscv/kernel/head.S boot_sec_cpu: · line 169

Quoted 7 lines
arch/riscv/kernel/head.S +1 -0
@@ -162,6 +163,7 @@ boot_sec_cpu:
  	fence
 
  	tail smp_callin
+#endif
 
  __PAGE_ALIGNED_BSS
  	/* Empty zero page */

Thanks for the fix. If you don't mind, I would like to merge it on top of my cpu hotplug patch and resubmit together to avoid confusion.

Regards,
Atish

#2 lore raw

Atish Patra <[email protected]> ? 2018?8?3? ?? ??2:14???

Quoted 29 lines · Zong Li
Quoted 27 lines

The boot_sec_cpu is for hutplug CPU on SMP system. It should be conditional compiling. Otherwise, it causes undefined reference to `smp_callin' when compiling uniprocessor kernel.

---
  arch/riscv/kernel/head.S | 2 ++
  1 file changed, 2 insertions(+)
arch/riscv/kernel/head.S +2 -0
index 11066d5..9b6f601 100644
@@ -154,6 +154,7 @@ END(_start)
  .section .text
  .global boot_sec_cpu
 
+#ifdef CONFIG_HOTPLUG_CPU
  boot_sec_cpu:
      /* clear all pending flags */
      csrw sip, zero
@@ -162,6 +163,7 @@ boot_sec_cpu:
      fence
 
      tail smp_callin
+#endif
 
Quoted 7 lines

arch/riscv/kernel/head.S boot_sec_cpu: · line 169

Quoted 3 lines
arch/riscv/kernel/head.S +0 -0
  __PAGE_ALIGNED_BSS
      /* Empty zero page */

Thanks for the fix. If you don't mind, I would like to merge it on top of my cpu hotplug patch and resubmit together to avoid confusion.

OK, just take it:)