Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9327e2c6 authored by Mark Rutland's avatar Mark Rutland Committed by Catalin Marinas
Browse files

arm64: add CPU_HOTPLUG infrastructure



This patch adds the basic infrastructure necessary to support
CPU_HOTPLUG on arm64, based on the arm implementation. Actual hotplug
support will depend on an implementation's cpu_operations (e.g. PSCI).

Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent e8765b26
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -161,6 +161,13 @@ config NR_CPUS
	default "8" if ARCH_XGENE
	default "4"

config HOTPLUG_CPU
	bool "Support for hot-pluggable CPUs"
	depends on SMP
	help
	  Say Y here to experiment with turning CPUs off and on.  CPUs
	  can be controlled through /sys/devices/system/cpu.

source kernel/Kconfig.preempt

config HZ
+9 −0
Original line number Diff line number Diff line
@@ -34,6 +34,11 @@ struct device_node;
 * @cpu_boot:	Boots a cpu into the kernel.
 * @cpu_postboot: Optionally, perform any post-boot cleanup or necesary
 *		synchronisation. Called from the cpu being booted.
 * @cpu_disable: Prepares a cpu to die. May fail for some mechanism-specific
 * 		reason, which will cause the hot unplug to be aborted. Called
 * 		from the cpu to be killed.
 * @cpu_die:	Makes a cpu leave the kernel. Must not fail. Called from the
 *		cpu being killed.
 */
struct cpu_operations {
	const char	*name;
@@ -41,6 +46,10 @@ struct cpu_operations {
	int		(*cpu_prepare)(unsigned int);
	int		(*cpu_boot)(unsigned int);
	void		(*cpu_postboot)(void);
#ifdef CONFIG_HOTPLUG_CPU
	int		(*cpu_disable)(unsigned int cpu);
	void		(*cpu_die)(unsigned int cpu);
#endif
};

extern const struct cpu_operations *cpu_ops[NR_CPUS];
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <asm-generic/irq.h>

extern void (*handle_arch_irq)(struct pt_regs *);
extern void migrate_irqs(void);
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));

#endif
+5 −0
Original line number Diff line number Diff line
@@ -65,4 +65,9 @@ extern void secondary_entry(void);
extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);

extern int __cpu_disable(void);

extern void __cpu_die(unsigned int cpu);
extern void cpu_die(void);

#endif /* ifndef __ASM_SMP_H */
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

extern unsigned long __cpu_setup(void);

struct cpu_info __initdata cpu_table[] = {
struct cpu_info cpu_table[] = {
	{
		.cpu_id_val	= 0x000f0000,
		.cpu_id_mask	= 0x000f0000,
Loading