x86/mtrr: 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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20210803141621.780504-8-bigeasy@linutronix.de
This commit is contained in:
parent
77ad320cfb
commit
1a351eefd4
@ -336,7 +336,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
|
|||||||
replace = -1;
|
replace = -1;
|
||||||
|
|
||||||
/* No CPU hotplug when we change MTRR entries */
|
/* No CPU hotplug when we change MTRR entries */
|
||||||
get_online_cpus();
|
cpus_read_lock();
|
||||||
|
|
||||||
/* Search for existing MTRR */
|
/* Search for existing MTRR */
|
||||||
mutex_lock(&mtrr_mutex);
|
mutex_lock(&mtrr_mutex);
|
||||||
@ -398,7 +398,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
|
|||||||
error = i;
|
error = i;
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&mtrr_mutex);
|
mutex_unlock(&mtrr_mutex);
|
||||||
put_online_cpus();
|
cpus_read_unlock();
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
|
|||||||
|
|
||||||
max = num_var_ranges;
|
max = num_var_ranges;
|
||||||
/* No CPU hotplug when we change MTRR entries */
|
/* No CPU hotplug when we change MTRR entries */
|
||||||
get_online_cpus();
|
cpus_read_lock();
|
||||||
mutex_lock(&mtrr_mutex);
|
mutex_lock(&mtrr_mutex);
|
||||||
if (reg < 0) {
|
if (reg < 0) {
|
||||||
/* Search for existing MTRR */
|
/* Search for existing MTRR */
|
||||||
@ -520,7 +520,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
|
|||||||
error = reg;
|
error = reg;
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&mtrr_mutex);
|
mutex_unlock(&mtrr_mutex);
|
||||||
put_online_cpus();
|
cpus_read_unlock();
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user