Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2209737pxb; Fri, 25 Mar 2022 13:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQsV/zouDVBhbJo8vL7hUfcLsiO+oqHuFyh56O+azuDGL7a28xeUkLvL2mF+8TCl9pqw9F X-Received: by 2002:a17:90a:4306:b0:1b9:80b3:7a3d with SMTP id q6-20020a17090a430600b001b980b37a3dmr26989617pjg.66.1648238775457; Fri, 25 Mar 2022 13:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648238775; cv=none; d=google.com; s=arc-20160816; b=ArbD9uNS9GnUwvt+oTFipefsOj0OLihyUulQzKMfhcQHy8RCx975Cc/BmU29Gen4vk vnxi3d8BIN3XcOooNCNemYDwk/cJQGJhkn7yB3TfrYYwc3svBpnIHgnLkprXNfztjO7V PtgeoVBe29MrRPro6/zqxr3PkKftvPRwKCniA8i/xnF6tX7zkugZKyEgjpHt9kCMpkYg G0xmUXzl8brmgv669LXI6V2G0MpH8NWnIfig9xkvllUQtQGKivcsXmi0Qgy38vFpNJij SJgnZZh9TuBxXxPAQWkjAK+WtF2ircHLXEpc7rZy+tJb582I7A8M12s7aj6aRkwiwvOd g77w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=hEqPwrAovDrQ6PpoO5nC08egYJR1cHCHBd9nCO6wPYQ=; b=hdM51NKuMHQysFBtLenWZnx3yFR0yX2ObPRwxUmdjFeaeCIsHMhFWMGhUGLt5EMOdN WGKA3DmnDTy0AeyKdGAiMxF7i8Ow0Yxlgn2TYXY26V6QA5zcZborz5o/29EuCAIrDnUT WP1VAyrcXfoc2FSbOoQGr19SR5yzOoiHIpLfjvUVd9/ms00D4bkRcXzhsIBOyTxXqk1c IRkRp1yue7oqugLId/cswEoJ7w9zz7Slw1VNCLqu91xVBymu3DDnQsse6ipi1ndpQtAL b9UfvHCttLzlBbM3rV+NnyK1zcd9OzvKsyxB9ihG1dFpdEIN+dz0kBwPzdPvhhod9X2o P82Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=liz7mWAm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d4-20020a170903230400b00153b2d165c3si3456644plh.459.2022.03.25.13.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:06:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=liz7mWAm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8EC036B1FA; Fri, 25 Mar 2022 11:49:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347653AbiCXJBv (ORCPT + 99 others); Thu, 24 Mar 2022 05:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242899AbiCXJBu (ORCPT ); Thu, 24 Mar 2022 05:01:50 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B1E5972E1 for ; Thu, 24 Mar 2022 02:00:19 -0700 (PDT) Received: from [192.168.12.80] (unknown [182.2.71.236]) by gnuweeb.org (Postfix) with ESMTPSA id 47FC67E6FF; Thu, 24 Mar 2022 09:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1648112418; bh=RrYToTS3ZUOh2cUKEiBGqlhtdbPXGZlb2By1N74obmo=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=liz7mWAmJ0S+3flucrB8nF3mKNESBOr0EBylNIiPsZsOTO/gu4z8jHDS6Ranpxxqj 8WHPpIjZLgGPMDGMsHUj0mekpUf8EPGL/YRTwoCse7231O8ouA/+9fg/qt3riMqWQp 3qJFHaqfNUiOdBj7zosyyJlXM0ZdRMKfN0Pvx3+bjVaNBi+6DU7nAp0GGlhl3TYo22 xOobEsFDI0xgT899OwhwWYOfaF8EKLdEa7noAKUFB/jMxG/4v1BYCj4TmQSkYuWeIS Bni97cNJ2RoPJOJIg8AuaF9roVJPy0nceXrX6PW1yWssqyeIe3/nU3QQe69yHK7xKj SIbV6OC5+sIFQ== Message-ID: <266d7b7b-b803-51de-280e-35e16aa82248@gnuweeb.org> Date: Thu, 24 Mar 2022 16:00:13 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Alviro Iskandar Setiawan , Willy Tarreau Cc: "Paul E. McKenney" , Nugraha , Linux Kernel Mailing List , GNU/Weeb Mailing List , David Laight References: <20220324073039.140946-1-ammarfaizi2@gnuweeb.org> <20220324073039.140946-5-ammarfaizi2@gnuweeb.org> <20220324075728.GC18586@1wt.eu> From: Ammar Faizi Subject: Re: [PATCH v1 04/11] tools/nolibc: x86-64: Use appropriate register constraints if exist In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 3/24/22 3:33 PM, 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. OK then, I will drop this patch in the next version. I agree that it doesn't really show any technical benefit and there is no danger in doing the current implementation. And yes, the syscall6() for i386 is somewhat problematic and we've a confirmed bug that lives in many versions of GCC and it's not even fixed in the current trunk. It's proven that using register constraints can be a valid workaround to deal with this bug. 2022-03-23 13:50:18 UTC, Jakub Jelinek wrote: > Anyway, with the "b" etc. constraints (which is a good idea to use on > x86 when it has single register constraints for those but can't be used > on other arches which do not have such constraints) you just trigger > slightly different path in the RA, [...] See the discussion here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105032#c7 ^^^ That is only for syscall6() on i386. As such, I will drop this patch and another one that does this on i386. Thanks! -- Ammar Faizi