===================================================================
@@ -19,6 +19,7 @@
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/string.h>
+#include <linux/sched/isolation.h>
#include <asm/amd_nb.h>
#include <asm/traps.h>
@@ -970,6 +971,7 @@ store_interrupt_enable(struct threshold_
{
struct thresh_restart tr;
unsigned long new;
+ int ret, idx;
if (!b->interrupt_capable)
return -EINVAL;
@@ -982,8 +984,15 @@ store_interrupt_enable(struct threshold_
memset(&tr, 0, sizeof(tr));
tr.b = b;
- if (smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1))
+ idx = block_interf_srcu_read_lock();
+ ret = smp_call_function_single_fail(b->cpu, threshold_restart_bank,
+ &tr, 1);
+ block_interf_srcu_read_unlock(idx);
+ if (ret) {
+ if (ret == -EPERM)
+ return ret;
return -ENODEV;
+ }
return size;
}
@@ -993,6 +1002,7 @@ store_threshold_limit(struct threshold_b
{
struct thresh_restart tr;
unsigned long new;
+ int ret, idx;
if (kstrtoul(buf, 0, &new) < 0)
return -EINVAL;
@@ -1007,8 +1017,14 @@ store_threshold_limit(struct threshold_b
b->threshold_limit = new;
tr.b = b;
- if (smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1))
+ idx = block_interf_srcu_read_lock();
+ ret = smp_call_function_single_fail(b->cpu, threshold_restart_bank, &tr, 1);
+ block_interf_srcu_read_unlock(idx);
+ if (ret) {
+ if (ret == -EPERM)
+ return ret;
return -ENODEV;
+ }
return size;
}