Received: by 10.223.185.116 with SMTP id b49csp1136659wrg; Wed, 14 Feb 2018 12:11:08 -0800 (PST) X-Google-Smtp-Source: AH8x225HXzcDqKCoP7i41QyHKJ/OxFfX5gTFqrN/SBK38u0jWfX/d07bO/f+mdmU+OLrhhiawaDT X-Received: by 2002:a17:902:901:: with SMTP id 1-v6mr191234plm.404.1518639067914; Wed, 14 Feb 2018 12:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518639067; cv=none; d=google.com; s=arc-20160816; b=SXLf4uTsayZpsc/2Gjk2pWKs/9gBSV3gXBti1iMN7T8z0/mFRjhDVkMIjr8qKsz35+ oHcokWXziALpT763gufipKEuHpRLt6/37EABmer3GflkzQqeKfaR5GafRSvyq80QmXNT TvLHI+wc+TCwjlU4VM1p4A335rB/zMsInlQwrZUmYRaI0LaV0tNMZOfQU2XLPB+3ZEjd jQFQklJWQ4uNUihoIZJnwiVMlVL1NEagGuN5hSTPC1Ku4LDuoo6OljMsuLnJXACeiLmL oS7+JrFSgIKovWChAk+vBwdAqwLdv5Cd/MScNry5c9rZTgARKXo4ZwDO5wA7q77yV0E3 iyZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nL/hbHNHxg6K/dhTeG/lbryJ6P8W34ECieOPjUkkDdA=; b=Hk7/mY3vGl7T1M+C0r50WNb/i4hQ5d5pZFaqx7XFtdYHcETIolN3zZLZZMr4HSL0Ho aA2QLGfBiZ9pAfS+AQl9nUo/5DpPkAKyBOC5wRAPr9SyPz7Ox9yeAUZcoTZe+emukHBb xB+uMuDfODD683gYyaEIuNWhYdEcPZ8Vu1VOlhge6AUZVsTpgUFQaWFBxqoVupWHeErm oy/dNa77xeSsh3Du5IZwbtsm7jNznmFE0kErY7k72Aybs1F9+SSFLWp2z7M5CdbcIZB0 DtxNwn2X2KE3KfkyJbqueKYLwL3SWQYmx+UUJgDQdZNzDZkHZIej48p1W5bqbKnmSeX/ MPQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=XQHWw5T8; 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 j76si3446567pfj.146.2018.02.14.12.10.53; Wed, 14 Feb 2018 12:11:07 -0800 (PST) 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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=XQHWw5T8; 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 S1161148AbeBNRWT (ORCPT + 99 others); Wed, 14 Feb 2018 12:22:19 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:44280 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161066AbeBNRWQ (ORCPT ); Wed, 14 Feb 2018 12:22:16 -0500 Received: by mail-io0-f196.google.com with SMTP id z6so25891750iob.11 for ; Wed, 14 Feb 2018 09:22:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nL/hbHNHxg6K/dhTeG/lbryJ6P8W34ECieOPjUkkDdA=; b=XQHWw5T8+lhMfrfIRjYQY/AXd/N4DYJtE4WuHn0GOHyduHbVJQ6R8Hob7+x7RMdKTW CaXg7wj6y9iQJ5g1Nd5b2nBpiwxr+2OWVD5stri60JQoSZwDpL0lcFTu8ndJBaFGm5FS Mb0sLD1JXlkwAozpS7gndU7DwezLx1lpIEP6LOR1m1DrUDoQs8Ru70CJHp5RhvzRffmu 2JS5p3pbg7SaIky9LFalSQwYvWOHjqsyOT3cOu1TQ4hQzhOs/ZL+DG299xCoH8gY20Wa 6jULuSMh09pakl7z85RVvLK806dK4zwWfOFAhnG5wHRWCGSGbAL//BH7WYAtPabQEChC G6GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nL/hbHNHxg6K/dhTeG/lbryJ6P8W34ECieOPjUkkDdA=; b=jFvyvdFrJUYN4i45A+TjXB9EvBMDq3fBF2ydsafkUWJ8dhxTGpfA7zNEbvlNMaLDxa fWq4SVTSxrFhBxb8HWnPEwOUjG723oqgtw2lghlr+zrn2Pgwq2aTIQ7VBcxRDvzX7awx 8Iqd/w88U4y3/BjJimdnTX1eEDOs5x7u0dH2fROqxqt7/IooC52ydX+asskBSUh5wNyL 0dYPl3UHvLis13sFLgSGmbGSifFPcgpmbY2NQAwc3rgHChMny62RFxGNruZ+yPkzngMF 20/XJ2zdET3Ct8+5Fl33K2P61aNyBSQ6h1voWJQ/2DtKNypm0PQ/xyAcde5SRcjPXp4X zrdg== X-Gm-Message-State: APf1xPBCE0LvDfp9wO/z/Xg05JEJq/3zcesO5PrxsfrMEJdHLNKK5AOD ehiT61DwFICKupN3H8qpiaHEmEdpiVZ6RbZkmjabFQ== X-Received: by 10.107.78.16 with SMTP id c16mr6736842iob.105.1518628936106; Wed, 14 Feb 2018 09:22:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Wed, 14 Feb 2018 09:21:55 -0800 (PST) In-Reply-To: References: From: Andy Lutomirski Date: Wed, 14 Feb 2018 17:21:55 +0000 Message-ID: Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) To: James Y Knight Cc: "Yatsina, Marina" , Kees Cook , David Woodhouse , Chandler Carruth , "Kreitzer, David L" , "Grischenko, Andrei L" , "rnk@google.com" , LLVM Developers , "ehsan@mozilla.com" , "Tayree, Coby" , Matthias Braun , Dean Michael Berris , Guenter Roeck , X86 ML , LKML , Alan Cox , Rik van Riel , Andi Kleen , Josh Poimboeuf , Tom Lendacky , Peter Zijlstra , Linus Torvalds , Jiri Kosina , "Hansen, Dave" , Tim Chen , Greg Kroah-Hartman , Paul Turner , Stephen Hines , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 3:31 PM, James Y Knight wrote: > I'd be definitely in favor having clang support asm goto. I wouldn't > want to exclude having other conversations about how to more directly > provide compiler features that the linux kernel could use, ALSO, but I > do not think that conversation should block implementing asm-goto. > > IMO, inline asm is, generally, a valuable feature to provide in the > compiler as an escape hatch, and asm goto is a relatively sane > extension of it. Supporting outgoing edges from an inline asm block is > a reasonable thing for users to desire, and as far as anyone's said so > far, seems like it ought to be fairly easily implementable, without > causing bad side-effects in the compiler. > > Of course, we generally do want to minimize the need for users to use > inline asm, by providing appropriate compiler support for the features > people would otherwise be forced to implement using asm. But I don't > see that as really any more important for asm-goto than any other > inline asm. There will always be a desire for escape hatches, to do > weird and unique things which aren't supported directly in the > compiler. (Also, the kernel is a pretty special case in terms of its > requirements, it seems exceedingly unlikely that we could ever provide > enough compiler support to let it eliminate inline asm.). > If clang implements asm goto, could you also pretty please make it better than GCC and support output constraints in the same asm statements? This would give us a very clean, short, and fast implementation for __get_user() and __put_user(), and it would also help put pressure on GCC to implement the same feature.