Received: by 10.192.165.156 with SMTP id m28csp2337685imm; Thu, 12 Apr 2018 12:33:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+FrGVMgLEOjD/bhiYD7EbV+rV+9790RjgwAU4zTkgXwyv26/4vlxbAo/ONhVx7G7IeWlgw X-Received: by 10.98.59.139 with SMTP id w11mr8696685pfj.96.1523561623906; Thu, 12 Apr 2018 12:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523561623; cv=none; d=google.com; s=arc-20160816; b=DFtceluCxGQYIkVOJ+QOBnt6kWMQNpZosSDoL5WhvAETxwDmB7xFBPEtY0c8UbiC2X 4hAkq1ai0HIgrspgYwLFz9V/H7LBt2vYvAIkhqrD0RxoHo2aRhyRQJziV7GnYBHkQ3vV D7Ew0xJEd+Aa3UCSSLGCzFv8634WtR7zyTx+zlVQhditQOHhNOCqBZBwFcFZix4u0HL9 aRQuSDnrlAM7v9eTJtHY1QcV+82n2XrP+0J3Oq8ja3v0BkIChnZy7Sr7FE5V2bFiHPJx 0+vcOaFhurvsCC1ZUDhx+BIcM3m5d2QXj/LpcPh9SIw0l+nQmlkxNv+6IMQk/LLIIdqe /SAQ== 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=pkZBUWZnzvPEktCmXLMjOGCJh/LokLadlONCZOFU0LQ=; b=EMeJjXc50I3BKwT2OHvHNcfB6uiKsWBv5P8vX2Ai7Pz3Zf8USjTENbEo+ZsF4Rigp9 jTPPv5Lf0TfdFCkCKtYZcdA9SZ8XCk+9cHlcmAPIYDnB0AsNdX+3bgxYJpnR8cnfkE0X TJLPRsUSEHycyLVg+LVKPqSikXxt4z9rY3Qk4TZQvEoHYWVFo+MAs8OCjLXg7X+S8IwK MiVZwZiL+Lw+IMTVFXA0PBwoEtslKRsvhMN9ByqMrvjwDPMdB2ipbnulfifHuNpcNtTG /RPW3UQ/1+2g1LP4bLFawda4E5ro0E6aVnn3Q9dWTA833RyDmscoKLxzYwkNgmA0rafz Nozg== 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 o1-v6si3835715pld.255.2018.04.12.12.33.30; Thu, 12 Apr 2018 12:33:43 -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 S1754046AbeDLTbr (ORCPT + 99 others); Thu, 12 Apr 2018 15:31:47 -0400 Received: from mail.efficios.com ([167.114.142.138]:45604 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753211AbeDLT2X (ORCPT ); Thu, 12 Apr 2018 15:28:23 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E48FF1B06EC; Thu, 12 Apr 2018 15:28:22 -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 y5mWPBiMPx5n; Thu, 12 Apr 2018 15:28:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 7D3671B06D4; Thu, 12 Apr 2018 15:28:22 -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 4BdIhD7SSsps; Thu, 12 Apr 2018 15:28:22 -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 18A4F1B06BD; Thu, 12 Apr 2018 15:28:22 -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 , Mathieu Desnoyers , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH for 4.18 08/23] powerpc: Wire up restartable sequences system call Date: Thu, 12 Apr 2018 15:27:45 -0400 Message-Id: <20180412192800.15708-9-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180412192800.15708-1-mathieu.desnoyers@efficios.com> References: <20180412192800.15708-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 Wire up the rseq system call on powerpc. This provides an ABI improving the speed of a user-space getcpu operation on powerpc by skipping the getcpu system call on the fast path, as well as improving the speed of user-space operations on per-cpu data compared to using load-reservation/store-conditional atomics. TODO: wire up rseq_syscall() on return from system call. It is used with CONFIG_DEBUG_RSEQ=y to ensure system calls are not issued within rseq 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/include/asm/systbl.h | 1 + arch/powerpc/include/asm/unistd.h | 2 +- arch/powerpc/include/uapi/asm/unistd.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index d61f9c96d916..45d4d37495fd 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h @@ -392,3 +392,4 @@ SYSCALL(statx) SYSCALL(pkey_alloc) SYSCALL(pkey_free) SYSCALL(pkey_mprotect) +SYSCALL(rseq) diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index daf1ba97a00c..1e9708632dce 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -12,7 +12,7 @@ #include -#define NR_syscalls 387 +#define NR_syscalls 388 #define __NR__exit __NR_exit diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 389c36fd8299..ac5ba55066dd 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h @@ -398,5 +398,6 @@ #define __NR_pkey_alloc 384 #define __NR_pkey_free 385 #define __NR_pkey_mprotect 386 +#define __NR_rseq 387 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ -- 2.11.0