Received: by 10.213.65.68 with SMTP id h4csp1820954imn; Thu, 29 Mar 2018 11:39:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1ESH/Lea7YAwq/zHEJAcI09ZmcZrTbvSZaJtkxGun9w4jrzlsYkhhvSCWIiDWQSQhvcwq X-Received: by 10.98.9.72 with SMTP id e69mr7340419pfd.197.1522348753227; Thu, 29 Mar 2018 11:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522348753; cv=none; d=google.com; s=arc-20160816; b=gKmFv6LODT+NwjbCvJPWuJGfH9cws92KDC+nAfPO2QPvqBwW/3gpwpImnYBQ1hEmz6 Kb9aFtbSY5Y+KccnDgKI805Yr5uuvr5hSiVqVbdHGC8rHkgRFhmofF5sfgQtFxCLm027 z+0oihuRxFArByr52/IvmuOXGyqwaN+7YWwgJBFsgHL9/PxCXMiQcNjyWISCKvKvYG6w KKmLzlHpAT8vrSxLFpmTRqjpciwwzmPX+EH06E67OuRbah5X1DXQA/gbeDyhP9GBQRDl dqHtv51lZ6PqHdm6LgFefD6wQJzdyqhYikVq3Lxog+6qQs6c1vd/7pe3ZdYxxuOrWgSK ipOA== 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:arc-authentication-results; bh=UtrFJCZw/lXBvGaS01IvQA9VC8nrAEkhqLnOAz59FpA=; b=ptNmQMNK5qe/o0G5EqqXFeNFoPESgn23enMWgapGCh3jK7KL8MTt6hQGNO1oqZFeUP 5JoczymUY2EbtuRZccrX8Zf74F7Al3S8CCcjJRLZastHVfCLtdmWwKPTFcA1cfmLq7/V ksHHbhgzyprt06PXIfm4X+nlRGQNsSMBRq7EvT0NnGIG+DHhDFZFe70TCfRn2mCM76TH 5ukpMmrc+OaLjkWOjlu7PK0u3LkWLot3ANIcvoi5+bg/lw9PiLfJ15hRYNiOmJp4zoQm yGh7MHgZ0RhUqy6gEJ3nniwkapnv/k1iBNMZ9HUgRzVg3O13EZnvGqhsYGDij/g2kW0O rRBg== 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-v6si6338933plb.459.2018.03.29.11.38.59; Thu, 29 Mar 2018 11:39:13 -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 S1752792AbeC2Shy (ORCPT + 99 others); Thu, 29 Mar 2018 14:37:54 -0400 Received: from mail.efficios.com ([167.114.142.138]:50078 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbeC2SCf (ORCPT ); Thu, 29 Mar 2018 14:02:35 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E9E841A924F; Thu, 29 Mar 2018 14:02:34 -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 cj4yCCM8G-Gz; Thu, 29 Mar 2018 14:02:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 1AE431A924C; Thu, 29 Mar 2018 14:02:34 -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 FD4sLHc3Ichh; Thu, 29 Mar 2018 14:02:34 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id F1CA91A9242; Thu, 29 Mar 2018 14:02:33 -0400 (EDT) Date: Thu, 29 Mar 2018 14:02:33 -0400 (EDT) From: Mathieu Desnoyers To: rostedt Cc: Peter Zijlstra , Thomas Gleixner , "Paul E. McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson , linux-kernel , linux-api , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Alexander Viro Message-ID: <21903915.856.1522346553810.JavaMail.zimbra@efficios.com> In-Reply-To: <20180329122439.4a909c72@gandalf.local.home> References: <20180327160542.28457-1-mathieu.desnoyers@efficios.com> <20180328174935.GK4082@hirez.programming.kicks-ass.net> <181076499.279.1522268382303.JavaMail.zimbra@efficios.com> <87410797.545.1522331641598.JavaMail.zimbra@efficios.com> <20180329142338.GD4043@hirez.programming.kicks-ass.net> <544124089.623.1522337940950.JavaMail.zimbra@efficios.com> <20180329122439.4a909c72@gandalf.local.home> Subject: Re: [RFC PATCH for 4.17 02/21] rseq: Introduce restartable sequences system call (v12) 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.7_GA_1964 (ZimbraWebClient - FF52 (Linux)/8.8.7_GA_1964) Thread-Topic: rseq: Introduce restartable sequences system call (v12) Thread-Index: qvRuBK4nMzc3YgRr7lnp2KqNAoq3Dw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Mar 29, 2018, at 12:24 PM, rostedt rostedt@goodmis.org wrote: > On Thu, 29 Mar 2018 11:39:00 -0400 (EDT) > Mathieu Desnoyers wrote: > >> Enforcing SIGSEGV on syscall entry when nested in a rseq critical section >> will not be free both in terms of syscall overhead, and in terms of code >> maintenance: we'd need to add those checks into entry.S for each architecture >> supported, which pretty much doubles the amount of architecture-specific >> code we need to implement for rseq. Currently, all we need is to hook in >> signal delivery and wire up the system call numbers. > > Why not have the check on syscall exit? Then we could use the ptrace > type mechanism to only go that path when a rseq exists for the program. Currently, anyone using ptrace on a process has pretty much given up all hopes of performance. Processes will use rseq to gain performance, not the opposite, so this deterioration will be unwelcome. One thing I would find more acceptable is to only compile in this check under a CONFIG_DEBUG_RSEQ option or something similar. This means we can then put the check at the most convenient location without caring too much about its performance impact. Thoughts ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com