arm64: debug: avoid resetting stepping state machine when TIF_SINGLESTEP
[deliverable/linux.git] / arch / arm64 / kernel / debug-monitors.c
index 91fff48d0f574c5060525d87b1fe85185ee178ef..2751ff9c093410ef3eafe09e5fc3015f7f5d1198 100644 (file)
@@ -435,8 +435,10 @@ NOKPROBE_SYMBOL(kernel_active_single_step);
 /* ptrace API */
 void user_enable_single_step(struct task_struct *task)
 {
-       set_ti_thread_flag(task_thread_info(task), TIF_SINGLESTEP);
-       set_regs_spsr_ss(task_pt_regs(task));
+       struct thread_info *ti = task_thread_info(task);
+
+       if (!test_and_set_ti_thread_flag(ti, TIF_SINGLESTEP))
+               set_regs_spsr_ss(task_pt_regs(task));
 }
 NOKPROBE_SYMBOL(user_enable_single_step);
 
This page took 0.028022 seconds and 5 git commands to generate.