diff options
author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2018-06-02 08:43:55 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-06-06 05:58:31 -0400 |
commit | 9800b9dc13cdffb7f627e4818ba7768ff62febac (patch) | |
tree | 93f222bb2c4cac5929af61504fade922361b1026 | |
parent | d7822b1e24f2df5df98c76f0e94a5416349ff759 (diff) |
arm: Add restartable sequences support
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 frame when a signal is delivered on top
of a restartable sequence critical section.
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: "H . Peter Anvin" <hpa@zytor.com>
Cc: Chris Lameter <cl@linux.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andrew Hunter <ahh@google.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Boqun Feng <boqun.feng@gmail.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: 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-4-mathieu.desnoyers@efficios.com
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/kernel/signal.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c43f5bb55ac8..4fb45365c0ea 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -90,6 +90,7 @@ config ARM | |||
90 | select HAVE_PERF_USER_STACK_DUMP | 90 | select HAVE_PERF_USER_STACK_DUMP |
91 | select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE) | 91 | select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE) |
92 | select HAVE_REGS_AND_STACK_ACCESS_API | 92 | select HAVE_REGS_AND_STACK_ACCESS_API |
93 | select HAVE_RSEQ | ||
93 | select HAVE_SYSCALL_TRACEPOINTS | 94 | select HAVE_SYSCALL_TRACEPOINTS |
94 | select HAVE_UID16 | 95 | select HAVE_UID16 |
95 | select HAVE_VIRT_CPU_ACCOUNTING_GEN | 96 | select HAVE_VIRT_CPU_ACCOUNTING_GEN |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index bd8810d4acb3..5879ab3f53c1 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -541,6 +541,12 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) | |||
541 | int ret; | 541 | int ret; |
542 | 542 | ||
543 | /* | 543 | /* |
544 | * Increment event counter and perform fixup for the pre-signal | ||
545 | * frame. | ||
546 | */ | ||
547 | rseq_signal_deliver(regs); | ||
548 | |||
549 | /* | ||
544 | * Set up the stack frame | 550 | * Set up the stack frame |
545 | */ | 551 | */ |
546 | if (ksig->ka.sa.sa_flags & SA_SIGINFO) | 552 | if (ksig->ka.sa.sa_flags & SA_SIGINFO) |
@@ -660,6 +666,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) | |||
660 | } else { | 666 | } else { |
661 | clear_thread_flag(TIF_NOTIFY_RESUME); | 667 | clear_thread_flag(TIF_NOTIFY_RESUME); |
662 | tracehook_notify_resume(regs); | 668 | tracehook_notify_resume(regs); |
669 | rseq_handle_notify_resume(regs); | ||
663 | } | 670 | } |
664 | } | 671 | } |
665 | local_irq_disable(); | 672 | local_irq_disable(); |