[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220822021520.6996-3-kernelfans@gmail.com>
Date: Mon, 22 Aug 2022 10:15:12 +0800
From: Pingfan Liu <kernelfans@...il.com>
To: linux-arm-kernel@...ts.infradead.org, linux-ia64@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Pingfan Liu <kernelfans@...il.com>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Peter Zijlstra <peterz@...radead.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Mark Rutland <mark.rutland@....com>,
Marco Elver <elver@...gle.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Dan Li <ashimida@...ux.alibaba.com>,
Song Liu <song@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
Linus Walleij <linus.walleij@...aro.org>,
Ard Biesheuvel <ardb@...nel.org>,
Tony Lindgren <tony@...mide.com>,
Nick Hawkins <nick.hawkins@....com>,
John Crispin <john@...ozen.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Anshuman Khandual <anshuman.khandual@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Steven Price <steven.price@....com>
Subject: [RFC 02/10] cpu/hotplug: Compile smp_shutdown_nonboot_cpus() conditioned on CONFIG_SHUTDOWN_NONBOOT_CPUS
Only arm/arm64/ia64/riscv share the smp_shutdown_nonboot_cpus(). So
compiling this code conditioned on the macro
CONFIG_SHUTDOWN_NONBOOT_CPUS. Later this macro will brace the quick
kexec reboot code.
Signed-off-by: Pingfan Liu <kernelfans@...il.com>
Cc: Russell King <linux@...linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Will Deacon <will@...nel.org>
Cc: Paul Walmsley <paul.walmsley@...ive.com>
Cc: Palmer Dabbelt <palmer@...belt.com>
Cc: Albert Ou <aou@...s.berkeley.edu>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Marco Elver <elver@...gle.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Dan Li <ashimida@...ux.alibaba.com>
Cc: Song Liu <song@...nel.org>
Cc: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Linus Walleij <linus.walleij@...aro.org>
Cc: Ard Biesheuvel <ardb@...nel.org>
Cc: Tony Lindgren <tony@...mide.com>
Cc: Nick Hawkins <nick.hawkins@....com>
Cc: John Crispin <john@...ozen.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Anshuman Khandual <anshuman.khandual@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Steven Price <steven.price@....com>
To: linux-arm-kernel@...ts.infradead.org
To: linux-ia64@...r.kernel.org
To: linux-riscv@...ts.infradead.org
To: linux-kernel@...r.kernel.org
---
arch/Kconfig | 4 ++++
arch/arm/Kconfig | 1 +
arch/arm64/Kconfig | 1 +
arch/ia64/Kconfig | 1 +
arch/riscv/Kconfig | 1 +
kernel/cpu.c | 3 +++
6 files changed, 11 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index f330410da63a..be447537d0f6 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -14,6 +14,10 @@ menu "General architecture-dependent options"
config CRASH_CORE
bool
+config SHUTDOWN_NONBOOT_CPUS
+ select KEXEC_CORE
+ bool
+
config KEXEC_CORE
select CRASH_CORE
bool
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 87badeae3181..711cfdb4f9f4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -129,6 +129,7 @@ config ARM
select PCI_SYSCALL if PCI
select PERF_USE_VMALLOC
select RTC_LIB
+ select SHUTDOWN_NONBOOT_CPUS
select SYS_SUPPORTS_APM_EMULATION
select THREAD_INFO_IN_TASK
select HAVE_ARCH_VMAP_STACK if MMU && ARM_HAS_GROUP_RELOCS
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 571cc234d0b3..8c481a0b1829 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -223,6 +223,7 @@ config ARM64
select PCI_SYSCALL if PCI
select POWER_RESET
select POWER_SUPPLY
+ select SHUTDOWN_NONBOOT_CPUS
select SPARSE_IRQ
select SWIOTLB
select SYSCTL_EXCEPTION_TRACE
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 26ac8ea15a9e..8a3ddea97d1b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -52,6 +52,7 @@ config IA64
select ARCH_CLOCKSOURCE_DATA
select GENERIC_TIME_VSYSCALL
select LEGACY_TIMER_TICK
+ select SHUTDOWN_NONBOOT_CPUS
select SWIOTLB
select SYSCTL_ARCH_UNALIGN_NO_WARN
select HAVE_MOD_ARCH_SPECIFIC
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index ed66c31e4655..02606a48c5ea 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -120,6 +120,7 @@ config RISCV
select PCI_MSI if PCI
select RISCV_INTC
select RISCV_TIMER if RISCV_SBI
+ select SHUTDOWN_NONBOOT_CPUS
select SPARSE_IRQ
select SYSCTL_EXCEPTION_TRACE
select THREAD_INFO_IN_TASK
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 338e1d426c7e..2be6ba811a01 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1258,6 +1258,8 @@ int remove_cpu(unsigned int cpu)
}
EXPORT_SYMBOL_GPL(remove_cpu);
+#ifdef CONFIG_SHUTDOWN_NONBOOT_CPUS
+
void smp_shutdown_nonboot_cpus(unsigned int primary_cpu)
{
unsigned int cpu;
@@ -1299,6 +1301,7 @@ void smp_shutdown_nonboot_cpus(unsigned int primary_cpu)
cpu_maps_update_done();
}
+#endif
#else
#define takedown_cpu NULL
--
2.31.1
Powered by blists - more mailing lists