Commit eda8a2c5 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Ingo Molnar

perf/x86/intel: Replace deprecated CPU-hotplug functions

The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210803141621.780504-11-bigeasy@linutronix.de
parent 4f32da76
...@@ -5032,9 +5032,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev, ...@@ -5032,9 +5032,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev,
x86_pmu.attr_freeze_on_smi = val; x86_pmu.attr_freeze_on_smi = val;
get_online_cpus(); cpus_read_lock();
on_each_cpu(flip_smm_bit, &val, 1); on_each_cpu(flip_smm_bit, &val, 1);
put_online_cpus(); cpus_read_unlock();
done: done:
mutex_unlock(&freeze_on_smi_mutex); mutex_unlock(&freeze_on_smi_mutex);
...@@ -5077,9 +5077,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev, ...@@ -5077,9 +5077,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev,
allow_tsx_force_abort = val; allow_tsx_force_abort = val;
get_online_cpus(); cpus_read_lock();
on_each_cpu(update_tfa_sched, NULL, 1); on_each_cpu(update_tfa_sched, NULL, 1);
put_online_cpus(); cpus_read_unlock();
return count; return count;
} }
......
...@@ -1708,7 +1708,7 @@ static __init int pt_init(void) ...@@ -1708,7 +1708,7 @@ static __init int pt_init(void)
if (!boot_cpu_has(X86_FEATURE_INTEL_PT)) if (!boot_cpu_has(X86_FEATURE_INTEL_PT))
return -ENODEV; return -ENODEV;
get_online_cpus(); cpus_read_lock();
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
u64 ctl; u64 ctl;
...@@ -1716,7 +1716,7 @@ static __init int pt_init(void) ...@@ -1716,7 +1716,7 @@ static __init int pt_init(void)
if (!ret && (ctl & RTIT_CTL_TRACEEN)) if (!ret && (ctl & RTIT_CTL_TRACEEN))
prior_warn++; prior_warn++;
} }
put_online_cpus(); cpus_read_unlock();
if (prior_warn) { if (prior_warn) {
x86_add_exclusive(x86_lbr_exclusive_pt); x86_add_exclusive(x86_lbr_exclusive_pt);
......
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