Skip to content

Commit 5d5dbc4

Browse files
committed
s390: Prevent hotplug rwsem recursion
The text patching functions which are invoked from jump_label and kprobes code are protected against cpu hotplug at the call sites. Use stop_machine_cpuslocked() to avoid recursion on the cpu hotplug rwsem. stop_machine_cpuslocked() contains a lockdep assertion to catch any unprotected callers. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Ingo Molnar <[email protected]> Acked-by: Heiko Carstens <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: [email protected] Cc: Peter Zijlstra <[email protected]> Cc: Sebastian Siewior <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
1 parent 9489cc8 commit 5d5dbc4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/s390/kernel/jump_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
9393
args.entry = entry;
9494
args.type = type;
9595

96-
stop_machine(__sm_arch_jump_label_transform, &args, NULL);
96+
stop_machine_cpuslocked(__sm_arch_jump_label_transform, &args, NULL);
9797
}
9898

9999
void arch_jump_label_transform_static(struct jump_entry *entry,

arch/s390/kernel/kprobes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ void arch_arm_kprobe(struct kprobe *p)
196196
{
197197
struct swap_insn_args args = {.p = p, .arm_kprobe = 1};
198198

199-
stop_machine(swap_instruction, &args, NULL);
199+
stop_machine_cpuslocked(swap_instruction, &args, NULL);
200200
}
201201
NOKPROBE_SYMBOL(arch_arm_kprobe);
202202

203203
void arch_disarm_kprobe(struct kprobe *p)
204204
{
205205
struct swap_insn_args args = {.p = p, .arm_kprobe = 0};
206206

207-
stop_machine(swap_instruction, &args, NULL);
207+
stop_machine_cpuslocked(swap_instruction, &args, NULL);
208208
}
209209
NOKPROBE_SYMBOL(arch_disarm_kprobe);
210210

0 commit comments

Comments
 (0)