Skip to content

Commit

Permalink
arm64: signal: Use ARCH_RT_DELAYS_SIGNAL_SEND.
Browse files Browse the repository at this point in the history
The software breakpoint is handled via do_debug_exception() which
disables preemption. On PREEMPT_RT spinlock_t become sleeping locks and
must not be acquired with disabled preemption.

Use ARCH_RT_DELAYS_SIGNAL_SEND so the signal (from send_user_sigtrap())
is sent delayed in return to userland.

Cc: stable-rt@vger.kernel.org
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20211012084421.35136-1-zhe.he@windriver.com
  • Loading branch information
He Zhe authored and Sebastian Andrzej Siewior committed Oct 15, 2021
1 parent 48d6f71 commit 0c34700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arm64/include/asm/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ static inline void __user *arch_untagged_si_addr(void __user *addr,
}
#define arch_untagged_si_addr arch_untagged_si_addr

#if defined(CONFIG_PREEMPT_RT)
#define ARCH_RT_DELAYS_SIGNAL_SEND
#endif

#endif
8 changes: 8 additions & 0 deletions arch/arm64/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,14 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
} else {
local_daif_restore(DAIF_PROCCTX);

#ifdef ARCH_RT_DELAYS_SIGNAL_SEND
if (unlikely(current->forced_info.si_signo)) {
struct task_struct *t = current;
force_sig_info(&t->forced_info);
t->forced_info.si_signo = 0;
}
#endif

if (thread_flags & _TIF_UPROBE)
uprobe_notify_resume(regs);

Expand Down

0 comments on commit 0c34700

Please sign in to comment.