Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1446749imm; Wed, 10 Oct 2018 14:58:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tWs6iYzrUlKSVfIPHMq5Zej0kP0I6rDnivLcCfM+puY++8MgyxFVtcKLW8W5tIMY1xDjR X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr30834296pgd.420.1539208708734; Wed, 10 Oct 2018 14:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539208708; cv=none; d=google.com; s=arc-20160816; b=GQlNbg1MPfYFBoxtdogpbFHutmzcpjsVmBk0w0kDM/lNzr/8HwYJC9ahWRLqrdAJU1 ISK50T1SjVduqisfb31JKjRIGEDLvcGhChaHAnInKlKoYZhLUWtKQsV39oDah10h8qo3 fugv7kTS9KlpyirnRvQgX23vNpZG7xYn39Arap0mBT8YmMGQSWLhK7VyHnEFkvoUkJ0X majMmzC5tGyEyKH/yx3DkPcQJaI8JF4zYDvE8V/h5UrasDaiY4ZI2imZxgJQQbjx9rVd s17H1j6hk5hx4Mx0bKQz3/SHFhRvOwI9YndfS7RP9jHngV/NpARSpwTZFyhG+cg4AqOV hkDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oUIrGW9D6xmOzF8YnKPvRE2IAl4gU2+Yw28MV0A5Z3g=; b=XKb+ymDWtfzHPIorrIN815Yn3TrSjFL9ggshUp265ueNjzuWUvSLSkkDQfSyOXuull cK+WdCcHxZBJMfnlTCabu9s8QZJC/AID+Kn+uqnG2QhSWacxuN2vKENGuMaOTD1tFTIo kmCvWcNG+jOf3cJV6Vq6XofZnA7c5+KRp+q1couGYx9NO0qXhpT7Ufd0Lt0BnzVbzOXK esIMbcvfPsoydKhIwwwoa4vV71Z9BI8Pzti/2jt90NxGnCy1hx9y0N2Deh7A8G1b44hJ j1qXNwd9l+qTIy3UnbH6hCPbqBbKRQ14obyMsUoR4XM+iw0f+an/5XRySuxTo0N0CrGv /ZTQ== 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 a5-v6si24458164pgk.395.2018.10.10.14.58.11; Wed, 10 Oct 2018 14:58:28 -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 S1725920AbeJKFVw (ORCPT + 99 others); Thu, 11 Oct 2018 01:21:52 -0400 Received: from gate.crashing.org ([63.228.1.57]:36565 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbeJKFVw (ORCPT ); Thu, 11 Oct 2018 01:21:52 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w9AJLG7L025576; Wed, 10 Oct 2018 14:21:17 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w9AJLC8c025535; Wed, 10 Oct 2018 14:21:12 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 10 Oct 2018 14:21:12 -0500 From: Segher Boessenkool To: Nadav Amit Cc: Richard Biener , Michael Matz , Borislav Petkov , "gcc@gcc.gnu.org" , Ingo Molnar , LKML , X86 ML , Masahiro Yamada , Sam Ravnborg , Alok Kataria , Christopher Li , Greg Kroah-Hartman , "H. Peter Anvin" , Jan Beulich , Josh Poimboeuf , Juergen Gross , Kate Stewart , Kees Cook , "linux-sparse@vger.kernel.org" , Peter Zijlstra , Philippe Ombredanne , Thomas Gleixner , "virtualization@lists.linux-foundation.org" , Linus Torvalds , Chris Zankel , Max Filippov , "linux-xtensa@linux-xtensa.org" Subject: Re: PROPOSAL: Extend inline asm syntax with size spec Message-ID: <20181010192111.GD29268@gate.crashing.org> References: <20181003213100.189959-1-namit@vmware.com> <20181007091805.GA30687@zn.tnic> <20181007132228.GJ29268@gate.crashing.org> <20181008073128.GL29268@gate.crashing.org> <20181009145330.GT29268@gate.crashing.org> <5ACDEDEA-0E42-45F2-BC80-B96EC2ABC01D@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ACDEDEA-0E42-45F2-BC80-B96EC2ABC01D@vmware.com> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nadav, On Wed, Oct 10, 2018 at 04:31:41PM +0000, Nadav Amit wrote: > at 7:53 AM, Segher Boessenkool wrote: > > How does this look? > > It looks good to me in general. I have a couple of reservations, but I > suspect you will not want to address them: > > 1. It is not backward compatible, requiring a C macro to wrap it, as the > kernel might be built with different compilers. How *could* it be backward compatible? There should be an error or at least a warning if the compiler does not support this, in general. For the kernel, the kernel already has plenty of infrastructure to support this (compiler.h etc.) For other applications it is quite trivial, too. > 2. It is specific to asm. Yes, and that is on purpose. > I do not have in mind another use case (excluding > the __builtin_constant_p), but it would be nicer IMHO to have a builtin > saying “ignore the cost of this statement” for the matter of optimizations. That is a hundred or a thousand times more work to design and implement (including testing etc.) I'm not going to do it, but feel free to try yourself! Segher