Commit 496bb034 authored by Tobias Huschle's avatar Tobias Huschle Committed by Vasily Gorbik

s390/smp: disallow CPU hotplug of CPU 0

On s390, CPU 0 has special properties in comparison to other CPUs, as it
cannot be deconfigured for example. Therefore, allowing to hotplug CPU 0
introduces additional complexity when handling these properties.
Disallowing to hotplug CPU 0 allows to remove such complexities.

This follows x86 which also prevents offlining of CPU0 since commit
e59e74dc ("x86/topology: Remove CPU0 hotplug option").

[hca@linux.ibm.com: changed commit message]
Suggested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarTobias Huschle <huschle@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 4a172528
...@@ -1076,11 +1076,9 @@ static ssize_t cpu_configure_store(struct device *dev, ...@@ -1076,11 +1076,9 @@ static ssize_t cpu_configure_store(struct device *dev,
cpus_read_lock(); cpus_read_lock();
mutex_lock(&smp_cpu_state_mutex); mutex_lock(&smp_cpu_state_mutex);
rc = -EBUSY; rc = -EBUSY;
/* disallow configuration changes of online cpus and cpu 0 */ /* disallow configuration changes of online cpus */
cpu = dev->id; cpu = dev->id;
cpu = smp_get_base_cpu(cpu); cpu = smp_get_base_cpu(cpu);
if (cpu == 0)
goto out;
for (i = 0; i <= smp_cpu_mtid; i++) for (i = 0; i <= smp_cpu_mtid; i++)
if (cpu_online(cpu + i)) if (cpu_online(cpu + i))
goto out; goto out;
...@@ -1180,7 +1178,7 @@ static int smp_add_present_cpu(int cpu) ...@@ -1180,7 +1178,7 @@ static int smp_add_present_cpu(int cpu)
return -ENOMEM; return -ENOMEM;
per_cpu(cpu_device, cpu) = c; per_cpu(cpu_device, cpu) = c;
s = &c->dev; s = &c->dev;
c->hotpluggable = 1; c->hotpluggable = !!cpu;
rc = register_cpu(c, cpu); rc = register_cpu(c, cpu);
if (rc) if (rc)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment