Received: by 10.223.185.116 with SMTP id b49csp825461wrg; Wed, 14 Feb 2018 07:33:39 -0800 (PST) X-Google-Smtp-Source: AH8x225KOExc/wxog+38avWGr3xikGBXaMRFpQgTzcR1TFYlCXVEOFw0o8Dsibws25eVs7MY+c1m X-Received: by 10.99.122.71 with SMTP id j7mr4168131pgn.151.1518622419614; Wed, 14 Feb 2018 07:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518622419; cv=none; d=google.com; s=arc-20160816; b=eg1tXAoHdv+RRUSmSx+7WbGABlHEZ2kPqm0Zd0nRVYKFSpHgvESqzfUsqlYSQhG/Bb nVIL67NUut9kS8vlT9Keo2c/oqZES1/4q+G3GVgv9eeyPDxtCUnHq7KAyoi/gAxaPpvP obHg//jhoyqc+gcF/R5+KksexdDn6QRMv5WX8kgVEhZoLo++QNuYN6Owf+V98FwJZfPK ZdEi0iNMOgQUPVk+Km4wMzCEpmvFigYam25CB33dIqWVY6HZdU5C9W/6+fQpeSJCFysC u6Unu5FdOYjs8FMOCV5DT6G7I7vakoXmrfykyInLWFpK43UY/MlfVkc3QXDb06gBSFrj mdpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=n2TqC/hwqlg8u0iPkTqJHv16zZ0bubbUMYb0i8VW2Rs=; b=yvA+624XI5UHIX7hX6yldJJHSD6OU9Tg8zV0IN7ayCeWlq4IwaJO+wj3nRs6hU69/Y y6SXJ4wVqFi8Gd3qdhoU2UBIcq6OD/s6x1V6GvCBCkeSsmJ09lt2hX4BvdsABZ9wqhw6 zz+eZx64osna/TQIiCKT9Wqem7wrcmB9zkv1DHK3AkpuvhO2P32VJFo3XRuq1NgQa2sn QCcVZQ8eV5Wc8FnZ1XJISKDoNiizuFaKTdDo3IPFxzLpkPPyVWfdR75r1xz/TpHg8dS6 2sr+bGjTFGAa0cGLRbWEtUnvfjEY0wAOHoBGddMKRv9Q50S3aw4F186vQ0xMfh0moAIH gIBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E4VXTVUT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n78si1641432pfj.337.2018.02.14.07.33.24; Wed, 14 Feb 2018 07:33:39 -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=@google.com header.s=20161025 header.b=E4VXTVUT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031419AbeBNPbk (ORCPT + 99 others); Wed, 14 Feb 2018 10:31:40 -0500 Received: from mail-vk0-f46.google.com ([209.85.213.46]:37307 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031247AbeBNPbi (ORCPT ); Wed, 14 Feb 2018 10:31:38 -0500 Received: by mail-vk0-f46.google.com with SMTP id d125so638153vkf.4 for ; Wed, 14 Feb 2018 07:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=n2TqC/hwqlg8u0iPkTqJHv16zZ0bubbUMYb0i8VW2Rs=; b=E4VXTVUTBhJJAg5aZK/v4AwqbRAyVYtky9PG830KHxbaQ+B8nCxlmqSWqkUSnfwMDF ajCRxzxzfQLJdhMalvSkR+TkO8XhjTOD/lH/hstCHpd469wBWokhd1GJp+eqmHukpYV/ LkjAXo28MlEtzAUO2KO52jRtV9eMrtFLz8AYHdHsBKWg41sC3YPLfoceHU2OP7llkdOU RECxG+Ee6o7NTeZ+LVDcXZCzdHbC1jifDDVrcVzZLSGaZPgDbiwRiggjp2GJhoI987iH 1TzQkI0ZdXFu6PNfqTNU2Cbk0oeI4sDBL47eoo1LA7CQYyoYcFcFGTBYp1Je9W4odv+X 3oRQ== 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:content-transfer-encoding; bh=n2TqC/hwqlg8u0iPkTqJHv16zZ0bubbUMYb0i8VW2Rs=; b=YXNiKHPA6dSD+5lXbJHbnFmkFltlZtipf5MR4KnR6M1zAKfXlDpY4n311BjqUDwuOk Qt+UNGC+eqS4E0ajrQ6A6PEdJV2RQ8BC+kMcKuePA6/qqXkhH6hFH2oKngXrn0IPNHZQ 5i1Zs5MW1IlEvIu22WmTmn3RQnK4GfToSvB9luQ8Y0amA6bqg+Hs/n8L2AmyRDGfzG2v /a77BQDH70VcdhIaVCGeAo3MTXpb7cT2ZVlsSZyPwe7ZOkBHuKLZkD6obZldedI5qWjj mTPk5xGaXQ7CI1QdjmvncUl79gvinzEUz2++Su3Js/p3k+c2hDN5R+q4oigJ2Ute4oSo 1jEA== X-Gm-Message-State: APf1xPCYHEEnVkO5o5RJFR9wabJP87V9BLwxD3QqKm+1UVIqgdr2WmHV p0JEF8qjRAIZWtT9cgzA5uX+skReKkAS/ESd5vMC+w== X-Received: by 10.31.108.147 with SMTP id j19mr4680128vki.146.1518622297193; Wed, 14 Feb 2018 07:31:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.42.4 with HTTP; Wed, 14 Feb 2018 07:31:36 -0800 (PST) In-Reply-To: References: From: James Y Knight Date: Wed, 14 Feb 2018 10:31:36 -0500 Message-ID: Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) To: "Yatsina, Marina" Cc: 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 , Andy Lutomirski , "Hansen, Dave" , Tim Chen , Greg Kroah-Hartman , Paul Turner , Stephen Hines , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.). On Wed, Feb 14, 2018 at 3:33 AM, Yatsina, Marina wrote: > > Hi Kees, > > When I raised the question of whether we want to add support for "asm got= o" in llvm I got some feedback from the community that "asm goto" might not= be the best solution for the problem it was invented for (optimizing suppo= rt for tracepoints), so I stopped perusing this issue. > I'm CC-ing the developers that participated in the original thread and a = few developers that might be interested in adding support of "asm goto". > I'm also adding the llvm-dev mailing list, in case there are additional p= arties interested in voicing their opinion. > > I hope this will give this issue a push forward and we will find a soluti= on that will not prevent llvm from compiling linux kernel. > > Thanks, > Marina > > -----Original Message----- > From: Kees Cook [mailto:keescook@google.com] > Sent: Wednesday, February 14, 2018 02:29 > To: David Woodhouse ; Chandler Carruth ; Yatsina, Marina > Cc: Guenter Roeck ; X86 ML ; LKML ; Alan Cox ; Rik van= Riel ; Andi Kleen ; Josh Poimboeuf ; Tom Lendacky ; Peter Zijlstra= ; Linus Torvalds ; Ji= ri Kosina ; Andy Lutomirski ; Hansen= , Dave ; Tim Chen ; Greg= Kroah-Hartman ; Paul Turner ;= Stephen Hines ; Nick Desaulniers > Subject: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add cl= ang support) > > On Tue, Feb 13, 2018 at 4:10 PM, David Woodhouse wr= ote: > > We also need to resolve the asm-goto thing. > > Yes, this is becoming much more urgent, assuming we'll be raising the min= imum GCC version soon and drop support for lacking asm-goto... > > Do you happen to know who the right people are to include to move the dis= cussion forward? I know various kernel folks that are passionate about it, = but I'm still getting to know who to talk with from llvm. > > I see an earlier thread here: > http://lists.llvm.org/pipermail/llvm-dev/2017-April/111748.html > > It seems to end there? I'm still coming up to speed on it, so I'm likely = missing other context. > > -Kees > > -- > Kees Cook > Pixel Security > --------------------------------------------------------------------- > Intel Israel (74) Limited > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies.