Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2459341imm; Wed, 16 May 2018 13:14:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZof8ovY62BCM0+iWo5Td7TvecBHuNidc9aIPaveiIjaDURcX2mVAHDCRYBSykBOgbCgBepo X-Received: by 2002:a62:ba09:: with SMTP id k9-v6mr2341925pff.245.1526501647866; Wed, 16 May 2018 13:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526501647; cv=none; d=google.com; s=arc-20160816; b=HBA4CzWVvmkhz4ho5OHcu/h7zVFUaR+VxSbVf1hh8tRr1z4DK5MdMafBXQV+V4uR7T +yf+ovi4V0/8esb07Y7cj3u+3POC3MkcySMFGFvnjenqeKE6Gy/nZVNqlNcPgkMSMxR2 d4SrDuWGxqevky5lYJKmBP2hYPLSqoZmw+yaEVs9YnYkkn29Gn0+vnm3Am43copO7Jrx t8mR27ztxw9quw8DJA8xI7JIrMPIfxZFxjaWAY4tF/EfOJj+fDDEbffVlkxoRuqSjeD2 +N3uAGBBlP7e3wWG2+9TDi1P7+UJ9XQpqsA2+sto+vNtpttZHZsOJ/BfnZFiAYSkY0be /kSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter :arc-authentication-results; bh=gXhCHTNjgx9KHKgJQDoKzYpYq2t09j5SWxJllTiPWmU=; b=vy5suSt2qR166Ypz73eB1RCI8Z+5LFrzmLC66iA3QAGp6Qg8RPy7KopJSYy2z6lkI8 C8sox6RNnsM4bQJph/2DMBk6Rf4v0DwDZeQCrpXZdr6iF6tKt8RRjJiiX7QCDxRa0yY1 u1V3Ec+vSjm2QKxDFmjz1XdU5s+QelMgHX7HtaHTt2+5qnJQkvgKhJ38l6SViESafutG d507ELCxmwVlkRoi85EstBZn5R77leouQjMp4zCeFTy8K6rBxsABft6WQsnIOCXYyVVt VlbjmCPk3oG/LegfOWsRQokZA+jQIdufpO9xEMbjIZiP9GW/p9Ut6pG/vd4E3XNUys3Z o3LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=jpptCF7n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si2724082pgr.369.2018.05.16.13.13.53; Wed, 16 May 2018 13:14:07 -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; dkim=pass header.i=@efficios.com header.s=default header.b=jpptCF7n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbeEPUNb (ORCPT + 99 others); Wed, 16 May 2018 16:13:31 -0400 Received: from mail.efficios.com ([167.114.142.138]:60916 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbeEPUNR (ORCPT ); Wed, 16 May 2018 16:13:17 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id ED1751C0564; Wed, 16 May 2018 16:13:16 -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 pBsiOL5-A9dQ; Wed, 16 May 2018 16:13:16 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 9B6E41C0560; Wed, 16 May 2018 16:13:16 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 9B6E41C0560 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1526501596; bh=gXhCHTNjgx9KHKgJQDoKzYpYq2t09j5SWxJllTiPWmU=; h=Date:From:To:Message-ID:MIME-Version; b=jpptCF7nBgZcQPv7L00irHBGsd9O3qWphYh0uBFXr6nHoo3UU7vJTsEMVv4yv0Eld ANHwH0F7LDhXJsK4JramEtQwm9z1ln/63H1gfUkSd3q24P3jH1zMQB9pDzwA1/WpWO K6ifL5wOY92SQ8xvW5WXZJ32rtYITGYSg7fda3Xik4TRx0e9UHTyDpH6ENBIdWmEMd gy/3xVZalxDjjcjQE8Shfy4S+DKgnz1jNnTyShuUaG5aa2ws4kDHbR6/82nS/aRLPM /F3ldpW8q5+q60ZrPlhZPXzzpSS4nI8PkMNBWPDaoGDMAS6lppRE46kOk79MQG2Urh uHI3rJh4/bzTQ== 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 EAy-zORNBPbc; Wed, 16 May 2018 16:13:16 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 7F94E1C0554; Wed, 16 May 2018 16:13:16 -0400 (EDT) Date: Wed, 16 May 2018 16:13:16 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra Cc: "Paul E. McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson , linux-kernel , linux-api , Paul Turner , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev Message-ID: <112970629.1913.1526501596485.JavaMail.zimbra@efficios.com> In-Reply-To: <20180516161837.GI12198@hirez.programming.kicks-ass.net> References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> <20180430224433.17407-8-mathieu.desnoyers@efficios.com> <20180516161837.GI12198@hirez.programming.kicks-ass.net> Subject: Re: [PATCH 07/14] powerpc: Add support for restartable sequences MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.8_GA_2026 (ZimbraWebClient - FF52 (Linux)/8.8.8_GA_2031) Thread-Topic: powerpc: Add support for restartable sequences Thread-Index: PpuTAhPtg5HdKhcrUxmji33zT6zOXw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On May 16, 2018, at 12:18 PM, Peter Zijlstra peterz@infradead.org wrote: > On Mon, Apr 30, 2018 at 06:44:26PM -0400, Mathieu Desnoyers wrote: >> 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(); > > Again no rseq_syscall(). Same question for PowerPC as for ARM: Considering that rseq_syscall is implemented as follows: +void rseq_syscall(struct pt_regs *regs) +{ + unsigned long ip = instruction_pointer(regs); + struct task_struct *t = current; + struct rseq_cs rseq_cs; + + if (!t->rseq) + return; + if (!access_ok(VERIFY_READ, t->rseq, sizeof(*t->rseq)) || + rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs)) + force_sig(SIGSEGV, t); +} and that x86 calls it from syscall_return_slowpath() (which AFAIU is now used in the fast-path since KPTI), I wonder where we should call this on PowerPC ? I was under the impression that PowerPC return to userspace fast-path was not calling C code unless work flags were set, but I might be wrong. Thoughts ? Thanks! Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com