Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2185467pxb; Fri, 25 Mar 2022 12:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOYKjd4N+eSeIyJd+omw7myZnKqhP+oF5XUnUfKv3FpMTtFdiyEFJWyEUUnRf2oK5xwe1S X-Received: by 2002:a17:903:240c:b0:153:c8df:7207 with SMTP id e12-20020a170903240c00b00153c8df7207mr13317129plo.44.1648237016985; Fri, 25 Mar 2022 12:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648237016; cv=none; d=google.com; s=arc-20160816; b=fN24DOpWTFBRWC811j0Ac8ddHoNgqEyuR+WPpoC5N5Bq6KHNcHPv+LJWQldHQeM9pR oR3ma4OlQOBFni/jS3qS9J3vtE6yr1S/mXkRHFIoj0ldZiWNkV4WHdV8QBzx5Ru6u3X6 bme1bCidMyi06UMbnvq2lt0bn+9aOUv3X5LWW2cRI2gvEGdN9U6a8D81JVhqHVxOw3nX zzkg9OQ+vk7JewC7/KlcL8QMSV25WqZu5YolxT9ddS9cRZOPxMYc0JPVb+EruBVBX0Il P74miMnt7Ueva8vzXhQWL5bNoD82z9eojCC3GUPZJoK71yglzxDuO2hMww5RA/AY1oiH EWrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4rn/YvPqq9QHPvnRpaDcdZg8UfUYE2MwYwWbTwnERj8=; b=e6JYDmkuEFQXovogSzPANY2SQWpJHwpr5B00HYCG0/o9GJXCtpGN5J0j27ePg2f/cw iNLv4G/7k7+NJyVWghL87PgcT3C6akx7X/mqGiCoSlO4kSO5jdxTA3bc2GVOt3r74E0v r+lXD8tq050jACUZF4AJLhlAmSpIzGdqAFG1CDURCuh11kNMs5sFmpZ59DtdmWgUqhRt PrIbotCwSZOy7laTkCJq385vlUmRqgeOOLIFBPhpJ9PYrYrjkNPBipb5vNmZzEoedwxQ /JWWEO7Jp9oHXZ2azy5W4qW/42wvv8s2PtUUT5ybZOV2x+vZbQ+f1PJpl1+YNVATPBUA IU+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g2-20020a170902e38200b00153b2d16439si2844048ple.65.2022.03.25.12.36.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82F5D265EA2; Fri, 25 Mar 2022 11:27:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351353AbiCXPoF (ORCPT + 99 others); Thu, 24 Mar 2022 11:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351343AbiCXPn7 (ORCPT ); Thu, 24 Mar 2022 11:43:59 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 11D3BA0BDF for ; Thu, 24 Mar 2022 08:42:25 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 22OFgAuG019967; Thu, 24 Mar 2022 16:42:10 +0100 Date: Thu, 24 Mar 2022 16:42:10 +0100 From: Willy Tarreau To: Alviro Iskandar Setiawan Cc: Ammar Faizi , "Paul E. McKenney" , Nugraha , Linux Kernel Mailing List , GNU/Weeb Mailing List , David Laight Subject: Re: [PATCH v1 04/11] tools/nolibc: x86-64: Use appropriate register constraints if exist Message-ID: <20220324154210.GC19142@1wt.eu> References: <20220324073039.140946-1-ammarfaizi2@gnuweeb.org> <20220324073039.140946-5-ammarfaizi2@gnuweeb.org> <20220324075728.GC18586@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 24, 2022 at 03:33:57PM +0700, Alviro Iskandar Setiawan wrote: > On Thu, Mar 24, 2022 at 2:57 PM Willy Tarreau wrote: > > On Thu, Mar 24, 2022 at 02:30:32PM +0700, Ammar Faizi wrote: > > > Use appropriate register constraints if exist. Don't use register > > > variables for all inputs. > > > > > > Register variables with "r" constraint should be used when we need to > > > pass data through a specific register to extended inline assembly that > > > doesn't have a specific register constraint associated with it (anything > > > outside %rax, %rbx, %rcx, %rdx, %rsi, %rdi). > > > > > > It also simplifies the macro definition. > > > > I'm a bit bothered by this one because I went the exact opposite route > > in the early design precisely because I found that the current one was > > simpler. [...] > [...] > > I'd say that if there is any technical benefit in doing this (occasional > > code improvement or better support for older or exotic compilers), I'd say > > "ok go for it", but if it's only a matter of taste, I'm not convinced at > > all and am rather seeing this as a regression. Now if there's rough > > consensus around this approach I'll abide, but then I'd request that other > > archs are adapted as well so that we don't keep a different approach only > > for these two ones. > > I don't see any technical benefit for x86-64, so I don't think there > is a need in doing this. Though I personally prefer to use register > constraints if they exist instead of register variables for everything > (oh yeah, matter of taste since I don't have any technical argument to > say it's better respecting the resulting codegen). The only real issue > is for the syscall6() implementation on i386 as we've been bitten by a > real compiler issue. In short, I am neutral on this change. Just to be clear, I usually only use register constraints as well but I changed this for the syscalls since they were not sufficient, and found that the mix of the two was really not great to deal with. Thanks, Willy