Commit d1d1ef97 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Stefan Bader

cpu/hotplug: Split do_cpu_down()

Split out the inner workings of do_cpu_down() to allow reuse of that
function for the upcoming SMT disabling mechanism.

No functional change.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>

CVE-2018-3620
CVE-2018-3646

[smb: Minor context adjustments, drop target argument]
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent f023a2ab
......@@ -430,20 +430,19 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
return err;
}
static int cpu_down_maps_locked(unsigned int cpu)
{
if (cpu_hotplug_disabled)
return -EBUSY;
return _cpu_down(cpu, 0);
}
int cpu_down(unsigned int cpu)
{
int err;
cpu_maps_update_begin();
if (cpu_hotplug_disabled) {
err = -EBUSY;
goto out;
}
err = _cpu_down(cpu, 0);
out:
err = cpu_down_maps_locked(cpu);
cpu_maps_update_done();
return err;
}
......
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