summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2021-10-12 11:44:21 +0300
committerMinda Chen <minda.chen@starfivetech.com>2023-11-06 14:24:52 +0300
commit0e1ea45fac0adc430a97b15bddfcc28f6b7d48c7 (patch)
tree8fedc243de27d998104e78b8ceb30a77471058ab
parentb00b3ea5c737160dd829077636c0f5554e41ef2e (diff)
downloadlinux-0e1ea45fac0adc430a97b15bddfcc28f6b7d48c7.tar.xz
arm64: signal: Use ARCH_RT_DELAYS_SIGNAL_SEND.
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
-rw-r--r--arch/arm64/include/asm/signal.h4
-rw-r--r--arch/arm64/kernel/signal.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/signal.h b/arch/arm64/include/asm/signal.h
index ef449f5f4ba8..5e535c3e4926 100644
--- a/arch/arm64/include/asm/signal.h
+++ b/arch/arm64/include/asm/signal.h
@@ -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
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 8a9194ed981c..1d65f2801e13 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -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);