aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoqun Feng <boqun.feng@gmail.com>2018-06-02 08:44:00 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-06-06 05:58:33 -0400
commit8a417c48fa68b37bc6e8790414224e2cf91c4a5e (patch)
tree1e1e10d8d6cd1d125aedfeb54a24c9891fd56b60
parent05c17cedf85ba0f768e4089735d5260a9304195b (diff)
powerpc: Add support for restartable sequences
Call the rseq_handle_notify_resume() function on return to userspace if TIF_NOTIFY_RESUME thread flag is set. Perform fixup on the pre-signal when a signal is delivered on top of a restartable sequence critical section. Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Joel Fernandes <joelaf@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dave Watson <davejwatson@fb.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Paul Mackerras <paulus@samba.org> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: Chris Lameter <cl@linux.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Andrew Hunter <ahh@google.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com> Cc: Paul Turner <pjt@google.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Ben Maurer <bmaurer@fb.com> Cc: linux-api@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lkml.kernel.org/r/20180602124408.8430-9-mathieu.desnoyers@efficios.com
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/kernel/signal.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index f674006dea2f..b6c0029389fe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -216,6 +216,7 @@ config PPC
216 select HAVE_SYSCALL_TRACEPOINTS 216 select HAVE_SYSCALL_TRACEPOINTS
217 select HAVE_VIRT_CPU_ACCOUNTING 217 select HAVE_VIRT_CPU_ACCOUNTING
218 select HAVE_IRQ_TIME_ACCOUNTING 218 select HAVE_IRQ_TIME_ACCOUNTING
219 select HAVE_RSEQ
219 select IOMMU_HELPER if PPC64 220 select IOMMU_HELPER if PPC64
220 select IRQ_DOMAIN 221 select IRQ_DOMAIN
221 select IRQ_FORCED_THREADING 222 select IRQ_FORCED_THREADING
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 61db86ecd318..d3bb3aaaf5ac 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -133,6 +133,8 @@ static void do_signal(struct task_struct *tsk)
133 /* Re-enable the breakpoints for the signal stack */ 133 /* Re-enable the breakpoints for the signal stack */
134 thread_change_pc(tsk, tsk->thread.regs); 134 thread_change_pc(tsk, tsk->thread.regs);
135 135
136 rseq_signal_deliver(tsk->thread.regs);
137
136 if (is32) { 138 if (is32) {
137 if (ksig.ka.sa.sa_flags & SA_SIGINFO) 139 if (ksig.ka.sa.sa_flags & SA_SIGINFO)
138 ret = handle_rt_signal32(&ksig, oldset, tsk); 140 ret = handle_rt_signal32(&ksig, oldset, tsk);
@@ -164,6 +166,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
164 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 166 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
165 clear_thread_flag(TIF_NOTIFY_RESUME); 167 clear_thread_flag(TIF_NOTIFY_RESUME);
166 tracehook_notify_resume(regs); 168 tracehook_notify_resume(regs);
169 rseq_handle_notify_resume(regs);
167 } 170 }
168 171
169 user_enter(); 172 user_enter();