Received: by 10.192.165.148 with SMTP id m20csp4295825imm; Mon, 30 Apr 2018 15:49:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqVY2JHDbcgyBaLS3N9M2UUO5sDTEdRpsAmYafHu239DEK4vRNTf4KwHAf02t3ZWQ+KnE7b X-Received: by 2002:a63:9854:: with SMTP id l20-v6mr11081045pgo.16.1525128549774; Mon, 30 Apr 2018 15:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525128549; cv=none; d=google.com; s=arc-20160816; b=PnWDKawG9/tp0bEDZLlpV2apGvFZYc4HH1gN9GPrVS4RrYEQajOdjIS9Z/uASne1LO n7eiE86mNQnE4FhgSgbvaa9ijrPOMtYquxi714FpvcagRJsSh8CQA7vREQRF6Uy37ngo f538JD4IJdq4Qjmw7KrDJKAarK7tAmN1dMHzIjcSQFB6gkaA9LllfGIEbE1QsvhQZ+BL OKuRQn5dBkaGXEZ4cPT5FNSOHWld6XWJAfHCjckZcRK4Z3SdI9zWgOvckMj42RyiaKHJ gT8JpEtj92ar2k14Jtwnji15+sNSB3DQpiknh6o/24w2yPcJQ88PEp62kd/OV2rrtpEk /ygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=rEVtjE6zviaS4yyQpk5TE5A5c0o4kOgnachun+l8FEs=; b=e6txJcicuicq7pxeymJCbJcXxCT925Ddpak11bEdQVg+YyiyROw5Cg5ETsLsLqht2Z Ka3tMiE/A0hIm1kRzDSRBDYl5If5GqL2i7V7i9bT9GNH8cOsHAvQlBjedtNUsfVt2h5W 7R+5yMp85GB4To2FIdojuqUebu1l+vUoH0E51bGBJFtYxhGgVw4ugk4s2azW22xtjaop 7EySiINLYU1U7I8DoEPpsE+8ycRocGmMbLFE8Qmes0yrLtywlWHleVnaYGCFuiqIhvMz xnHqlbZsxyIYTHXJRLyMMALr0rCrcuZvQOe8sASG1Jhm6U1l3SJIPAXGvagWPaKwxllU f6ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184-v6si7034996pgl.38.2018.04.30.15.48.55; Mon, 30 Apr 2018 15:49:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755596AbeD3Wqz (ORCPT + 99 others); Mon, 30 Apr 2018 18:46:55 -0400 Received: from mail.efficios.com ([167.114.142.138]:52980 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755442AbeD3Woq (ORCPT ); Mon, 30 Apr 2018 18:44:46 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 21B1A1A6316; Mon, 30 Apr 2018 18:44:46 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id J8Xw2C-_YYVf; Mon, 30 Apr 2018 18:44:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 328F61A62E5; Mon, 30 Apr 2018 18:44:45 -0400 (EDT) X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b6KUgib-O0uW; Mon, 30 Apr 2018 18:44:45 -0400 (EDT) Received: from thinkos.internal.efficios.com (192-222-157-41.qc.cable.ebox.net [192.222.157.41]) by mail.efficios.com (Postfix) with ESMTPSA id B5EB31A62C1; Mon, 30 Apr 2018 18:44:44 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra , "Paul E . McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , Steven Rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes , Mathieu Desnoyers , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 07/14] powerpc: Add support for restartable sequences Date: Mon, 30 Apr 2018 18:44:26 -0400 Message-Id: <20180430224433.17407-8-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Boqun Feng 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 Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/signal.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c32a181a7cbb..ed21a777e8c6 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -223,6 +223,7 @@ config PPC select HAVE_SYSCALL_TRACEPOINTS select HAVE_VIRT_CPU_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING + select HAVE_RSEQ select IRQ_DOMAIN select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA 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) /* Re-enable the breakpoints for the signal stack */ thread_change_pc(tsk, tsk->thread.regs); + rseq_signal_deliver(tsk->thread.regs); + if (is32) { if (ksig.ka.sa.sa_flags & SA_SIGINFO) ret = handle_rt_signal32(&ksig, oldset, tsk); @@ -164,6 +166,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) if (thread_info_flags & _TIF_NOTIFY_RESUME) { clear_thread_flag(TIF_NOTIFY_RESUME); tracehook_notify_resume(regs); + rseq_handle_notify_resume(regs); } user_enter(); -- 2.11.0