Received: by 10.223.185.116 with SMTP id b49csp1137291wrg; Wed, 14 Feb 2018 12:11:48 -0800 (PST) X-Google-Smtp-Source: AH8x226dejZzkVu3q/ziBacVMio0jDr8+iRZqvIBUUxU8E2IolA2O3FgmXENYgtiqghIdeHPtNoo X-Received: by 10.99.139.199 with SMTP id j190mr173060pge.334.1518639108294; Wed, 14 Feb 2018 12:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518639108; cv=none; d=google.com; s=arc-20160816; b=tnCfU6JpxrArPSrGxWAsoUlQUxUcDoGGoq7NGiAv3ofyDkOnB9qWk9StKmWiHAIQkC xvM5rnukdAWg+w3ivjT3dorI7lXgRldlzm+DS312bnO9dFA/bq5BZa1JO67N0bvv+9X6 ggaW4WXXEZIlgZVQ3cmwknazgP6LAbHvP1QKUl6uYpd7qWp6w/w4Io+DjuCtyo2P5cK3 h1h4T9ThX11xxWnWyMiyRI1liJWjr3OLHYXenbjeYpbSdngPqkVKyHWi+Qdh4jcCAO9Z ayNY6RARAEJfZ1RQxBFXAMV3kbd2fw3t9eZJVRE7vwsxi+rr/RxqRmxPFxrdehI/JVv8 kfHA== 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=CfGdu8zw1fpY7H601LGMGfIxaar//qQ5FAj2G2BtMbk=; b=u0pb5Hef8+zIa0JefKsq79kRPKs4S8g6L9bx/00MnCrJ7518IjJu/vjMg3sRVk8rRa 6ciyhksthEdMrd/UaIDCUfNDXfJj1t9pbSA2+jR55zrEkI5C9M4JoL7Ib58DH+9/AYdc GXURJd18mWRPsT6DbzRmJnbIEvZvhV+AyG6sUHMgkc2MXvgZuqfoyQyzZwSosh5K0mee 7JVpjS+SkLPkGpjS5D5oYgDu8RWRGceReXX00WopxaIdQuMvnXe2F9jW1h9o6t9Cdw+o vT7OumnF8co90csTQAgh8pldGN2UtyQ9wJcEU/2J4VZki7u9qlQ8VP+h2+MsfHq/bKM7 iJ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qg1BjGkm; 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 s13-v6si221558plp.787.2018.02.14.12.11.33; Wed, 14 Feb 2018 12:11:48 -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=fail header.i=@gmail.com header.s=20161025 header.b=qg1BjGkm; 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 S1161347AbeBNRjj (ORCPT + 99 others); Wed, 14 Feb 2018 12:39:39 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:53606 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161333AbeBNRjg (ORCPT ); Wed, 14 Feb 2018 12:39:36 -0500 Received: by mail-it0-f68.google.com with SMTP id w63so2471834ita.3 for ; Wed, 14 Feb 2018 09:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CfGdu8zw1fpY7H601LGMGfIxaar//qQ5FAj2G2BtMbk=; b=qg1BjGkmc1VrxmX/roSFEExo78go0v/kl1HCYpbsc/0s6oGXCAc5xC7Rddrl7mONXO 2lzBv1j7spdY6FhAif384+tIsqiUOIJtdW0mbYREXefmQvPWSQn+ljWmVGnkgjgo6DjL Ub2CvdUqQfKfB6cby/mRyLkM4H1pmdcVOIF69CHNUtM6WeeUutj77igovegew4yX1oW7 xs/CP+ZDYdhI/NRl1ufSh3id378VKD9u1Nace6eweATYgZG/u/JmRFHrCnmUj/HmHrCJ 30NAEaxgZlBy8CVTN97qn7V/TSwva7rBTvN2avI53Rli77psaRI0xTilIf8mn2T8M5jo RXJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CfGdu8zw1fpY7H601LGMGfIxaar//qQ5FAj2G2BtMbk=; b=qOzyZQYDT+zwC8mWsK3JLWaSjo0p1G4dXO8f89tuAg0YWxK5/e+DDxeo38iEe9JJCX SOkBfJF3l8D46gvd7saJaetBizgE0WZW/iYLJ3QI0rE4AXZ3GxFcLwhrhnJ/CFNqDRi4 m6a5fYfd0GvjuGLbrkdeIAGChkKyA+5npDPUpodOqh1sNXnp50WAJFZCnwtN7RgG9SJ3 nx76tNxT3oogABekadEmrDevh79XwoI19IGoYZe6SxXnM+6o/0y22f9zzFxJjQdwQlZ6 T885jcDOnUf+LUS2XVqmr8q6DSMJokrKkD+6lqmrtAhEvUX1Nr+gFijBadR5imABKEzK vnfQ== X-Gm-Message-State: APf1xPDeUm4/tB1+xmLEXfb2ad8l20YMdOsrxruDIfZ30m3c7DndAu0P jyL7GSsygXW2GEhWCgSG02v7kaxTNU2UkGbIOjw= X-Received: by 10.36.60.82 with SMTP id m79mr6784783ita.152.1518629975300; Wed, 14 Feb 2018 09:39:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Wed, 14 Feb 2018 09:39:33 -0800 (PST) In-Reply-To: <20180214103434.GY25181@hirez.programming.kicks-ass.net> References: <20180214090851.GU25181@hirez.programming.kicks-ass.net> <20180214103434.GY25181@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Wed, 14 Feb 2018 09:39:33 -0800 X-Google-Sender-Auth: 23Rf1XZMTWNmc7zia2mfZEVFC2Q Message-ID: Subject: Re: clang asm-goto support (Was Re: [PATCH v2] x86/retpoline: Add clang support) To: Peter Zijlstra 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 , James Y Knight , Guenter Roeck , X86 ML , LKML , Alan Cox , Rik van Riel , Andi Kleen , Josh Poimboeuf , Tom Lendacky , Jiri Kosina , Andy Lutomirski , "Hansen, Dave" , Tim Chen , Greg Kroah-Hartman , Paul Turner , Stephen Hines , Nick Desaulniers , Will Deacon 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 2:34 AM, Peter Zijlstra wrote: > > So it's far more than just tracepoints. We use it all over the kernel to > do runtime branch patching. Side note: I have a patch to the user access code to do "asm goto" for the exception handling too. In fact, the infrastructure is there already, but because we supported older gcc versions that didn't have asm goto, I never applied the final patch to actually make use of it. See "unsafe_put_user()", which currently does if (unlikely(__pu_err)) goto err_label; rather than just have the exception table itself directly reference "err_label", and not needing any code at all in the regular path. I suspect there are other things like that, where the lack of "asm goto" means that it's not worth the pain of having two code paths. Once we update to a newer gcc requirement, those suddenly will also very naturally use asm goto. The other asm use that the clang people might want to look at is the "condition codes as return value" one. That one we currently handle with CC_SET/CC_OUT, and it's somewhat more amenable to those kinds of games, so missing it isn't as nasty. But it *is* a useful "modern" extension of gcc asms. Maybe clang already supports cflags output, I haven't checked. Linus