提交 e02eaf91 编写于 作者: Z Zheng Zengkai

arm64: Add config switch and kernel parameter for CPU0 hotplug

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3Z80Y
CVE: NA

-------------------------------------------------

New config switch CONFIG_ARM64_BOOTPARAM_HOTPLUG_CPU0 sets whether
default state of arm64_cpu0_hotpluggable is on or off.

If the config switch is off, arm64_cpu0_hotpluggable is off
by default. But arm64_cpu0_hotpluggable can still be turned on
by kernel parameter arm64_cpu0_hotplug at boot.

If the config switch is on, arm64_cpu0_hotpluggable is always on.

whether CPU0 is hotpluggable depends on cpu_can_disable(0) and
arm64_cpu0_hotpluggable.

The default value of the config switch is off.
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a7efb36d
无相关合并请求
......@@ -3457,6 +3457,14 @@
If the dependencies are under your control, you can
turn on cpu0_hotplug.
arm64_cpu0_hotplug [ARM64] Turn on arm64_cpu0_hotpluggable when
CONFIG_ARM64_BOOTPARAM_HOTPLUG_CPU0 is off.
Some features depend on CPU0. Known dependency is:
MegaRAID Tri-Mode SAS3508 may block the reboot process
after offline CPU0.
If the dependencies are under your control, you can
turn on arm64_cpu0_hotplug.
nps_mtm_hs_ctr= [KNL,ARC]
This parameter sets the maximum duration, in
cycles, each HW thread of the CTOP can run
......
......@@ -997,6 +997,34 @@ config HOTPLUG_CPU
Say Y here to experiment with turning CPUs off and on. CPUs
can be controlled through /sys/devices/system/cpu.
config ARM64_BOOTPARAM_HOTPLUG_CPU0
bool "Set default setting of arm64_cpu0_hotpluggable"
default n
depends on HOTPLUG_CPU
help
Set whether default state of arm64_cpu0_hotpluggable is on or off.
Say Y here to set arm64_cpu0_hotpluggable on by default. If this
switch is turned on, there is no need to give arm64_cpu0_hotplug
kernel parameter and arm64_cpu0_hotpluggable is on by default.
Please note: there may be some CPU0 dependencies if you want
to enable the CPU0 hotplug feature either by this switch or by
arm64_cpu0_hotplug kernel parameter.
For example:
We found the following issue related to CPU0 dependency:
1. echo 0 > /sys/devices/system/cpu/cpu0/online
2. reboot
MegaRAID Tri-Mode SAS3508 may block the reboot process.
Please make sure the dependencies are under your control before
you enable this feature.
Say N if you don't want to enable CPU0 hotplug feature by default.
You still can set arm64_cpu0_hotpluggable on at boot by kernel
parameter arm64_cpu0_hotplug.
config MPAM
bool "Support Memory Partitioning and Monitoring"
default n
......
......@@ -54,6 +54,19 @@
static int num_standard_resources;
static struct resource *standard_resources;
#ifdef CONFIG_ARM64_BOOTPARAM_HOTPLUG_CPU0
static int arm64_cpu0_hotpluggable = 1;
#else
static int arm64_cpu0_hotpluggable;
static int __init arm64_enable_cpu0_hotplug(char *str)
{
arm64_cpu0_hotpluggable = 1;
return 1;
}
__setup("arm64_cpu0_hotplug", arm64_enable_cpu0_hotplug);
#endif
phys_addr_t __fdt_pointer __initdata;
/*
......@@ -395,8 +408,12 @@ static inline bool cpu_can_disable(unsigned int cpu)
#ifdef CONFIG_HOTPLUG_CPU
const struct cpu_operations *ops = get_cpu_ops(cpu);
if (ops && ops->cpu_can_disable)
return ops->cpu_can_disable(cpu);
if (ops && ops->cpu_can_disable) {
if (cpu == 0)
return ops->cpu_can_disable(0) && arm64_cpu0_hotpluggable;
else
return ops->cpu_can_disable(cpu);
}
#endif
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部