Received: by 10.192.165.148 with SMTP id m20csp4293630imm; Mon, 30 Apr 2018 15:45:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqeGjDmKxKmn9iClU013BI5ap0sBegBThjeGWH6SNq7snPdtCP9LzDe4iTzRoT5qL9RjKq X-Received: by 2002:a63:7c04:: with SMTP id x4-v6mr11145138pgc.67.1525128347021; Mon, 30 Apr 2018 15:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525128346; cv=none; d=google.com; s=arc-20160816; b=EHf04HRQhHnSVa+/+TmUpHNvF7kIgtLlsR9afRU4DlaO+BZDUpkzciD47I1amdRnCv JFPGzC4MSKSBNQJcJJwOPH0ekQPLEh70IoMhpYtrfcfjRuBypM8hDwh3vkP7KpSn5mGc //sTGdDXhxSbfC5QPw+tVv2jHWceeUOl2FEbto+L0/iaExPwFzRRsK14XWO5J6JtVY/9 oLXuRh0Q/IuJ9wcS3pX/BCHwkYln0u4G3Dm/L8aUXKaLho/KxzyF3pFUBpu5f+v/0u8r 3DcjyZxWgVQ9+wKVlYN+JtVkkvcIsJExq5ZrVD56+04UIQFA3xBcBiizK1+EI/bQ2vPP yzGA== 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=VqYcURbgezZ590AzhNxGFo/dzLsUFkRZ2cC+ib3QkQQ=; b=mZbpd9IakarPCHqiSIgobbmjxJ+gWujfXSECeiaE+JUqw/fvRi4yVpL8pE+/ggT8Rh Id7EFLDFPFTtN/LWYWFK5ZPic7IHEMqZ2I5MwdrJCMITazo7dHYwwVNTF84/bqKymPUt 8azaOJr54WQd24bQo9dqlcnnczoL6lYeNQ1djhDtItXd1C+3O7ziL96mmtt5Yogr2TTD kbZTDpHA2XVdADZXh948LSo+12X9gU1LFYHDvY9L1moCBsY2UZwaj3xP0jDJ/7SW0N+b y8b+3STdqLVP59h0SrGWDzemsaJHCXjkHO9F7YgtVc1qVgDKhATOiS1mcOI88Cmkwccb bprg== 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 s12-v6si344852pgs.164.2018.04.30.15.45.32; Mon, 30 Apr 2018 15:45:46 -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 S1755512AbeD3Wov (ORCPT + 99 others); Mon, 30 Apr 2018 18:44:51 -0400 Received: from mail.efficios.com ([167.114.142.138]:52892 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755290AbeD3Woo (ORCPT ); Mon, 30 Apr 2018 18:44:44 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id D64701A6283; Mon, 30 Apr 2018 18:44:43 -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 mdCwUuzT0_d7; Mon, 30 Apr 2018 18:44:43 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 6D7D11A6273; Mon, 30 Apr 2018 18:44:43 -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 xrskNU23eF9I; Mon, 30 Apr 2018 18:44:43 -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 0D6D81A6262; Mon, 30 Apr 2018 18:44:43 -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 Subject: [PATCH 03/14] arm: Add restartable sequences support Date: Mon, 30 Apr 2018 18:44:22 -0400 Message-Id: <20180430224433.17407-4-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 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 CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC: Paul Turner CC: Andrew Hunter CC: Peter Zijlstra CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: Ben Maurer CC: Steven Rostedt CC: "Paul E. McKenney" CC: Josh Triplett CC: Linus Torvalds CC: Andrew Morton CC: Boqun Feng CC: linux-api@vger.kernel.org --- arch/arm/Kconfig | 1 + arch/arm/kernel/signal.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a7f8e7f4b88f..4f5c386631d4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -91,6 +91,7 @@ config ARM select HAVE_PERF_USER_STACK_DUMP select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE) select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RSEQ select HAVE_SYSCALL_TRACEPOINTS select HAVE_UID16 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) int ret; /* + * Increment event counter and perform fixup for the pre-signal + * frame. + */ + rseq_signal_deliver(regs); + + /* * Set up the stack frame */ 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) } else { clear_thread_flag(TIF_NOTIFY_RESUME); tracehook_notify_resume(regs); + rseq_handle_notify_resume(regs); } } local_irq_disable(); -- 2.11.0